From: Tom Lane <tgl@sss.pgh.pa.us>
To: postgresql@os10000.net
Cc: pgsql-performance@postgresql.org
Subject: Re: parallel query evaluation
Date: Sat, 10 Nov 2012 10:32:25 -0500
Message-ID: <9130.1352561545@sss.pgh.pa.us> (raw)
In-Reply-To: <214a89820818a3da44bcadb4ab829c14@os10000.net>
References: <214a89820818a3da44bcadb4ab829c14@os10000.net>
Oliver Seidel <postgresql@os10000.net> writes:
> I have
> create table x ( att bigint, val bigint, hash varchar(30)
> );
> with 693million rows. The query
> create table y as select att, val, count(*) as cnt from x
> group by att, val;
> ran for more than 2000 minutes and used 14g memory on an 8g physical
> RAM machine
What was the plan for that query? What did you have work_mem set to?
I can believe such a thing overrunning memory if the planner chose to
use a hash-aggregation plan instead of sort-and-unique, but it would
only do that if it had made a drastic underestimate of the number of
groups implied by the GROUP BY clause. Do you have up-to-date
statistics for the source table?
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, postgresql@os10000.net
Subject: Re: parallel query evaluation
In-Reply-To: <9130.1352561545@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