Re: queries with lots of UNIONed relations

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

Jon Nelson <jnelson+pgsql(at)jamponi(dot)net> writes:
> In the former case, the query plan was a bitmap heap scan for each
> table. Then those results were Appended, Sorted, Uniqued, Sorted
> again, and then returned.

> In the latter, before Appending, each table's results were run through
> HashAggregate.

Probably the reason it did that is that each individual de-duplication
looked like it would fit in work_mem, but a single de-duplication
didn't. Consider raising work_mem, at least for this one query.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jon Nelson 2011-01-13 19:54:03 Re: queries with lots of UNIONed relations
Previous Message Jon Nelson 2011-01-13 15:55:31 queries with lots of UNIONed relations