June 19, 2013

Post: MySQL Indexing Best Practices: Webinar Questions Followup

… After running an analyze on a table with 11M rows I’ve seen cardinality range from 19 to …on one column and using order by on another column. do i need to add the index on column using order…may apply, for example you may benefit to convert BETWEEN into IN-ranges in some cases for better index usage….

Post: Innodb row size limitation

row on a page. If your row has variable length columns and the complete row size exceeds this limit, InnoDB chooses variable length columns… with all multi-byte characters into a VARCHAR(500) column, that value will also … that you hit this error after converting from a native language character set …

Post: How to recover deleted rows from an InnoDB Tablespace

…employees/salaries, id 18, flags 1, columns 7, indexes 2, appr.rows 2844513 [...] INDEX: name PRIMARY, id … To help us in the task of converting the schema definition to a C header… INFILE ‘/root/recovery-tool/data/salaries.recovery’ REPLACE INTO TABLE `salaries` FIELDS TERMINATED BY ‘\t’ OPTIONALLY …

Post: On Character Sets and Disappearing Tables

….  Consider the following 3 tables, each one with a single row inserted into it: SET FOREIGN_KEY_CHECKS=0; create table dos1… we were expecting. Whatever the reason, we decide to convert these columns to be ASCII.  We might assume that since the underlying…=0; Query OK, 0 rows affected (0.00 sec) (root@localhost) [oops4]> alter table dos1 change column fkto2 fkto2 char(32) character…

Post: Flexviews - part 3 - improving query performance using materialized views

… script to convert SQL to the Flexviews API (see convert.php below…… AS SELECT” and/or “INSERT INTO db.schema … AS SELECT” …every MV gets a special column `mview$pk` which is …from order_lines\G *************************** 1. row *************************** cnt: 155187034 1 row in set (32.03…

Post: InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!

column named “value”. OK, sounds easy enough: mysql: SHOW CREATE TABLE innodb_myisam_stopword\G *************************** 1. row … the MyISAM full-text parser code, convert it to a plugin, and use … MySQL version upgrade before rolling it into production! Percona has tools (pt-upgrade and…

Post: Timezone and pt-table-checksum

… handles timezone locality with timestamp fields: Values for TIMESTAMP columns are converted from the current time zone to UTC for storage, and… node2 is configured in EDT time.  Now, lets insert some rows into a table with timestamp field configured to use CURRENT_TIMESTAMP… this and reports that all 3 rows in this chunk are different and gives the REPLACE INTO statements bring node2 in sync…

Post: Extended EXPLAIN

column list, each column was fully quantified plus MySQL optimizer converted…place it into the… | key | key_len | ref | rows | Extra | +—-+——————–+——–+—————–+—————+———+———+——+———+————————–+ | 1 | PRIMARY | sbtest | ALL …

Post: Merge Tables Gotcha

…> insert into t1 values(1); Query OK, 1 row affected (0.00 sec) mysql> insert into t2 values(1); Query OK, 1 row affected… error and ask to change the column type instead). There is in fact the note about converting primary key to the key in MySQL manual Here is what it says: Note that the a column is…

Comment: How to find wrong indexing with glance view

…All queries fall into X IN (…) AND Y IN (…) AND … Some conditions fall into X …values so it can be converted to IN instead of using …use either indexes built on multiple columns or intersection of multiple accesses…index quickly returns a few rows. Enough about intersections. About booleans….