EmergencyEMERGENCY? Get 24/7 Help Now!

MySQL Session variables and Hints

 | December 28, 2006 |  Posted In: Insight for Developers

MySQL has two ways to find tune execution of particular query. First is MySQL Hints, such as SQL_BIG_RESULT, STRAIGHT_JOIN, FORCE INDEX etc. You place these directly into the query to change how query is executed for example SELECT STRAIGHT_JOIN * FROM A FORCE INDEX(A) JOIN B The other part is session variable. If you know […]

Read More

COUNT(*) for Innodb Tables

 | December 1, 2006 |  Posted In: Insight for Developers

I guess note number one about MyISAM to Innodb migration is warning what Innodb is very slow in COUNT(*) queries. The part which I often however see omitted is fact it only applies to COUNT(*) queries without WHERE clause. So if you have query like SELECT COUNT(*) FROM USER It will be much faster for […]

Read More

Trailing spaces in MySQL

 | November 27, 2006 |  Posted In: Insight for Developers

In the past life was easy in MySQL. Both CHAR and VARCHAR types meant the same, only being difference in the sense of fixed or dynamic row length used. Trailing spaces were removed in both cases. With MySQL 5.0 however things changed so now VARCHAR keeps trailing spaces while CHAR columns do not any more. […]

Read More

Are PHP persistent connections evil ?

 | November 12, 2006 |  Posted In: Insight for Developers

As you probably know PHP “mysql” extension supported persistent connections but they were disabled in new “mysqli” extension, which is probably one of the reasons some people delay migration to this extension. The reason behind using persistent connections is of course reducing number of connects which are rather expensive, even though they are much faster […]

Read More

When EXPLAIN can be misleading

 | November 12, 2006 |  Posted In: Insight for Developers

One think I can see with people using EXPLAIN is trusting it too much, ie assuming if number of rows is reported by EXPLAIN is large query must be inefficient. It may not be the case. The question is not only about stats which may be wrong and which is why you may want to […]

Read More

Wishes for new “Pure PHP” MySQL driver

 | October 28, 2006 |  Posted In: Insight for Developers

If you’re following MySQL or PHP landscape you should have seen announcement by MySQL to develop pure PHP driver. If not – Here is FAQ . I’m to meet the team (Georg, Andrey etc) which will be developing this driver during my visit to Open Source Database Conference in November so I thought it would […]

Read More

Small things are better

 | October 8, 2006 |  Posted In: Insight for Developers

Yesterday I had fun time repairing 1.5Tb ext3 partition, containing many millions of files. Of course it should have never happened – this was decent PowerEdge 2850 box with RAID volume, ECC memory and reliable CentOS 4.4 distribution but still it did. We had “journal failed” message in kernel log and filesystem needed to be […]

Read More

APC or Memcached

 | September 27, 2006 |  Posted In: Insight for Developers

A while back I did Cache Performance Comparison for LAMP Stack. Looking at this data you can see memcached is about 5 times as slow as APC, and this is with tests done on localhost – with network difference is going to be larger, even with fastest network. Such latency can add up especially if […]

Read More