…optimizer_switch=’mrr=on’ optimizer_switch=’mrr_cost_based=off’ read_rnd_buffer_size=32M optimizer_switch=’batched_key_access…In this test we can clearly see that Hash Join gives a lot of reduction in query time. The reduction in query…
Post: Missing Data - rows used to generate result set
…query actually accessed we can guess (what is important automatically !) there is potential for optimizing this query. For example: SELECT…
Post: InnoDB vs MyISAM vs Falcon benchmarks - part 1
…` (`country_id`,`state_id`,`city`) ) In this benchmark we used only read (SELECT) queries with different typical data access patterns: primary key single row… a big room for optimization. READ_PK_RANGE Query: SELECT min(dob) FROM $tableName WHERE id between %d and %d Access by range of…
Post: How to find MySQL queries worth optimizing ?
…_id: 12F03 use sbtest; SET timestamp=1347397784; select * from sbtest where pad=’abc’; The query in this case has sent zero rows (as… timestamp=1347398285; select * from sbtest where pad=’abc’; Rows_examined=0 same as Rows_sent meaning this query is optimized quite well. Note you may be thinking in this case there is no database access happening at all…
Post: Tuning InnoDB Concurrency Tickets
… in the case where I have two distinct access patterns: single row primary-key lookups and SELECT…the applicable queries. Imagine those 900-row SELECT statements were actually 10,000 row selects, this would…of the PK lookups). In other words, if you’re optimizing for throughput in this scenario, you…
Post: Database access Optimization in Web Applications.
…remember avoiding accessing database is the best way you can optimize database access. This applies …query would not need to analyze much more rows because it is optimized differently. One of typical examples here would be SELECT…seen people trying to join all queries in single UNION (with padding to …
Post: Why MySQL could be slow with large tables ?
… selectivity might show benefit from using indexes. In fact even MySQL optimizer currently does not take it into account. For In memory workload index accesses… to be extra careful working with large data sets. In MySQL single query runs as single thread (with exeption of MySQL Cluster…
Post: EXPLAIN EXTENDED can tell you all kinds of interesting things
…” which was added in MySQL 4.1 EXPLAIN EXTENDED can show you what the MySQL optimizer does to your query. You might not… query rewrites that MySQL makes when accessing views which use the MERGE algorithm. For example: mysql> create view v1 as select * from j1; Query… that the SELECT statement used in the view has been modified to include the WHERE clause that I used when accessing the view…
Post: ORDER BY ... LIMIT Performance Optimization
… “system” access type it is effectively removed from join execution (replaced with constants) and so ORDER BY can be optimized even if…) Force index if needed In some cases MySQL Optimizer may prefer to use different index, which has better selectivity or just better estimates… end up in slow query log as query which does not use indexes, even if it is quite fast: mysql> explain select * from test…

