Re: detecting poor query plans

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: detecting poor query plans
Date: 2003-11-26 16:14:36
Message-ID: 877k1nxg2b.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Neil Conway <neilc(at)samurai(dot)com> writes:

> It occurred to me that these kinds of poor planning decisions could easily
> be detected by PostgreSQL itself: after we've finished executing a plan, we
> can trivially compare the # of results produced by each node in the query
> tree with the # of results the planner expected that node to produce

There's a dual to this as well. If the results were very close but the actual
time taken to run the node doesn't match the cost calculated then some
optimizer parameter needs to be adjusted. Either one of the cost_* parameters
or random_page_cost, or effective_cache_size or...

I'm not sure it's as obvious what to put in the HINT though. Ideally these
results would have to be gathered and pumped through linear optimization
algorithms which is a lot more work.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-26 16:21:53 Re: pg_restore and create FK without verification check
Previous Message Tom Lane 2003-11-26 16:09:21 Re: Providing anonymous mmap as an option of sharing memory