Re: using extended statistics to improve join estimates

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: using extended statistics to improve join estimates
Дата
Msg-id 3aa13399-8dac-e13a-5ce9-d528ab93efb8@enterprisedb.com
обсуждение исходный текст
Ответ на Re: using extended statistics to improve join estimates  (Zhihong Yu <zyu@yugabyte.com>)
Список pgsql-hackers
On 10/6/21 23:03, Zhihong Yu wrote:
> Hi,
> 
> +       conditions2 = statext_determine_join_restrictions(root, rel, mcv);
> +
> +       /* if the new statistics covers more conditions, use it */
> +       if (list_length(conditions2) > list_length(conditions1))
> +       {
> +           mcv = stat;
> 
> It seems conditions2 is calculated using mcv, I wonder why mcv is 
> replaced by stat (for conditions1 whose length is shorter) ?
> 

Yeah, that's wrong - it should be the other way around, i.e.

     if (list_length(conditions1) > list_length(conditions2))

There's no test with multiple candidate statistics yet, so this went 
unnoticed :-/


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Mark Dilger
Дата:
Сообщение: Re: BUG #17212: pg_amcheck fails on checking temporary relations
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: BUG #17212: pg_amcheck fails on checking temporary relations