Re: improving GROUP BY estimation

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: improving GROUP BY estimation
Дата
Msg-id CAPpHfdvOBwfGQ_F6Nk+eKF0e2Bx4Z_esg7==8KAjKqP6+5-ahA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: improving GROUP BY estimation  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: improving GROUP BY estimation  (Mark Dilger <hornschnorter@gmail.com>)
Список pgsql-hackers
On Thu, Mar 3, 2016 at 10:16 PM, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
So yes, each estimator works great for exactly the opposite cases. But notice that typically, the results of the new formula is much higher than the old one, sometimes by two orders of magnitude (and it shouldn't be difficult to construct examples of much higher differences).

The table also includes the 'average' estimator you propose, but it's rather obvious that the result is always much closer to the new value, simply because

   (small number) + (huge number)
   ------------------------------
                  2

is always much closer to the huge number. We're usually quite happy when the estimates are within the same order of magnitude, so whether it's K or K/2 makes pretty much no difference.

I believe that Mark means geometrical average, i.e. sqrt((small number) * (huge number)).

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 

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

Предыдущее
От: Vitaly Burovoy
Дата:
Сообщение: Re: [PATCH] Supporting +-Infinity values by to_timestamp(float8)
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: pgbench small bug fix