pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Move estimate_hashagg_tablesize to selfuncs.c, and widen result
Date: Thu, 21 Feb 2019 19:59:23 +0000
Message-ID: <E1gwuV9-0002d2-4x@gemulon.postgresql.org> (raw)

Move estimate_hashagg_tablesize to selfuncs.c, and widen result to double.

It seems to make more sense for this to be in selfuncs.c, since it's
largely a statistical-estimation thing, and it's related to other
functions like estimate_hash_bucket_stats that are there.

While at it, change the result type from Size to double.  Perhaps at one
point it was impossible for the result to overflow an integer, but
I've got no confidence in that proposition anymore.  Nothing's actually
done with the result except to compare it to a work_mem-based limit,
so as long as we don't get an overflow on the way to that comparison,
things should be fine even with very large dNumGroups.

Code movement proposed by Antonin Houska, type change by me

Discussion: https://postgr.es/m/25767.1549359615@localhost

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0c7d53793079a1af3f070d93e3eb86a52720f6e7

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 51 +++++-------------------------------
src/backend/utils/adt/selfuncs.c     | 38 +++++++++++++++++++++++++++
src/include/utils/selfuncs.h         |  3 +++
3 files changed, 48 insertions(+), 44 deletions(-)



Message-ID: <E1gwuV9-0002d2-4x@gemulon.postgresql.org>
Permalink:  ../E1gwuV9-0002d2-4x@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gwuV9-0002d2-4x@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Move estimate_hashagg_tablesize to selfuncs.c, and widen result
  In-Reply-To: <E1gwuV9-0002d2-4x@gemulon.postgresql.org>
  References: <E1gwuV9-0002d2-4x@gemulon.postgresql.org>

* 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