Re: [HACKERS] Some notes on optimizer cost estimates - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Some notes on optimizer cost estimates
Date
Msg-id 27077.948424228@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Some notes on optimizer cost estimates  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> It is nice that ANALYZE is done during vacuum.  I can't imagine why you
> would want to do an analyze without adding a vacuum to it.  I guess
> that's why I made them the same command.

Well, the main bad thing about ANALYZE being part of VACUUM is that
it adds to the length of time that VACUUM is holding an exclusive
lock on the table.  I think it'd make more sense for it to be a
separate command.

I have also been thinking about how to make ANALYZE produce a more
reliable estimate of the most common value.  The three-element list
that it keeps now is a good low-cost hack, but it really doesn't
produce a trustworthy answer unless the MCV is pretty darn C (since
it will never pick up on the MCV at all until there are at least
two occurrences in three adjacent tuples).  The only idea I've come
up with is to use a larger list, which would be slower and take
more memory.  I think that'd be OK in a separate command, but I
hesitate to do it inside VACUUM --- VACUUM has its own considerable
memory requirements, and there's still the issue of not holding down
an exclusive lock longer than you have to.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] Some notes on optimizer cost estimates
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Re: Status on 7.0