pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tels <nospam-pg-abuse@bloodgate.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Account for cost and selectivity of HAVING quals
Date: Wed, 1 Nov 2017 03:51:38 -0400
Message-ID: <61b0807a4afa2bc3f421c0fd5959e0a1.squirrel@sm.webmail.pair.com> (raw)
In-Reply-To: <CAKFQuwb=ZKj1RnJBt4fn1xhBdRJGPJfsHEs0HYrNgD9zgvU35g@mail.gmail.com>
References: <20968.1509486337@sss.pgh.pa.us>
	<0410ddd44e3823059cf7d39f9b3e82c4.squirrel@sm.webmail.pair.com>
	<CAKFQuwb=ZKj1RnJBt4fn1xhBdRJGPJfsHEs0HYrNgD9zgvU35g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (8+ messages)  latest in thread

Message-ID: <61b0807a4afa2bc3f421c0fd5959e0a1.squirrel@sm.webmail.pair.com>
Permalink:  ../61b0807a4afa2bc3f421c0fd5959e0a1.squirrel@sm.webmail.pair.com/
Also on:    postgresql.org/message-id/61b0807a4afa2bc3f421c0fd5959e0a1.squirrel@sm.webmail.pair.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nospam-pg-abuse@bloodgate.com, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Account for cost and selectivity of HAVING quals
  In-Reply-To: <61b0807a4afa2bc3f421c0fd5959e0a1.squirrel@sm.webmail.pair.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox