Re: Accelerating subqueries

Started by Herbert Liechtiabout 26 years ago1 messagesgeneral
Jump to latest
#1Herbert Liechti
Herbert.Liechti@thinx.ch

Fabrice Scemama wrote:

Hi fellow PostgreSQL users.

Here's a query:

DELETE FROM Annonces WHERE Id_Ag IN
(
SELECT Id FROM Installs
WHERE Si_Compte_Actif = 'f'
);

The IN Clause is known to be very very slow. Use the
EXISTS Clause instead.

Regards Herbie
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Herbert Liechti E-Mail: Herbert.Liechti@thinx.ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~