I have a script that I am trying to speed up. Its written in php and uses mysql.
With the following statement, where should indexes be or how can this statement be optimized? It is taking a good 15 seconds to display this.. (50 items)
SELECT n_date, n_title, news, short_text, n_id, global_ngid, catagory_id , nfo FROM news WHERE catagory_id IN (5,6,47,50) and ( (catagory_id = 5) or (catagory_id = 6) or (catagory_id = 47) or (catagory_id = 50) ) AND ngid = global_ngid AND valid = 0 ORDER BY n_id DESC LIMIT 0,50
thanks