From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jon Nelson <jnelson+pgsql@jamponi.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: queries with lots of UNIONed relations
Date: Thu, 13 Jan 2011 12:13:22 -0500
Message-ID: <19302.1294938802@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTiktjfaR9_sDU+F3UZhAQn7qrBktXE1EiOX=inzQ@mail.gmail.com>
References: <AANLkTiktjfaR9_sDU+F3UZhAQn7qrBktXE1EiOX=inzQ@mail.gmail.com>
Jon Nelson <jnelson+pgsql@jamponi.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jnelson+pgsql@jamponi.net
Subject: Re: queries with lots of UNIONed relations
In-Reply-To: <19302.1294938802@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox