June 18, 2013

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

…There is a script to convert SQL to the Flexviews API (see convert.php below) Refresh… … AS SELECT” and/or “INSERT INTO db.schema … AS SELECT” statements …Query OK, 0 rows affected (5.73 sec) It only took about six seconds to…, simply ignore this column. It is used to prevent wide innodb primary …

Post: MySQL Indexing Best Practices: Webinar Questions Followup

… some other index and when go to Table1 to lookup row by primary key when you do …to redesign schema and queries to make it work well. Q: how does a index be used having an index on one column… similar to other comparison and same tricks may apply, for example you may benefit to convert BETWEEN into

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. rowquery to be “+james +peterson arizona” then we might expect toto take the MyISAM full-text parser code, convert it to

Post: On Character Sets and Disappearing Tables

to_2′, ‘value_fk1_to_3′, ‘value_fk3_to_1′); INSERT INTO dos2 VALUES (‘value_fk1_to_2′, ‘value_fk2_to_3′); INSERT INTO…. Whatever the reason, we decide to convert these columns to be ASCII.  We might assume that …, change column fkfrom3 fkfrom3 char(32) character set ascii not null; Query OK, 1 row

Post: Innodb row size limitation

into it: mysql> INSERT INTOconverting from a native language character set toto rewrite as joins queries that access all columns in the original table. It also requires you to

Post: Extended EXPLAIN

row in set (0.00 sec) As you see after query transformation “*” was expanded to full column list, each column was fully quantified plus MySQL optimizer converted c=”a” and pad=c; to…and place it into the query. This transformation …

Post: How to recover deleted rows from an InnoDB Tablespace

… 18, flags 1, columns 7, indexes 2, appr.rows 2844513 [...] INDEX: …to recompile the tool. To help us in the task of converting the schema definition toINTO TABLE `salaries` FIELDS TERMINATED BY ‘\t’ OPTIONALLY ENCLOSED BY ‘”‘ LINES STARTING BY ‘salaries\t’ (emp_no, from_date, salary, to_date); Query

Post: When is MIN(DATE) != MIN(DATE) ?

… update_time), INDEX `bar` (some_other_columns) …. ) ENGINE=InnoDB; When he ran this query: SELECT MIN(update_time) FROM…of zero, whereas doing a CAST() or a CONVERT() on the update_time field first (so … rows with the 0024-06-21 date. I then proceeded to dump a few thousand random datetimes into

Post: Moving from MyISAM to Innodb or XtraDB. Basics

to the database. They may be rate but it is rather hard to guaranty you will never run into… for some queries which is rather easy to check with mk-…converting tables to Innodb on restored backup. Full text search indexes, GIS, multi-columnto do updates in small chunks, almost row by row to avoid …

Post: Using VIEW to reduce number of tables used

Converting it to the views we can have “post” table which has user_id,id, title,body columns and…works for SELECT, UPDATE, DELETE queries but not for INSERT: mysql> insert into post123 values(1,”aaa”,”bbb…define a triggers on them to update base tables, which will make rows available in the views. …