Re: benchmarking the query planner - Mailing list pgsql-hackers

From Greg Stark
Subject Re: benchmarking the query planner
Date
Msg-id 4136ffa0812120650g401f9e44u328a5f427aec1a0d@mail.gmail.com
Whole thread Raw
In response to Re: benchmarking the query planner  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: benchmarking the query planner  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Dec 12, 2008 at 2:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> AFAICS, marginal enlargements in the sample size aren't going to help
> much for ndistinct --- you really need to look at most or all of the
> table to be guaranteed anything about that.

Well you only need to maintain a fixed percentage of the table if by
"guaranteed anything" you mean guaranteed a consistent level of
confidence. But even a small percentage like 1% means a very different
behaviour than currently. For large tables it could mean sampling a
*lot* more.

However if by "guaranteed anything" you mean guaranteeing an actual
useful result then it's true. Even samples as large as 50% give a
pretty low confidence estimate.


> But having said that, I have wondered whether we should consider
> allowing the sample to grow to fill maintenance_work_mem

Hm, so I wonder what this does to the time analyze takes. I think it
would be the only thing where raising maintenance_work_mem would
actually increase the amount of time an operation takes. Generally
people raise it to speed up index builds and vacuums etc.

-- 
greg


pgsql-hackers by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: WIP: default values for function parameters
Next
From: "David E. Wheeler"
Date:
Subject: Re: WIP: default values for function parameters