Re: Potential Issue with Redundant Restriction Clauses in get_parameterized_baserel_size for PARTITIONED_REL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Potential Issue with Redundant Restriction Clauses in get_parameterized_baserel_size for PARTITIONED_REL
Дата
Msg-id 1763158.1732674375@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Potential Issue with Redundant Restriction Clauses in get_parameterized_baserel_size for PARTITIONED_REL  (huyajun <hu_yajun@qq.com>)
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> It would be good to understand why get_parameterized_baserel_size()
> bothers accounting for the baserestrictinfo quals and does not just do
> clauselist_selectivity() on param_clauses alone and multiply by
> rel->rows (which should already account for the baserestrictinfo).

One reason is that clauselist_selectivity does not necessarily
treat all the clauses independently.  For example, if "x > 1"
is in one list and "x < 4" is in the other, you'll get very
different (and worse) results if you keep the lists separate
and just multiply their selectivities together.

We do have per-RestrictInfo selectivity caching that eliminates
most of the apparent inefficiency in this.

            regards, tom lane



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