RE: different type column and keys for EXPLAIN

2009-12-15 Thread Manish Ranjan
work. -Original Message- From: Sergey Petrunya [mailto:pser...@askmonty.org] Sent: Monday, December 14, 2009 5:58 PM To: Manish Ranjan Cc: mysql@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN Manish, On Mon, Dec 14, 2009 at 05:33:43PM +0530, Manish Ranjan wrote

different type column and keys for EXPLAIN

2009-12-14 Thread Manish Ranjan
I am using mysql 5.0.77 on RHEL 5. Storage engine in MyISAM. Please refer to the below two statements. First query is checking for lastname 'clarke' where as second query is checking for lastname 'clark'. Rest everything is same with these two queries. However, the explain output shows ref

Re: different type column and keys for EXPLAIN

2009-12-14 Thread Johan De Meersman
I don't think there's an actual problem as such, the optimiser is just making a decision to merge the lastname and firstname indices for the second query. At a guess, I'd say that the cardinality of clark in your lastname index is too high, so it uses both; the cardinality for clarke will be

RE: different type column and keys for EXPLAIN

2009-12-14 Thread Manish Ranjan
Ranjan Cc: mysql@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN I don't think there's an actual problem as such, the optimiser is just making a decision to merge the lastname and firstname indices for the second query. At a guess, I'd say that the cardinality of clark

RE: different type column and keys for EXPLAIN

2009-12-14 Thread Manish Ranjan
@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN Heh. Try running analyze table, so the index stats are correct. If that doesn't help, you may have stumbled upon an optimizer glitch, or maybe there's something happening that I'm not seeing. If all else fails, try to add index

Re: different type column and keys for EXPLAIN

2009-12-14 Thread Johan De Meersman
, 2009 8:33 PM To: Manish Ranjan Cc: mysql@lists.mysql.com Subject: Re: different type column and keys for EXPLAIN I don't think there's an actual problem as such, the optimiser is just making a decision to merge the lastname and firstname indices for the second query. At a guess, I'd say

Re: different type column and keys for EXPLAIN

2009-12-14 Thread Sergey Petrunya
Manish, On Mon, Dec 14, 2009 at 05:33:43PM +0530, Manish Ranjan wrote: I am using mysql 5.0.77 on RHEL 5. Storage engine in MyISAM. Please refer to the below two statements. First query is checking for lastname 'clarke' where as second query is checking for lastname 'clark'. Rest