Emergency

Search Results for: convert row into column

Beware of MyISAM Key Cache mutex contention

Today I was working with the client loading data to MyISAM tables at very high rate. Hundreds of millions rows are loaded daily into single MySQL instance with bursts up to 100K of records/sec which …

Read More
 

Picking datatype for STATUS fields

Quite commonly in the applications you would need to use some kind of “status” field – status of order – “new”, “confirmed”, “in production”, “shipped” status of job, message etc. People use variety of ways …

Read More
 

Stored Function to generate Sequences

Today a customer asked me to help them to convert their sequence generation process to the stored procedure and even though I have already seen it somewhere I did not find it with two minutes …

Read More
 

Using MMM to ALTER huge tables

Few months ago, I wrote about a faster way to do certain table modifications online. It works well when all you want is to remove auto_increment or change ENUM values. When it comes to changes …

Read More
 

Using VIEW to reduce number of tables used

Many Open Source software solutions use database per user (or set of tables per user) which starts to cause problems if it is used on massive scale (blog hosting, forum hosting etc), resulting of hundreds …

Read More
 

What exactly is read_rnd_buffer_size

Looking for documentation for read_rnd_buffer_size you would find descriptions such as “The read_rnd_buffer_size is used after a sort, when reading rows in sorted order. If you use many queries with ORDER BY, upping this can …

Read More
 

Implementing efficient counters with MySQL

On many web sites you would see a counter how many time given object – blog post, forum thread, image, movie etc was viewed. This is sometimes handy feature but it can be rather expensive …

Read More
 

Merge Tables Gotcha

I had the interesting customer case today which made me to do a bit research on the problem. You can create merge table over MyISAM tables which contain primary key and global uniqueness would not …

Read More
 

MySQL automatic data truncation can backfire

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 …

Read More
 

Extended EXPLAIN

One nice feature added for EXPLAIN statement in MySQL 4.1 is EXTENDED keyword which provides you with some helpful additional information on query optimization. It should be used together with SHOW WARNINGS to get information …

Read More