Re: FETCH FIRST clause PERCENT option - Mailing list pgsql-hackers

From Surafel Temesgen
Subject Re: FETCH FIRST clause PERCENT option
Date
Msg-id CALAY4q8NDVwv6ZbB63nL4B4zVwTsaDeu+BRDnLzQO-eT4pN7hA@mail.gmail.com
Whole thread Raw
In response to Re: FETCH FIRST clause PERCENT option  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: FETCH FIRST clause PERCENT option  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers


On Wed, Jan 9, 2019 at 8:18 PM Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
 

See the attached patch, which recomputes the count regularly. I don't
claim the patch is committable or that it has no other bugs, but
hopefully it shows what I meant.



I got only one issue it is not work well with cursor

postgres=# START TRANSACTION;

START TRANSACTION

postgres=# create table t as select i from generate_series(1,1000) s(i);

SELECT 1000

postgres=# declare c cursor for select * from t fetch first 5 percent rows only;

DECLARE CURSOR

postgres=# fetch all in c;

ERROR: trying to store a minimal tuple into wrong type of slot


I am looking at it .

meanwhile i fix row estimation and cost and make create_ordered_paths creation with no LIMIT consideration in PERCENTAGE case


regards

Surafel  

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: Protect syscache from bloating with negative cache entries
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: using expression syntax for partition bounds