Hi,

On Tue, Apr 24, 2001 at 10:44:59AM -0400, Vivek Khera wrote:
> >>>>> "PJM" == Patrick J Militzer <[EMAIL PROTECTED]> writes:
> 
> PJM> I'm using mysql 3.22.27.  How can I force mysql to use index's in
> PJM> my select statement?
> 
> You don't.  SQL is a 4GL and you only describe what you want, and it
> is up to the language interpreter and optimizer to do it efficiently.
> 

Maybe it isn't the right thing to do usually, but you *can* do it:

SELECT field1, field2 FROM mytable use index ( myindex ) WHERE test = 'test';

I use it to specify an index to use for MERGE tables, because the
optimizer is less efficient on MERGE tables than on other tables.

The feature is documented in some text in the manual about JOIN syntax.

An 'ignore index' can be used as well.


Regards,

Fred.

-- 
Fred van Engen                              XO Communications B.V.
email: [EMAIL PROTECTED]             Televisieweg 2
tel: +31 36 5462400                         1322 AC  Almere
fax: +31 36 5462424                         The Netherlands

---------------------------------------------------------------------
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