Re: a wrong index choose when statistics is out of date

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: a wrong index choose when statistics is out of date
Дата
Msg-id CAApHDvo5S5xqWQR1HKzx=5UpBr1ZKhwEtxEkt=3q0z4oR+TnPA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: a wrong index choose when statistics is out of date  (Andy Fan <zhihuifan1213@163.com>)
Ответы Re: a wrong index choose when statistics is out of date  (Andy Fan <zhihuifan1213@163.com>)
Список pgsql-hackers
On Wed, 6 Mar 2024 at 02:09, Andy Fan <zhihuifan1213@163.com> wrote:
>     This patch introduces a new attoptions like this:
>
>     ALTER TABLE t ALTER COLUMN col set (force_generic=true);
>
>     Then selfunc.c realizes this and ignore the special Const value, then
>     average selectivity is chosen. This fall into the weakness of generic
>     plan, but this patch doesn't introduce any new weakness and we leave the
>     decision to user which could resolve some problem. Also this logic only
>     apply to eqsel since the ineqsel have the get_actual_variable_range
>     mechanism which is helpful for index choose case at least.

If you don't want the planner to use the statistics for the column why
not just do the following?

ALTER TABLE t ALTER COLUMN col SET STATISTICS 0;

ANALYZE won't delete any existing statistics, so that might need to be
done manually.

David



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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: Function and Procedure with same signature?
Следующее
От: Jelte Fennema-Nio
Дата:
Сообщение: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel