summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-04-14 17:47:48 -0700
committerunknown <konstantin@mysql.com>2005-04-14 17:47:48 -0700
commite35244d626a14d2574efbee5c5db0dfec27cb8aa (patch)
tree2dd9382740ffd65e3d73032929fa43490d55d6ec /sql/sql_select.cc
parent9b583225b3392e5606202a14e80d947a61041812 (diff)
downloadmariadb-git-e35244d626a14d2574efbee5c5db0dfec27cb8aa.tar.gz
Add a comment to update_ref_and_keys
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8031a99f4d1..a54294f00c0 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3161,10 +3161,14 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
}
/*
- Special treatment for ft-keys.
- Remove the following things from KEYUSE:
+ Sort the array of possible keys and remove the following key parts:
- ref if there is a keypart which is a ref and a const.
- - keyparts without previous keyparts.
+ (e.g. if there is a key(a,b) and the clause is a=3 and b=7 and b=t2.d,
+ then we skip the key part corresponding to b=t2.d)
+ - keyparts without previous keyparts
+ (e.g. if there is a key(a,b,c) but only b < 5 (or a=2 and c < 3) is
+ used in the query, we drop the partial key parts from consideration).
+ Special treatment for ft-keys.
*/
if (keyuse->elements)
{