Buy Percona ServicesBuy Now!

Getting real life query speeds with MySQL

 | January 10, 2007 |  Posted In: Benchmarks, Insight for Developers

To check for query performance improvements followed indexing/query changes or MySQL configuration changes our customers often decide to run the query and see if there is any significant improvement. Leaving aside question of checking single query alone might not be the best way to see real improvement for your application, the problem they usually run […]

Read More

MySQL automatic data truncation can backfire

 | January 9, 2007 |  Posted In: Insight for Developers

I had a fun case today. There is set of cache tables which cache certain content in MyISAM tables and queries for these tables such as:

The “key” is CRC32 of the real key which is used to keep index size as small as possible so if we have a cache miss we can […]

Read More

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