MySQL Forums
Forum List  »  Performance

Re: Monitoring large resultsets
Posted by: Aftab Khan
Date: July 12, 2012 03:37AM

>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.

Options: ReplyQuote


Subject
Views
Written By
Posted
2065
July 10, 2012 10:26PM
1126
July 11, 2012 02:01AM
905
July 12, 2012 02:19AM
Re: Monitoring large resultsets
957
July 12, 2012 03:37AM
946
July 12, 2012 04:13AM
991
July 12, 2012 05:49AM
1128
July 12, 2012 07:02AM
942
July 13, 2012 07:50PM
927
July 14, 2012 02:43AM
909
July 12, 2012 08:13AM
907
July 12, 2012 08:55AM
990
July 12, 2012 12:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.