Re: More stable query plans via more predictable column statistics

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: More stable query plans via more predictable column statistics
Дата
Msg-id 27490.1459662594@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: More stable query plans via more predictable column statistics  (Alex Shulgin <alex.shulgin@gmail.com>)
Ответы Re: More stable query plans via more predictable column statistics  (Alex Shulgin <alex.shulgin@gmail.com>)
Список pgsql-hackers
Alex Shulgin <alex.shulgin@gmail.com> writes:
> On Sun, Apr 3, 2016 at 7:18 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Well, we have to do *something* with the last (possibly only) value.
>> Neither "include always" nor "omit always" seem sane to me.  What other
>> decision rule do you want there?

> Well, what implies that the last value is somehow special?  I would think
> we should just do with it whatever we do with the rest of the candidate
> MCVs.

Sure, but both of the proposed decision rules break down when there are no
values after the one under consideration.  We need to do something sane
there.

> For "the only value" case: we cannot build a histogram out of a single
> value, so omitting it from MCVs is not a good strategy, ISTM.
> From my point of view that amounts to "include always".

If there is only one value, it will have 100% of the samples, so it would
get included under just about any decision rule (other than "more than
100% of this value plus following values").  I don't think making sure
this case works is sufficient to get us to a reasonable rule --- it's
a necessary case, but not a sufficient case.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alex Shulgin
Дата:
Сообщение: Re: More stable query plans via more predictable column statistics
Следующее
От: Fabien COELHO
Дата:
Сообщение: pgbench more operators & functions