Re: [HACKERS] Account for cost and selectivity of HAVING quals

Поиск
Список
Период
Сортировка
От Tels
Тема Re: [HACKERS] Account for cost and selectivity of HAVING quals
Дата
Msg-id 61b0807a4afa2bc3f421c0fd5959e0a1.squirrel@sm.webmail.pair.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Account for cost and selectivity of HAVING quals  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Hello David,

On Tue, October 31, 2017 7:54 pm, David G. Johnston wrote:
> On Tue, Oct 31, 2017 at 4:31 PM, Tels <nospam-pg-abuse@bloodgate.com>
> wrote:
>
>>
>> ​​
>> That looks odd to me, it first uses output_tuples in a formula, then
>> overwrites the value with a new value. Should these lines be swapped?
>>
>
> ​IIUC it is correct: the additional total_cost comes from processing every
> output group to check whether it is qualified - since every group is
> checked the incoming output_tuples from the prior grouping is used.  The
> side-effect of the effort is that the number of output_tuples has now been
> reduced to only those matching the qual - and so it now must take on a new
> value to represent this.

Ah, makes sense. Learned something new today.

Maybe it's worth to add a comment, or would everybody else beside me
understand it easily by looking at the code? :)

Thank you,

Tels


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [HACKERS] proposal: schema variables
Следующее
От: Chris Travers
Дата:
Сообщение: Re: [HACKERS] Patch: restrict pg_rewind to whitelisted directories