FETCH FIRST clause PERCENT option

From: Surafel Temesgen <surafel3000(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: FETCH FIRST clause PERCENT option
Date: 2018-08-16 14:27:45
Message-ID: CALAY4q9Esidbuz4fvUrGA-uOHNwbEsntLZQ8p=_okDvaTzJ3pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

FETCH FIRST with PERCENT option is SQL standard that state limit count to
be specified in a percentage in addition to specify it in exact count and
listed as one of Major features simply not implemented yet in recent wiki
page [1].

I implemented it by executing the query plan twice. One without limit
filter to find the total number of row that will be feed to limit node so
the exact limit count can be calculated and the query plan execute again
with limit filter with newly calculated exact count .

[1].https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL_Standard

Regards

Surafel

Attachment Content-Type Size
fetch-wth-percent-v1.patch text/x-patch 23.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-08-16 14:34:21 Re: FETCH FIRST clause PERCENT option
Previous Message Andres Freund 2018-08-16 14:22:20 Re: C99 compliance for src/port/snprintf.c