>created like '%2012-07-04%' and publish_up >= '2012-07-04' )
you can split 'created' into two i.e.
createDate DATE
createdTime TIME
Suggested indexes, try both:
KEY (`created`,`publish_up`)
KEY (`state`,`created`,`publish_up`)
and drop this one:
DROP KEY `idx_state` (`state`)
And remove wild search operator:
WHERE created = '2012-07-04' and publish_up >= '2012-07-04' )
>>AND UNIX_TIMESTAMP(publish_up)<=UNIX_TIMESTAMP(NOW()) )
Suggested index won't be used in full with query#2 because you are using function with `publish_up`.
>`state`='1' OR `state`='-1'
`state` IN ('1','-1');
Provide use EXPLAIN output after applying suggested changes/indexes
>| Uptime | 2805 |
looks like you just restarted mysql
Edited 3 time(s). Last edit at 07/12/2012 03:45AM by Aftab Khan.