In the first statement you are selecting * (ALL the row) from tbl1 with no
restricting comment (e.g. where) so if you are going to select every thing
in the table you do not need to use the index (MySQL uses B-tree).
Simon 

-----Original Message-----
From: Prasanth Krishna [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2003 09:31
To: [EMAIL PROTECTED]
Subject: index problem


hi

i have a database with a single table say tbl1 with an index on a
particular field say col1. when i say 

select * from tbl1;

it doesn't use the index on that table.
but if i say 

select col1 from tbl1;
it uses the index.

how to make mysql use the index on col1 for the first query?

thanks in advance.
Prasanth

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