| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Jonas Galvez | Date: | October 1 2010 6:48pm |
| Subject: | Indexing question | ||
| View as plain text | |||
Suppose I wanted to be able to perform queries against three columns of my
table: 'user_id', 'product_id' and 'created'. Most of the time I'll just be
range-selecting records from the table ordering by 'created'. But I may also
want to select where 'user_id' = something and 'product_id' in (list, of,
ids), ordered by 'created'. Do I need two separate indexes, one on 'created'
and another on ('user_id', 'product_id', 'created'), or does having only the
latter suffice the former case?
-- Jonas, http://jonasgalvez.com.br
| Thread | ||
|---|---|---|
| • Introduction and Invitation | Bill Doerrfeld | 11 Mar |
| • Indexing question | Jonas Galvez | 1 Oct |
| • RE: Indexing question | Gavin Towey | 1 Oct |
| • Re: Indexing question | Tompkins Neil | 3 Oct |
| • Re: Indexing question | Joerg Bruehe | 3 Oct |
| • Re: Indexing question | Neil Tompkins | 3 Oct |
| • Re: Indexing question | Joerg Bruehe | 4 Oct |
| • Re: Indexing question | Tompkins Neil | 4 Oct |
| • RE: Indexing question | Gavin Towey | 4 Oct |
| • Re: Indexing question | Neil Tompkins | 4 Oct |
| • Re: Indexing question | Tompkins Neil | 5 Oct |
| • Re: Indexing question | Neil Tompkins | 3 Oct |
| • Re: Indexing question | Jonas Galvez | 6 Oct |
