If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Hitting a MySQL Index

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-08, 15:13
landrun landrun is offline
Registered User
 
Join Date: Feb 2007
Posts: 20
Hitting a MySQL Index

Lets say I have a Table Ta with an index with 3 fields.
F1, F2, F3

I use a web based interface to create the index by selecting the table then selecting the fields in the index. So I don't know what 'order' the index is in.

I can run a 'show create table' statement and it shows them in oder of:
F2, F3, F1

When I query this table I want to use this index. I query (or join this table with another using the index).

I want to 'walk down the index' because it should be faster. But is this so with MySQL?? Does the Order I hit then index matter? If so, why doesn't my web based interface allow me to determine the order of the fields in the index?
Reply With Quote
  #2 (permalink)  
Old 09-30-08, 18:17
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
because your web based interface is lame, that's why

hopefully your web based interface will let you run a query, so you can always define the index--and get the right column sequence--with raw SQL
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 09-30-08, 18:20
landrun landrun is offline
Registered User
 
Join Date: Feb 2007
Posts: 20
So to recap, the order you hit the index does matter in MySQL just like in any other database. So I use sql to create my indexes rather than the web based interface?
Reply With Quote
  #4 (permalink)  
Old 09-30-08, 19:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
Quote:
Originally Posted by landrun
So I use sql to create my indexes rather than the web based interface?
if your web based interface does not let you designate the sequence of columns in the index, then yes
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On