From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: PostgResql SQL Mailing List <pgsql-sql@postgresql.org>
Subject: new problem! Is there any Faster workaround ??
Date: Wed, 10 Apr 2002 03:16:34 +0530
Message-ID: <3CB3613A.FEE6891E@trade-india.com> (raw)
References: <3CB346F6.1DD7CFB9@trade-india.com>
Hi folks,
I think there is still a problem ,
email_bank contains ~ 1 million records and t_a contains 58 records
both are indexed on email_id ( integer colmn.) i want to remove these 58
records
from email_bank where email_id in t_a & email_bank match.
but the below is still slow !
explain delete from email_bank where exists (select email_id from t_a where
email_bank.email_id=t_a.email_id) ;
NOTICE: QUERY PLAN:
Seq Scan on email_bank (cost=0.00..1760313.80 rows=1009397 width=6)
SubPlan
-> Seq Scan on t_a (cost=0.00..1.73 rows=1 width=4)
EXPLAIN
PS:
I ran VACUUM ANALYZE on email_bank and t_a and both are indexed on
email_id before
the explain .
regds
mallah.
Rajesh Kumar Mallah wrote:
> Hi folks,
>
> We require to do below or similar quite often
>
> DELETE from t_a where email in (select email from t_b);
>
> everyone knows "IN" is pain fully slow currently in pgsql
> is the any fster alternative to above query
>
> regds
> Mallah.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mallah@trade-india.com
Subject: Re: new problem! Is there any Faster workaround ??
In-Reply-To: <3CB3613A.FEE6891E@trade-india.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox