Explain MySQL indexes for me?
Anyone want to explain MySQL indexes for me? I can’t seem to get them to work for a SELECT statement that includes OR. For example:
SELECT * FROM table_name WHERE column = 'x' OR column2 = 'y';
I’ve read in the manual others have trouble with OR too… So for now I’ve just made the queries use a single column (they switch back and forth depending on a variable).
The difference is striking, using the index on a single-column query the time is around .00015 seconds. Without an index and using OR, the query takes .3 seconds. Since I’m doing a lot of these queries, 3 a second is a deal breaker.
Any help would be appreciated. I don’t really have a mental hold on why indexes work in the first place, understanding that would probably be the key.
eemi
oyziia
eemi
oyziia
eemi
oyziia
eemi
oyziia