Hi All
Could someone explain to me why an index in a select I am doing is only
sometimes used.
The select I do is a complex one with multiple tables, and when it uses the
index it takes 1.5 seconds, but when it dosnt it takes 1 min and 25-50
seconds.
I have simplified it down and founed the
At 16:31 + 3/20/02, Steve Gardner wrote:
Hi All
Could someone explain to me why an index in a select I am doing is only
sometimes used.
The select I do is a complex one with multiple tables, and when it uses the
index it takes 1.5 seconds, but when it dosnt it takes 1 min and 25-50
seconds.
On Wed, 20 Mar 2002, Steve Gardner wrote:
Hi All
Could someone explain to me why an index in a select I am doing is only
sometimes used.
mysql explain select * from mailstat where domain_id in(2);
+--+--+---+--+-+--+-+---
-+
|
If more than a third of the rows would be selected, it is faster not to
use the index.
Over 2 million records match the '2'.
How many are there total?
Steve Gardner wrote:
Hi All
Could someone explain to me why an index in a select I am doing is only
sometimes used.
The select I do is a
Steve,
Wednesday, March 20, 2002, 6:31:09 PM, you wrote:
SG Could someone explain to me why an index in a select I am doing is only
SG sometimes used.
SG The select I do is a complex one with multiple tables, and when it uses the
SG index it takes 1.5 seconds, but when it dosnt it takes 1 min
Hi Again
Thanks for all the responces
Check the manual section on the query optimiser,.I seem to remember that
if
MySQL has to check more that some percentage of a table (30% ?) the
optimiser guesses it can search the entire table just as quickly.
Someone please correct my if I'm wrong.