Posts Tagged ‘insert’
Thursday, July 24th, 2008
MySQL provides many extentions to SQL which help performance in many common use scenarios. Among these are INSERT … SELECT, INSERT … ON DUPLICATE KEY UPDATE, and REPLACE.
I rarely hesitate to use the above since they are so convenient and provide real performance benefits in many situations. MySQL has other keywords which are more dangerous, however, and should be used sparingly. These include INSERT DELAYED, which tells MySQL that it is not important to insert the data immediately (say, e.g., in a logging situation). The problem with this is that under high load situations the insert might be delayed indefinitely, causing the insert queue to baloon. You can also give MySQL index hints about which indices to use. MySQL gets it right most of the time and when it doesn’t it is usually because of a bad scheme or poorly written query.
Tags: DUPLICATE KEY, index, insert, MySQL, Query, replace, Select, Shortcuts, specific, update
Posted in MySQL, tricks | No Comments »
Thursday, July 24th, 2008
Frequently we query our database for a value but then have to always do the same manipulation on it before we can use it. Well it can often be useful to do this “once” in the database and then store the manipulated value in a separate column of the database.
Here is a very simple example
INSERT INTO tbl_name (col1,col2) VALUES(15,col1*3.14159);
Where col2 is set to the value of col1*pi
You could also do more complex calculation/filtering/shortening in your code eg php,ASP etc
Tags: column, Data, database, Derived, Frequently, insert, INTO, manipulated, MySQL, once, separate, useful, values
Posted in MySQL, tricks | No Comments »
Thursday, July 24th, 2008
Use multiple-row INSERT statements to store many rows with one SQL statement.
Tags: insert, inserts, Multiple, MySQL, row, SQL, Statements, Use
Posted in MySQL, tricks | No Comments »
Thursday, July 24th, 2008
* Use INSERT LOW_PRIORITY when you want to give SELECT statements higher priority than your inserts.
* Use SELECT HIGH_PRIORITY to get retrievals that jump the queue. That is, the SELECT is executed even if there is another client waiting.
Tags: another, client waiting, High, insert, MySQL, priorities, Select, statement, Use
Posted in MySQL, tricks | No Comments »
Thursday, July 24th, 2008
Use insert delayed when you do not need to know when your data is written. This reduces the overall insertion impact because many rows can be written with a single disk write.
Tags: because, Data, delayed, Disk, Impact, insert, MySQL, overall, written
Posted in MySQL, tricks | 1 Comment »
Monday, June 30th, 2008
GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO ‘user’@'%’ identified by ‘password’;
Tags: Delete, GRANT, identified, insert, MySQL, password, Select, update, User
Posted in PHP, Uncategorized | No Comments »
Monday, June 30th, 2008
$last_client = mysql_query(”select LAST_INSERT_ID()”);
// or
mysql_last_insert_id();
Tags: get, id, insert, last, MySQL, Select
Posted in PHP, Uncategorized | No Comments »
Thursday, June 19th, 2008
There are plenty of things you can do and should do to optimise your feeds aside from just clicking on a couple of Feedburner “activate” buttons. Some of the things you can do are actually the same things you do to optimise any normal web page including:
* Using keywords - Use keywords in your channel and feed item titles, anchor text for both internal and external links (be considerate of other people’s SEO efforts!), channel description, and blog posts.
* Make sure links are working properly - Use full path when linking to ensure that the links are rendered properly.
* Use H1 and H2 tags - The use of heading tags for channel and feed titles are important in order to emphasise the importance of the titles. However, if you do not insert key terms in the title then you’ll simply be emphasising words you are not optimising for.
Other things you can do to SEO for your feeds that are “feed specific” include:
* submitting your feeds to appropriate directories
* offering feeds for different categories - This is especially important if you cover a wide variety of topics. If your site/blog is very specialised you might not need to do this. Note that this is useful not only to subscribers who do not wish to be deluged by blog entries they are not interested in but also to syndicators who are only interested in specific topics.
* subscribe to your feed - This isn’t a tip to boost the number of subscribers but is important in order for you to always see exactly what your subscribers see when they view your feeds.
* use MyYahoo and MyMSN - To get your feeds indexed faster and crawled more frequently by the two search engines add your RSS feed on your MyYahoo and MyMSN pages. According to Yahoo if you do this your feed will be indexed approximately within 48 hours! You might as well try this on iGoogle although I don’t know how fast this tactic will get your feed indexed by Google. To add your feed to iGoogle click on Add Stuff, click on Add feed or gadget (at the bottom left sidebar), then paste your feed URL on the box.
Tags: description, Feed, insert, keywords, links, Optimisation, plenty, SEO, Tips, “activate”
Posted in news | No Comments »