diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-03 11:18:52 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-11-03 11:18:52 +0200 |
commit | cb37c557688e2f7f0381d02f78976a1b7d1bfd65 (patch) | |
tree | fb42b514e6a321ebc5f32ccae1ccf6b55312ec9c /storage/innobase/pars/pars0pars.cc | |
parent | 3c2c03624803abd20e5e4e589fa6b14bd92c29f5 (diff) | |
download | mariadb-git-cb37c557688e2f7f0381d02f78976a1b7d1bfd65.tar.gz |
MDEV-6929: Port Facebook Prefix Index Queries Optimization
Merge Facebook commit 154c579b828a60722a7d9477fc61868c07453d08
and e8f0052f9b112dc786bf9b957ed5b16a5749f7fd authored
by Steaphan Greene from https://github.com/facebook/mysql-5.6
Optimize prefix index queries to skip cluster index lookup when possible.
Currently InnoDB will always fetch the clustered index (primary key
index) for all prefix columns in an index, even when the value of a
particular record is smaller than the prefix length. This change
optimizes that case to use the record from the secondary index and avoid
the extra lookup.
Also adds two status vars that track how effective this is:
innodb_secondary_index_triggered_cluster_reads:
Times secondary index lookup triggered cluster lookup.
innodb_secondary_index_triggered_cluster_reads_avoided:
Times prefix optimization avoided triggering cluster lookup.
Diffstat (limited to 'storage/innobase/pars/pars0pars.cc')
-rw-r--r-- | storage/innobase/pars/pars0pars.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index 655e5ba1324..c87e1f8e247 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1232,7 +1232,8 @@ pars_process_assign_list( col_sym = assign_node->col; upd_field_set_field_no(upd_field, dict_index_get_nth_col_pos( - clust_index, col_sym->col_no), + clust_index, col_sym->col_no, + NULL), clust_index, NULL); upd_field->exp = assign_node->val; |