Re: merge>hash>loop

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, Markus Schaber <schabi(at)logix-tt(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: merge>hash>loop
Date: 2006-04-20 16:27:32
Message-ID: 20060420162732.GX49405@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Apr 19, 2006 at 01:25:28AM -0400, Tom Lane wrote:
> Mark Kirkwood <markir(at)paradise(dot)net(dot)nz> writes:
> > Jim C. Nasby wrote:
> >> Good point. :/ I'm guessing there's no easy way to see how many blocks
> >> for a given relation are in shared memory, either...
>
> > contrib/pg_buffercache will tell you this -
>
> I think the key word in Jim's comment was "easy", ie, cheap. Grovelling
> through many thousands of buffers to count the matches to a given
> relation doesn't sound appetizing, especially not if it gets done over
> again several times during each query-planning cycle. Trying to keep
> centralized counts somewhere would be even worse (because of locking/
> contention issues).

Very true. OTOH, it might not be unreasonable to periodically slog
through the buffers and store that information, perhaps once a minute,
or every X number of transactions.

I think a bigger issue is that we currently have no way to really
measure the effictiveness of the planner. Without that it's impossible
to come up with any real data on whether cost formula A is better or
worse than cost formula B. The only means I can think of for doing this
would be to measure estimated cost vs actual cost, but with the overhead
of EXPLAIN ANALYZE and other variables that might not prove terribly
practical. Maybe someone else has some ideas...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Will Reese 2006-04-20 16:48:36 Slow deletes in 8.1 when FKs are involved
Previous Message Radovan Antloga 2006-04-20 16:10:21 Re: Performance decrease