Re: Use extended statistics to estimate (Var op Var) clauses

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: Use extended statistics to estimate (Var op Var) clauses
Дата
Msg-id 7cdd08ce-088a-d465-de9a-8f743cb36c6a@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Use extended statistics to estimate (Var op Var) clauses  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Ответы Re: Use extended statistics to estimate (Var op Var) clauses  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Hi,

I finally got around to this patch again, focusing mostly on the first 
part that simply returns either 1.0 or 0.0 for Var op Var conditions 
(i.e. the part not really using extended statistics).

I have been unhappy about using examine_variable, which does various 
expensive things like searching for statistics (which only got worse 
because now we're also looking for expression stats). But we don't 
really need the stats - we just need to check the Vars match (same 
relation, same attribute). So 0002 fixes this.

Which got me thinking that maybe we don't need to restrict this to Var 
nodes only. We can just as easily compare arbitrary expressions, 
provided it's for the same relation and there are no volatile functions. 
So 0003 does this. Conditions with the same complex expression on each 
side of an operator are probably fairly rare, but it's cheap so why not.

0004 and 0005 parts are unchanged.


The next steps is adding some tests to the first parts, and extending 
the tests in the main patch (to also use more complex expressions, if 
0003 gets included).


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Make pg_waldump report replication origin ID, LSN, and timestamp.
Следующее
От: Zhihong Yu
Дата:
Сообщение: Re: Use extended statistics to estimate (Var op Var) clauses