June 18, 2013

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

… them, MySQL could sometimes make use of the multiple indexes. For instance, “SELECT foo FROM bar WHERE … index merge algorithm in the “Extra” field. Here’s an example of a … user_id LIMIT 1\G *************************** 1. row *************************** id: 1 select_type: SIMPLE table: users type: …

Post: Shard-Query EC2 images available

multiplemysql> show table status like ‘ontime_fact’G *************************** 1. row *************************** Name: ontime_fact Engine: InnoDB Version: 10 Row_format: Compact Rows: 6697533 Avg_rowselect count(*) from ontime_fact;” | ./run_query Array ( [count(*)] => 135125787 ) 1 rows

Post: Efficient Boolean value storage for Innodb Tables

multiple of boolean values (yes/now or something similar) in the table and if you get many columns and many rowsmysql> select count(*) from cbool where c1NULL; +———-+ | count(*) | +———-+ | 1048576 | +———-+ 1 row

Post: SHOW INNODB STATUS walk through

mysql tables in use 1, locked 0 MySQL thread id 8079, query id 728899 localhost root Sending data select sql_calc_found_rows * from… in “Sleep” stage – if it is multiple statement transaction. Innodb also will print… “state” field are rather self explanatory. You can also see number of rows operation…

Post: ORDER BY ... LIMIT Performance Optimization

MySQL using multiple indexes on most selective… going by field from the …mysql> explain select * from test order by k limit 5; +—-+————-+——-+——-+—————+——+———+——+———+——-+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows

Post: Fishing with dynamite, brought to you by the randgen and dbqp

rows‘ section tells the data generator to produce 50 tables, with sizes from 1 row to 50 rowsFrom there, we only need to use the following command to execute the test: ./dbqp.py –default-server-type=mysql…for SELECT queries: WHERE X . char_field_name != …also wanted to create multiple schemas and we …

Comment: MySQL Query Cache

… Student (one-many-one): SELECT Consultant.id AS Consultant__id…row into multiple objects, such as function map_fields($row, $prefix = ”) { $this->id = $row[$prefix . 'id']; $this->firstname = $row[$...from the application level. Also, caching all the objects might take more memory than letting MySQL

Post: Using VIEW to reduce number of tables used

…simply rewrite software to store multiple users per table it … post123 as select id,title,body from post where user_…works for SELECT, UPDATE, DELETE queries but not for INSERT: mysql>… to specify different default fields for different views, though…tables, which will make rows available in the views….