MySQL Forums
Forum List  »  Performance

Re: Performance Problem - how to tune a query?
Posted by: HubbleSpace
Date: October 31, 2005 09:04AM

How many entries are in this table? Do you use an index?

I think if you use an index on data_starttime (I assume data_starttime is a field of billing_data ) and change you request like
...
WHERE data_starttime IN BETWEEN '20051001' AND '20051031'
AND MID(...
it would return faster.

The statement LIKE need to do an full table scan(in my opinion) . So if you got more than ??100000(or much more) lines in billing_dat that'll take a while.

It depends too on the number data that is filtered by the data_starttime. If its more that 1% of the total data an index does not work so much faster.

Another thing is the MID(d.data_site,3,3) function. It is called for each row.
So if many rows are returned it slows down your request too.

Hubble

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Performance Problem - how to tune a query?
1394
October 31, 2005 09:04AM
1366
November 02, 2005 01:42AM
1371
November 03, 2005 08:10PM


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.