Re: Plan time Improvement - 64bit bitmapset

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Andres Freund <andres(at)anarazel(dot)de>, Gregory Stark <stark(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Plan time Improvement - 64bit bitmapset
Date: 2009-06-03 21:24:23
Message-ID: 25273.1244064263@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Wed, Jun 3, 2009 at 3:18 PM, Kevin Grittner
> <Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
>> I'm finding that even the ones that had a plan time in the range of
>> 260 ms go down to 15 ms to 85 ms once the statistics are cached.

> I had some performance results back when we were last looking at
> default_statistics_target that indicated that the time to repeatedly
> decompress a toasted statistics array contributed significantly to the
> total planning time, but my suggestion to disable compression for
> pg_statistic was summarily poo-poohed for reasons that still aren't
> quite clear to me.

Well, smaller is better. Kevin's example demonstrates that it's good
to have the stats sucked into cache. If they were uncompressed then
less of them would fit in however much cache space you have, and
whatever CPU savings you get would be lost to more I/O to read in
stats entries.

Of course, this all depends on total database size vs total RAM,
but that's how I'd interpret the observation. PG is still mostly
optimized for databases bigger than RAM, so this decision still
makes sense.

(I think you could try marking the columns of pg_statistic as "don't
compress" if you have a DB you want to optimize for all-in-memory
behavior.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Cecchet 2009-06-03 21:29:30 Re: Locks on temp table and PREPARE
Previous Message Tom Lane 2009-06-03 21:11:43 Re: Plan time Improvement - 64bit bitmapset