On Sat, Feb 24, 2001 at 11:33:40PM -0500, Mark Chalkley wrote:
>
> I have a question about index usage.  I've got a query that's
> showing up in the -slow log (it's taking less than long_query_time
> seconds, but I've got --log-long-format set), indicating that it's
> not using an index, and I don't understand why.
> 
> Given two tables:
> 
> CREATE TABLE c1 (id INT(8) NOT NULL UNIQUE, txt VARCHAR (10) NOT NULL UNIQUE, 
>PRIMARY KEY (id) );
> CREATE TABLE c2 (id INT(8) NOT NULL UNIQUE, PRIMARY KEY (id) );
> CREATE UNIQUE INDEX c1_txt_idx ON c1 (txt);
> 
> And the query:
> 
> SELECT * FROM c1, c2 WHERE c1.id=c2.id ORDER BY c1.txt;

How much data is there in those tables? What does the output of
EXPLAIN on that query look like?

Jeremy
-- 
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 328-7878    Fax: (408) 530-5454
Cell: (408) 439-9951

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