MySQL Forums
Forum List  »  Optimizer & Parser

Re: how to optimise query for 10+ millions records
Posted by: Azhar Rahi
Date: February 17, 2012 03:57PM

I am doing this

INNER Join IN_ROUTE on if(p_CarrierType = 0, axecdr.IN_Route = IN_ROUTE.VALUE, 1)

INNER JOIN OUT_ROUTE ON if(p_CarrierType = 1, axecdr.OUT_Route = OUT_ROUTE.VALUE, 1)

I am applying if condition because I need to test the value of p_CarrierType. It can be 0,1 or 2. If it is 0, then it will match the IN_ROUTE Temp table and skip OUT_ROUTE Temp Table, if 1 then skip IN_ROUTE and Match OUT_ROUTE. And if 2 then skip both temp tables.

One thing which made me surprised is a field DUR (INT(11) NULLABLE). When I include this field the response time is 50 seconds, but when I exclude it, the response time became 12 seconds. Is there any problem with this Field. Should it not NULLABLE. Because when I run the query with id (bigint(20) Primary Key), its response time is still 12 seconds.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: how to optimise query for 10+ millions records
1230
February 17, 2012 03:57PM


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.