https://bugzilla.wikimedia.org/show_bug.cgi?id=16645


Brad Jorsch <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]




--- Comment #3 from Brad Jorsch <[email protected]>  2008-12-15 
20:58:51 UTC ---
It could make the difference between MySQL using "const" or "eq_ref" instead of
"ref" when planning the query. MySQL doesn't seem to be smart enough to realize
the non-UNIQUE key is still going to be unique.

I ran the following test:

create table foo (i integer not null, j integer not null, unique key key1
(i,j), key key2 (i,j)) engine=InnoDB;

-- Insert 100 records into foo, for (0,0) - (9,9)

explain select * from foo force index (key1) where i=4 and j=2;
|  1 | SIMPLE      | foo   | const | key1          | key1 | 8       |
const,const |    1 | Using index | 

explain select * from foo force index (key2) where i=4 and j=2;
|  1 | SIMPLE      | foo   | ref  | key2          | key2 | 8       |
const,const |    1 | Using index | 


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to