Re: autovacuum and temp tables support

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum and temp tables support
Date: 2010-04-08 19:40:35
Message-ID: q2r603c8f071004081240qb1f1ed9cw5e9ee5deda494ff1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Apr 8, 2010 at 3:22 PM, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> wrote:
>> On general thought I've had is that it would be nice if the first
>> attempt to SELECT against a table with no statistics would trigger an
>> automatic ANALYZE by the backend on which the query was executed.
>> It's pretty common to populate a table using INSERT, or CTAS, or COPY
>> and then try to immediately run a query against it, and I've often
>> found that it's necessary to insert manual analyze statements in there
>> to get decent query plans.
>
> Oracle does this. So, is't worth to add support (configurable, like
> Oracle's optimizer_dynamic_sampling) ?

Well, dynamic sampling is considerably more complicated than what I
proposed, which is just to force an ordinary ANALYZE before the first
query against the table. It would be a very powerful feature if we
could use it to ameliorate, for example, the gross statistical errors
that sometimes occur when multiple, correlated filter conditions are
applied to the same base table; but I don't think it's in the direct
path of solving the present complaint.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Necati Batur 2010-04-08 19:58:40 GSOC PostgreSQL partitioning issue
Previous Message Oleg Bartunov 2010-04-08 19:22:08 Re: autovacuum and temp tables support