how to speedup mentioned SQL query [message #252015] |
Tue, 17 July 2007 12:28 |
rajat_chaudhary
Messages: 141 Registered: November 2006 Location: india
|
Senior Member |
|
|
hi everyone,
i have a query based on two tables :-
1. A (having 19 lakhs data)
2. B (havind 23 lakhs data)
now my query is
/* ************************************* */
SELECT COUNT(A_C1) INTO A FROM A
WHERE A_C1 IN
(SELECT DISTINCT B_C1 FROM B WHERE LTRIM(RTRIM(DRGNNO_REF)) = LTRIM(RTRIM(B_C2)))
AND (A_C2,A_C3,A_C4,A_C5) IN (SELECT A_C2,A_C3,A_C4,A_C5 FROM A
HAVING COUNT(A_C2) > 1
AND
COUNT(A_C3) > 1
AND
COUNT(A_C4) > 1
AND
COUNT(A_C5) > 1
AND
A_C5 <> 'NA'
GROUP BY A_C2,A_C3,A_C4,A_C5);
/* ************************************* */
SO THE EXECUTION OF THAT QUERY IS SOMEWHERE AROUND 2 TO 2:30 MINUTES IN BACK END BUT
IN FRONT END ( FORMS6i) IT WILL TAKE SOMEWHERE AROUND 5 TO 6 MINUTES AND MOST OF THE TIME APPLICATION HANGS AND THEN THE APPLICATION WILL BE RESTARTED.
SO TO INCREASE THE EXECUTION TIME OF THAT QUERY ,PLEASE ALL THE MASTERS MAKES THEIR CONTRIBUTION AND LET ME OUT OF THE PROBLEM ................
[Updated on: Tue, 17 July 2007 12:33] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|