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.
Subject
Views
Written By
Posted
2875
February 09, 2012 03:30AM
1708
February 09, 2012 05:31AM
1369
February 09, 2012 05:38AM
1271
February 09, 2012 05:58PM
1254
February 11, 2012 11:26PM
1504
February 12, 2012 10:12PM
1359
February 13, 2012 02:18PM
1573
February 14, 2012 02:33AM
1354
February 14, 2012 07:24AM
1377
February 15, 2012 07:30AM
1834
February 16, 2012 03:54AM
1271
February 17, 2012 01:20AM
Re: how to optimise query for 10+ millions records
1226
February 17, 2012 03:57PM
1508
February 17, 2012 05:12PM
1315
February 18, 2012 07:18AM
1374
February 21, 2012 03:25AM
1366
February 24, 2012 10:45AM
1309
February 20, 2012 02:21AM