Re: [GENERAL] Accelerating subqueries

2000-04-06 Thread Moray McConnachie
- Original Message - From: "Fabrice Scemama" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 06, 2000 4:03 PM Subject: [GENERAL] Accelerating subqueries > Hi fellow PostgreSQL users. > > Here's a query: > > DELETE FROM Annonc

Re: [GENERAL] Accelerating subqueries

2000-04-06 Thread Ed Loehr
Fabrice Scemama wrote: > > DELETE FROM Annonces WHERE Id_Ag IN > ( > SELECT Id FROM Installs > WHERE Si_Compte_Actif = 'f' > ); > > This query will take more than one hour of CPU time > Any ideas about a way to write a single query that fast ? http://www.postgresql.org/docs/faq-english

Re: [GENERAL] Accelerating subqueries

2000-04-06 Thread Herbert Liechti
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 -- ~

[GENERAL] Accelerating subqueries

2000-04-06 Thread Fabrice Scemama
Hi fellow PostgreSQL users. Here's a query: DELETE FROM Annonces WHERE Id_Ag IN ( SELECT Id FROM Installs WHERE Si_Compte_Actif = 'f' ); This query will take more than one hour of CPU time on a PII 333 to execute. Table Installs has about 3000 tuples, and table Annonces about 50.000 . A