Re: mysql Index?

From: Date: Tue, 06 Nov 2001 16:12:58 +0000
Subject: Re: mysql Index?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14059@lists.php.net to get a copy of this message
Can you tell me why mysql doesn't use the index all the time. There are some queries where the result is about 9000 records. It's here that is doesn't use the index. If the result is smaller, from 100-5000 it will use it. I have used explain to optimizes the queries. "Rick Emery" <remery@excel.com> wrote in message news:EAA093B474ABD311A71E00508B5FE08305C2CC18@adntex03.us.excel.com... > mySQL will evaluate the indexes that you have created. It will select the > one index that best optimizes the search. Therefore, you do not specify an > index in your query; mySQL does that for you. > > -----Original Message----- > From: shi [mailto:shimon@oek.dk] > Sent: Tuesday, November 06, 2001 9:59 AM > To: php-db@lists.php.net > Subject: [PHP-DB] mysql Index? > > > Hi group > > I'm trying to force mysql to use a index, but I get an error in the sql > statement. The sql looks like this: > > select * from indlaeg use index(message) where something = something > > The problem is, that if it doesn't use the index it will have to search more > than 100000 records and that is to slow. > > > I hope that some one can help me > > Thanks > Shimon > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#14059) next »