From: Jonas Galvez Date: October 1 2010 6:48pm Subject: Indexing question List-Archive: http://lists.mysql.com/mysql/223213 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=002215048fb7a8aab3049192a351 --002215048fb7a8aab3049192a351 Content-Type: text/plain; charset=ISO-8859-1 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 --002215048fb7a8aab3049192a351--