Re: Unusual slowdown using subselects

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Aughey <jha(at)washucsc(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Unusual slowdown using subselects
Date: 2001-05-17 00:53:07
Message-ID: 7991.990060787@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

John Aughey <jha(at)washucsc(dot)org> writes:
> However, this next one is slow.

> calendar=# explain select * from schedule where schedule.owner_id in
> (select group_id from groups where user_id=101);

IN is not very well implemented at present. You could try something
like this (in 7.1):

select schedule.* from schedule,
(select distinct group_id from groups where user_id=101) ss
where schedule.owner_id = ss.group_id;

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-05-17 17:45:32 pqReadData() -- backend closed the channel unexpectedly.
Previous Message Stephan Szabo 2001-05-16 23:32:34 Re: orphaned trigger