Re: Multiple single column indexes

2006-08-02 Thread Martin Jespersen
It depends what you need and how your data looks. Say you have a table with 4 columns: col1 has 1000 dictinct values col2 has 1 dictinct values col3 has 100 dictinct values col4 has 10 dictinct values In this case: select col1,col2 from tbl where col1=... and col2=... Having a single

Multiple single column indexes

2006-08-02 Thread André Hänsel
Hi, up to now my idea of how MySQL uses indexes was, that when I have a WHERE clause with several fields and I have an index on each field, MySQL chooses one index (from which it thinks that it will return the fewest rows when matched again the condition) and uses this index to "select" a couple o