pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: Mark Dilger <hornschnorter@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: improving GROUP BY estimation
Date: Thu, 31 Mar 2016 16:59:41 -0400
Message-ID: <7900.1459457981@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEZATCWb4dThbZqEXEB06SU_dbrHe+s1WOgc0+40kzJAGRnD1A@mail.gmail.com>
References: <56CD0381.5060502@2ndquadrant.com>
	<03A3B58D-6A2D-44FE-9B03-E21948CFCBAA@gmail.com>
	<56CFA373.3060105@2ndquadrant.com>
	<7D1A65E8-7ED8-4268-9C24-8EA07E95D2BC@gmail.com>
	<56CFCE96.5080306@2ndquadrant.com>
	<CAPpHfdtEiXqj52kuGMEnw6EShrzj-0tFYwwxPqzdFvxYfCr+tQ@mail.gmail.com>
	<56D867C3.3040309@2ndquadrant.com>
	<904EB795-BCDD-4D68-8D44-274B40C4B2E9@gmail.com>
	<56D88D93.5000509@2ndquadrant.com>
	<CAPpHfdvOBwfGQ_F6Nk+eKF0e2Bx4Z_esg7==8KAjKqP6+5-ahA@mail.gmail.com>
	<E00A6146-D40C-4E4E-92B2-D6F5017F9B19@gmail.com>
	<1457097036.24980.28.camel@2ndquadrant.com>
	<CAEZATCU3hhRjGbvCydP-i3ik4FGX9OcXsK2ZG5TGuVnJOvb=kg@mail.gmail.com>
	<1457906984.27231.16.camel@2ndquadrant.com>
	<715c5c66-5fe1-a9aa-e28d-6c4114ba0fd6@2ndquadrant.com>
	<CAEZATCVd9cACCX_fiFSa0sHiUR5JdzrYL_1N79-PYQe9WSaTWA@mail.gmail.com>
	<CAPpHfdvcS+NVHW9b8ijJUEt=iCN6F6sLez87QzT0svqd8GgDVg@mail.gmail.com>
	<CAPpHfdswn19iSnpsukEJiAQSxK63Ewhkae=GDLuWrgvVHRP5jw@mail.gmail.com>
	<CAEZATCWQ3L8rKsp0+GbO-7D2weYjxZU3668fJx1ZgoVa_QL! 1LA@mail.gmail.com>
	<20518.1459451903@sss.pgh.pa.us>
	<CAEZATCWb4dThbZqEXEB06SU_dbrHe+s1WOgc0+40kzJAGRnD1A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> Yeah, that makes sense. In fact, if we only apply the adjustment when
> reldistinct > 0 and rel->rows < rel->tuples, and rewrite the first
> argument to pow() as (rel->tuples - rel->rows) / rel->tuples, then it
> is guaranteed to be non-negative. If rel->rows >= rel->tuples (not
> sure if it can be greater), then we just want the original
> reldistinct.

Works for me.

			regards, tom lane


-- 
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 (34+ messages)  latest in thread

Message-ID: <7900.1459457981@sss.pgh.pa.us>
Permalink:  ../7900.1459457981@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7900.1459457981@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, tomas.vondra@2ndquadrant.com, a.korotkov@postgrespro.ru, hornschnorter@gmail.com
  Subject: Re: improving GROUP BY estimation
  In-Reply-To: <7900.1459457981@sss.pgh.pa.us>

* 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