poor performance of subquery in psql

From: "John Liu" <johnl(at)emrx(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: poor performance of subquery in psql
Date: 2003-01-24 14:32:13
Message-ID: NDBBKKKHILOHGHNKGOCEOECHELAA.johnl@emrx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

1. the following query is so slow, after 12 hours,
I kill it -
delete from doc where cdi in (select cdi from doc_b1);
doc_b1 records = 40000
doc records = 5000000
cdi are indexed in both table.

2. I rewrite the above task in plpgsql, it
takes 10 secs to finish.

why psql subquery is not smarter enough to use
indexes if obviously?

johnl

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2003-01-24 21:53:29 pgsql-server/src/backend/utils/adt acl.c
Previous Message Tom Lane 2003-01-24 05:33:00 Re: [PATCH] psql visibility clarification patch

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Langille 2003-01-24 15:00:52 Re: What goes into the security doc?
Previous Message Olleg Samoylov 2003-01-24 07:51:05 New buildin function