Re: queries with lots of UNIONed relations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: queries with lots of UNIONed relations
Date: 2011-01-13 22:26:22
Message-ID: 11563.1294957582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Thu, Jan 13, 2011 at 3:12 PM, Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> wrote:
>> I still think that having UNION do de-duplication of each contributory
>> relation is a beneficial thing to consider -- especially if postgresql
>> thinks the uniqueness is not very high.

> This might be worth a TODO.

I don't believe there is any case where hashing each individual relation
is a win compared to hashing them all together. If the optimizer were
smart enough to be considering the situation as a whole, it would always
do the latter.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2011-01-13 22:41:40 Re: queries with lots of UNIONed relations
Previous Message Robert Haas 2011-01-13 21:44:30 Re: queries with lots of UNIONed relations