Re: Performance problem with a table with 38928077 record

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: sthomas(at)peak6(dot)com
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Giovanni Mancuso <gmancuso(at)babel(dot)it>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance problem with a table with 38928077 record
Date: 2011-10-27 22:19:46
Message-ID: 7239.1319753986@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Shaun Thomas <sthomas(at)peak6(dot)com> writes:
> On 10/27/2011 02:13 PM, Robert Haas wrote:
>> If I had to guess, I'd bet that the second one is trying to spool the
>> resultset in memory someplace and that's driving the machine into
>> swap.

> That would be my guess too. SELECT * on a 40-million row table is a
> *lot* different than getting the count, which throws away the rows once
> it verifies they're valid.

But EXPLAIN ANALYZE throws away the rows too. There's something odd
going on there, but the information provided is insufficient to tell
what.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Samuel Gendler 2011-10-27 23:29:25 Re: backups blocking everything
Previous Message Samuel Gendler 2011-10-27 21:15:28 Re: backups blocking everything