Hi Folks !
I have a very huge problem of performance with the following query (containing a subquery).
The table TITLE_RANGES is not very big (~ 50 rows) and my query runs for 10 minutes. Whithout the subquery an analog subquery turns less than 1 second.
Any help will be greatly appreciated and hotly welcome !
INSERT INTO RECETTES(T01_CODE_PAIEMENT_MODE, T02_TOTAL_AMOUNT, T03_DAY)
SELECT 'CB', sum(CT_PRICE_FF), CT_DAY
FROM CT_PAIEMENT_INDIVIDUAL
WHERE CT_PAIEMENT_MODE ='07' AND EXISTS
(SELECT *
FROM TITLE_RANGES
WHERE TITLE_RANGES.MNEMONIQUE = 'CB'
AND (lpad(substr(CT_PAIEMENT_INDIVIDUAL.CT_PISTE_ISO2,2,17),19,'0')
BETWEEN TITLE_RANGES.BEGIN_RANGE AND TITLE_RANGES.END_RANGE)
GROUP BY CT_DAY;
Waiting for reading from you,
Benouche.
I have a very huge problem of performance with the following query (containing a subquery).
The table TITLE_RANGES is not very big (~ 50 rows) and my query runs for 10 minutes. Whithout the subquery an analog subquery turns less than 1 second.
Any help will be greatly appreciated and hotly welcome !
INSERT INTO RECETTES(T01_CODE_PAIEMENT_MODE, T02_TOTAL_AMOUNT, T03_DAY)
SELECT 'CB', sum(CT_PRICE_FF), CT_DAY
FROM CT_PAIEMENT_INDIVIDUAL
WHERE CT_PAIEMENT_MODE ='07' AND EXISTS
(SELECT *
FROM TITLE_RANGES
WHERE TITLE_RANGES.MNEMONIQUE = 'CB'
AND (lpad(substr(CT_PAIEMENT_INDIVIDUAL.CT_PISTE_ISO2,2,17),19,'0')
BETWEEN TITLE_RANGES.BEGIN_RANGE AND TITLE_RANGES.END_RANGE)
GROUP BY CT_DAY;
Waiting for reading from you,
Benouche.