June 19, 2013

Post: MySQL Query Patterns, Optimized - Webinar questions followup

On Friday I gave a presentation onMySQL Query Patterns, Optimized” for Percona MySQL Webinars.  If…multiple columns in a compound index, then the order would matter, and it would have to match the order of columns in the index…` by a secondary index.  But the result was that it created a temporary …

Post: Multiple column index vs multiple indexes

multiple column index would be faster but I also went ahead to do some benchmarks today. I’m using couple of simple tables: CREATEMultiple Column index beats Index Merge in all cases when such index can be used. It is also worth to watchout a MySQL

Post: The Optimization That (Often) Isn't: Index Merge Intersection

columns that had single-column indexes on them, MySQL could sometimes make use of the multiple indexes. For instance, “SELECT foo FROM bar WHERE indexed_colA = X OR indexed… recently that did indeed attempt to use index_merge, but with disappointing results. CREATE TABLE users ( user_id INT UNSIGNED …

Post: Join Optimizations in MySQL 5.6 and MariaDB 5.5

…you could be reading the same page multiple times into the buffer pool. So considering…index range lookups. This means MySQL can employ many other optimizations like for example if columns other then the secondary key columns… a hash table will be created based on the columns of table t1 that are …

Post: Quickly finding unused indexes (and estimating their size)

indexes; mysql> create view droppable_indexes as select all_indexes.table_schema as table_schema, all_indexes.table_name as table_name, all_indexes.index_name as index

Post: Find and remove duplicate indexes

on the same column This is the easiest one. You can create multiple indexes on the same column and MySQL won’t complain. Let’s see this example: mysql> alter table t add index(name); mysql> alter table t add index

Post: Multi Column indexes vs Index Merge

…=’CA’ they would create 2 separate indexes on AGE and STATE columns. The better strategy is often to have combined multi-column index on (AGE,STATE). Lets… than multiple column indexes. This is in case you’re using OR between the columns. In this case the combined index is useless and MySQL has…

Post: InnoDB Full-text Search in MySQL 5.6 (part 1)

… full-text index on it, and then I create one, the following warning is generated: mysql> alter table…you create a column called FTS_DOC_ID which is a BIGINT UNSIGNED NOT NULL with a unique index on…re on the subject of adding and dropping FT indexes, it’s entirely possible to DROP multiple FT indexes

Post: Duplicate indexes and redundant indexes

… having multiple keys on same column(s) – I guess someone thought key would make sense while did not notice it was already created. MySQL is…created on the same column(s) – perfect example is BTREE index and FULLTEXT index, while other combinations may also make sense. Note: Order of columns in index

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 *************************** Table: innodb_myisam_stopword Create Table: CREATE… set. mysql: CREATE TABLE innodb_… FT index on the… get back multiple matches containing the…