Just added more indexes and found a good one.

thanx for the advise ! =)
/C
----- Original Message ----- 
From: "Claus Reestrup" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 29, 2002 2:28 PM
Subject: Wont use Index when data is not evenly distributed


> Cant figure out why MySQL wont use index on a big table.
> Ok, the data is not evenly distributed which might be the problem.
> 
> Look here:
> 
> I have a table with 1 million records, with the following fields:
> IdUser, int
> X, int
> Y, int
> Z, int
> C, char(10)
> 
> no, varchars, text, or blobs.
> 
> IdUser is a user identity.
> As things are right now, only 3 users are registered.
> iduser=2, 34, 39
> User 39 owns 99.999 % of the data in the table.
> 
> When using EXPLAIN, Mysql tells me that when querying the table with IdUser=39, 
>MySQL will not use index.
> Querying the table with all other idusers than 39, causes MySQL to use index.
> 
> Has anyone of you seen this behavious before?
> 
> /Claus
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to