StefanRSA Posted March 5, 2012 Share Posted March 5, 2012 I am doing a lookup of a tables primary index key.... But ut shows up in my slow query log.... My Query is as follow: SELECT * FROM adcat WHERE id != '11' ORDER BY clinkname = 'jobs' DESC If I query the lookup with EXPLAIN, I get the following: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE adcat ALL PRIMARY,id NULL NULL NULL 12 Using where; Using filesort As far as I understand it (I am still a rookie) there is no index to read it from....? clinkname is also indexed... Here is another simple query also popping up in the slow-query log.... Why if the addate field is indexed??? What am I missing? SELECT addate FROM ads ORDER BY addate DESC LIMIT 1; Please help Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 5, 2012 Share Posted March 5, 2012 Run this and share results: describe adcat; Quote Link to comment Share on other sites More sharing options...
StefanRSA Posted March 6, 2012 Author Share Posted March 6, 2012 Thanks LG... Here it is... I am using MySQL client version: 4.1.22 Quote Link to comment Share on other sites More sharing options...
StefanRSA Posted March 6, 2012 Author Share Posted March 6, 2012 I am using MySQL client version: 4.1.22 Correction: Using Mysql 5.0.92 Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted March 6, 2012 Share Posted March 6, 2012 looking at this, do you have two indexes on "id"? Your explain makes it seem that way. I think I actually wanted this (not 100% sure why I asked for the table structure, sorry): show indexes from adcat; Quote Link to comment Share on other sites More sharing options...
StefanRSA Posted March 6, 2012 Author Share Posted March 6, 2012 I was playing around with the indexes to try and get to the root of the problem so another index was added for id yes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.