Re: tstzrange on large table gives poor estimate of expected rows

Поиск
Список
Период
Сортировка
От Tom Dearman
Тема Re: tstzrange on large table gives poor estimate of expected rows
Дата
Msg-id CAGRwtPzvkVhv07nsE_JQMGND6A9CWDBjdZKo8Uu_r8j4YTkk=Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: tstzrange on large table gives poor estimate of expected rows  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-general
Thanks for your help.  It is true we could get rid of it but we still
want to use the functional index on the date range as we understand it
is supposed to be a better look up - we also have other date range
look ups on tables that seem to be degrading.  I have found a solution
to the problem.  The postgres default_statistics_target is 100 and
when we upped it to 10000 the estimate was good.  We could not have
set the default to 10000 on production but there appeared to be no way
to change the value for the function index as statistics is set per
column.  However, in a post answered by Tom Lane in 2012 he gives a
way to set the value for the statistics target on the functional index
(https://www.postgresql.org/message-id/6668.1351105908%40sss.pgh.pa.us)

Thanks.

On Mon, 24 Jan 2022 at 17:43, Michael Lewis <mlewis@entrata.com> wrote:
>
> If interval_end_date is always 1 day ahead, why store it at all?
>
> Dependencies on a custom stats object wouldn't do anything I don't think because they are offset. They are 100%
correlated,but not in a way that any of the existing stat types capture as far as I can figure.
 



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: GIN index
Следующее
От: Shaozhong SHI
Дата:
Сообщение: Re: Robust ways for checking allowed values in a column