Re: FETCH FIRST clause WITH TIES option - Mailing list pgsql-hackers

From Surafel Temesgen
Subject Re: FETCH FIRST clause WITH TIES option
Date
Msg-id CALAY4q-+CKiFkgCL5VSK-9P8i5Z9uoQQh6ZEZLkjzsUT2mySsw@mail.gmail.com
Whole thread Raw
In response to Re: FETCH FIRST clause WITH TIES option  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: FETCH FIRST clause WITH TIES option  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers


On Tue, Jan 15, 2019 at 2:51 PM Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
 
What do you mean by "raw statistic"?

I mean without further calculation to consider other operation 


IMHO the best thing you can do is call estimate_num_groups() and combine
that with the number of input rows. That shall benefit from ndistinct
coefficients when available, etc. I've been thinking that considering
the unreliability of grouping estimates we should use a multiple of the
average size (because there may be much larger groups), but I think
that's quite unprecipled and I'd much rather try without it first.


thank you for clarifying.

The attache patch use your suggestion uptread

regards

Surafel

Attachment

pgsql-hackers by date:

Previous
From: Adrien NAYRAT
Date:
Subject: Re: Log a sample of transactions
Next
From: Masahiko Sawada
Date:
Subject: Re: Log a sample of transactions