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