Re: [HACKERS] having and union in v7beta

From: Jose Soares <jose(at)sferacarta(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] having and union in v7beta
Date: 2000-03-01 13:24:14
Message-ID: 38BD19FE.D02C383B@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> Jose Soares <jose(at)sferacarta(dot)com> writes:
> > I tried the following query :
>
> > select * from comuni where nome in (
> > select nome from comuni group by nome having 1 < count(nome)
> > );
>
> > on the above table populated with 8342 rows, PostgreSQL begins searching
> > and I wait for hours without any result.
>
> I'd expect that to be pretty slow, since it's going to execute the inner
> select for every tuple examined by the outer select. Shouldn't be any
> worse than 6.5 though. IN (sub-SELECT) has always been slow.
>
>

In v7.0 this query takes more than 50min to execute, it doesn't work on
v6.5...

select * from comuni where nome in (
select nome from comuni group by nome having count(nome) > 1
);

real 50m25.033s
user 0m0.010s
sys 0m0.000s

--
Jose' Soares
Bologna, Italy Jose(at)sferacarta(dot)com

In response to

Responses

  • rpms at 2000-03-01 13:38:40 from Sergio A. Kessler

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergio A. Kessler 2000-03-01 13:38:40 rpms
Previous Message Jose Soares 2000-03-01 12:22:23 Re: [HACKERS] having and union in v7beta