From: Thilo Salmon Date: April 16 1999 3:25pm Subject: How do I force the use of indices within select queries? List-Archive: http://lists.mysql.com/mysql/1958 Message-Id: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, I'm trying to optimize a simple select query on a single table w/ roughly 2 million rows and 10 columns. It looks like: SELECT * FROM table where (a = '1' or a= '2') and (b = '1' or b='2') and c = '3' a, b and c are indexed. However, when I use explain to find out which index is used, it turns out that c's is used. Since there are only two possible values for c, I would very much prefer to force MySQL to use either a or b's index. Is there a way to do this? Can't MySQL use indices for fields that occur at multiple times within s single whereclause? Can MySQL even use multiindices for this query? I didn't find anything in the docs, but perhaps I'm lacking some basic understanding of SQL. How would you go about improving the performance for this query? I'm looking into 10-20 queries a second on a Intel/Linux box. Ciao Thilo