M
MonaNeedHelp
Guest
Hello!
I have a big problem, I have a Query on a table "Cheque" that has about 50 000 entries. And it is very long to process, about 15 seconds... so I need to optimize it! If anybody could help me, it would be appreciated. Here's my query:
(it is a little bit longer and has a ORDER BY part, but I simplified it)
And the "Query2" is
The THING IS that the result has to be editable!
I tried with a IN instead of a NOT IN, inversing the Query2, but they are much more result for Query2 so it is not faster.
Thanks for ANY help!
I have a big problem, I have a Query on a table "Cheque" that has about 50 000 entries. And it is very long to process, about 15 seconds... so I need to optimize it! If anybody could help me, it would be appreciated. Here's my query:
SELECT Cheque.noCheque, Cheque.percepteur, Cheque.refNSF
FROM Cheque
WHERE Cheque.percepteur<>"Fiducie" AND Cheque.refNSF Not In (SELECT c2.idCheque FROM Query2 AS c2)
FROM Cheque
WHERE Cheque.percepteur<>"Fiducie" AND Cheque.refNSF Not In (SELECT c2.idCheque FROM Query2 AS c2)
(it is a little bit longer and has a ORDER BY part, but I simplified it)
And the "Query2" is
SELECT Cheque.idCheque, Cheque.percepteur, Cheque.refNSF
FROM Cheque
WHERE Cheque.NSF=-1 AND Cheque.percepteur="HN_Frais";
FROM Cheque
WHERE Cheque.NSF=-1 AND Cheque.percepteur="HN_Frais";
The THING IS that the result has to be editable!
I tried with a IN instead of a NOT IN, inversing the Query2, but they are much more result for Query2 so it is not faster.
Thanks for ANY help!