Archive for September, 2011

MySQL queries snapshot

The gathering of the general logs would adversely affect the performance, it would take the significant space on your devices. The continuity of this log is neighter used. But sometimes it would be nice to see what is going on at runtime – I used to do the fallowing hack: # MySQL configuration file my.cnf […]

Read more...

MySQL: Table partially archived

My goal was to create a table which is partitioned and partially archived (compressed and read-only mode). I tried to compress only one partition and change the permissions. No success. It was partially achieved by using combination with engine called merge. CREATE TABLE IF NOT EXISTS `test_arch` ( `id` int(11) NOT NULL AUTO_INCREMENT, `txt` TEXT […]

Read more...

InnoDB, phantom transactions… KILLER!

Recently, I had a problem with a client connection (with iis webservices) which blocked other transactions. The client did nothing but sleep and hold a transaction (a problem probably connected with Gap and Next-Key Locks). Eventually I made a fresh install of MySQL 5.5 (which has a very useful table in ‘information_schema’) and created a […]

Read more...

Partitioning: Backup and Restore Table (or Repair with option use_frm).

I use data files (.MYD) to keep some big tables for archiving purpose. When I need some archive data I am using to repair the table with option “use_frm”. mysql> REPAIR TABLE `test_table` use_frm; I think it is the same way how native statement RESTORE TABLE works (which is is deprecated and is removed in […]

Read more...