Jump to content

Recommended Posts

so I'm trying really hard to tune my db and mainly improve the response time of queries which has got me redoing a bunch of indexes.

 

if you have an index on two fields in a table, is it redundant to have another index on just one of those fields? will a query that uses only one of those fields return just as fast with the two field index as it would with the one field one?

 

thx.

Link to comment
https://forums.phpfreaks.com/topic/196639-more-index-questions/
Share on other sites

is it redundant to have another index on just one of those fields? will a query that uses only one of those fields return just as fast with

 

The answer to both of those wuextions is absolutely not.  If you are using only one of the columns in the two column index then that index will not be used.  So it is smart practice to index on the single column as well if it will be used a lot iin your queries.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.