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
2885
February 09, 2012 03:30AM
1713
February 09, 2012 05:31AM
1373
February 09, 2012 05:38AM
1277
February 09, 2012 05:58PM
1257
February 11, 2012 11:26PM
1508
February 12, 2012 10:12PM
1362
February 13, 2012 02:18PM
1576
February 14, 2012 02:33AM
1360
February 14, 2012 07:24AM
1383
February 15, 2012 07:30AM
1840
February 16, 2012 03:54AM
1276
February 17, 2012 01:20AM
Re: how to optimise query for 10+ millions records
1230
February 17, 2012 03:57PM
1516
February 17, 2012 05:12PM
1319
February 18, 2012 07:18AM
1379
February 21, 2012 03:25AM
1371
February 24, 2012 10:45AM
1315
February 20, 2012 02:21AM