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 CALAY4q9Zd24E8OEBxOHfqQbp6u+xePXrFsnvM5xoy1pq1APUgw@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  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers


On Wed, Jan 2, 2019 at 6:19 PM Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
After looking at the "FETCH FIRST ... PERCENT" patch, I wonder if this
patch should tweak estimates in some way. Currently, the cardinality
estimate is the same as for plain LIMIT, using the requested number of
rows. But let's say there are very few large groups - that will
naturally increase the number of rows produced.

As an example, let's say the subplan produces 1M rows, and there are
1000 groups (when split according to the ORDER BY clause).

 

can we use ORDER BY column raw statistic in limit node reliably? because it seems to me it can be affected by other operation in a subplan like filter condition

regards

Surafel

pgsql-hackers by date:

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