SELECT category_name, type , filename, description FROM Media WHERE (tags LIKE 'test') OR (description LIKE 'test') ORDER BY ordernum DESC When I run the explain the key, key_len and red are all null Thanks
What are the data types of the columns? Generally you put indexes on columns that are in your where clause. However, it isn't always a good idea to put an index on a text field because it greatly increases the database size and may not improve the query speed at all. From your query, the `tags` column would be my first inclination, but it is always better to be using numeric fields (int, smallint, etc..) when indexing.
Yeah I tried to put an index on both the where clauses but it still said null for the key here are the datatypes tags varchar(100) description varchar(200) Here is what I tried to do ALTER TABLE `Media` ADD INDEX ( `description` , `tags` ) And it produced this id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Media ALL NULL NULL NULL NULL 1723 Using where; Using filesort Code (markup):