MySQL Forums
Forum List  »  General

Re: Issues with possible duplicate indices on table
Posted by: Doug Livesey
Date: December 08, 2011 03:17PM

Cheers for your reply.
The two you mentioned as redundant definitely make sense, thanks.
As for `listed_at`, there are a great number of queries that use this field to sort on, so I guess we still need that.
With regard to `shop_section_id_index_2`, my understanding (if that's not stretching the meaning of the word too far) is that the `items_shop_and_shop_section_index` key is only useful for queries on shop_id, and a combination of shop_id and shop_section_id. If that's right, then wouldn't I need another key to make queries just on shop_section_id efficient?
One other question that I have, that perhaps I should try to take up with the schema's original maintainer, would be over this line:
> UNIQUE KEY `id` (`id`,`listed_at`)
Is this not self-evidently redundant? Surely all ids would be unique, anyway, so why try to ensure that all combinations of id and listed_at are unique? Or am I misunderstanding how that works?
& thanks again for your advice, it's really appreciated.
Doug.

Options: ReplyQuote


Subject
Written By
Posted
Re: Issues with possible duplicate indices on table
December 08, 2011 03:17PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.