????????ж??????д???TokuDB???????????????????(heurstic)??seqinsert_score????????????
????1) ???д????????????seqinsert_score?????(???)
????2) ???д?????????????seqinsert_score????(???)
??????seqinsert_score????100?????????????????д?????′?д??????????????????????pivot???ж???ж???????????д?????д???y????????compare????????????????Ч??
????MariaDB·?????????·filesort with small LIMIT optimization
??????MySQL 5.6.2/MariaDB 10.0.0?汾?????MySQL/MariaDB???”ORDER BY …LIMIT n”????????????μ???????????n??С??????????????????????n????????????????????????????????????????????n???? ????????????????????????????ASC????
??????????????n????????????У???????????????д????
?????????????????????δ??????????????
???????????е?????????С???????????????滻?????????Shift??????????
?????????????????2???裬????????????????????5
??????????????е????????С?????????????????С???????????????ASC????????
????????????????臨????m*log(n)??m?????????????????n?LIMIT?????????????????????????臨????m*log(m)????n?С??m????????????Ч??
??????????MySQL 5.6?У?????optimizer_trace????к???????????????μ???м????????????????á?MariaDB 10.013?????????????????????????м????????????
????Sort_priority_queue_sorts
????????: ???????????????????????(?????????=Sort_range+Sort_scan)
??????Χ: Global?? Session
????????????: numeric
????????汾: MariaDB 10.0.13
????????MariaDB???????????????Slow Log?С?????? log_slow_verbosity=query_plan????????Slow Log?п?????????????
????# Time: 140714 18:30:39
????# User@Host: root[root] @ localhost []
????# Thread_id: 3  Schema: test  QC_hit: No
????# Query_time: 0.053857  Lock_time: 0.000188  Rows_sent: 11  Rows_examined: 100011
????# Full_scan: Yes  Full_join: No  Tmp_table: No  Tmp_table_on_disk: No
????# Filesort: Yes  Filesort_on_disk: No  Merge_passes: 0  Priority_queue: Yes
????SET timestamp=1405348239;SET timestamp=1405348239;
????select * from t1 where col1 between 10 and 20 order by col2 limit 100;
????“Priority_queue: Yes” ??????Query????????????е???м??(pt-query-digest ???????????? Priority_queue ?????)??????????????????????