Showing posts with label exception. Show all posts
Showing posts with label exception. Show all posts

Tuesday, March 20, 2012

Query Performance

Hi,

If there are more than 15LAC records in the "cdetail" and "clm" table, Timeout exception occurs. Could anyone please help me in increasing the performance of this query: (Is there any way without using index)
Code: ( sql )

    SELECT clm.ft, cdetail.clmid, cdetail.cline, cdetail.servcode, cdetail.revcode, clm.bccode, clm.fycode FROM cdetail INNER JOIN clm ON (clm.clmid = cdetail.clmid) INNER JOIN bplan ON (cdetail.pid = bplan.pid) INNER JOIN pgm ON pgm.pgmid=bplan.pgmid WHERE bplan.pgmid IN ('DMXHPQ1596', 'DMXHPQ1600', 'DMXHPQ1601', 'DMXHPQ1602') AND pgm.cgp > '' AND clm.sts IN ('AJ', 'PD', 'PY', 'RV', 'WP', 'DN', 'VD')
What is the use of indexes then.

What is the problem if using indexes.|||

Quote:

Originally Posted by debasisdas

What is the use of indexes then.

What is the problem if using indexes.


If we use indices, performance will get reduced during insert and update statements. Hence i am trying to avoid index.

Is there any better way to refine this qurey??