Re: FETCH FIRST clause PERCENT option

From: Surafel Temesgen <surafel3000(at)gmail(dot)com>
To: Ryan Lambert <ryan(at)rustprooflabs(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Mark Dilger <hornschnorter(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Subject: Re: FETCH FIRST clause PERCENT option
Date: 2019-08-01 12:54:11
Message-ID: CALAY4q_icXPTcAVxnPckpLGrZgER9-FWM0VPFvvOsPiJrnK6Dg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Ryan,
sorry for not be fast to replay

> I was suggesting a warning in the documentation so users aren't caught
> unaware about the performance characteristics. My first version was very
> rough, how about adding this in doc/src/sgml/ref/select.sgml?
>
> "Using <literal>PERCENT</literal> is best suited to returning single-digit
> percentages of the query's total row count."
>
>
> The following paragraphs in that same section give suggestions and
> warnings regarding LIMIT and OFFSET usage, I think this is more in line
> with the wording of those existing warnings.
>
>
Agreed and done

> Other than that, we can rip the clause if it is 100%
>
>
> You mean if PERCENT=100 it should short circuit and run the query
> normally? I like that.
>

The patch did not did it automatically. Its query writer obligation to do
that currently

regards
Surafel

Attachment Content-Type Size
percent-incremental-v6.patch text/x-patch 48.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-08-01 13:25:49 Re: pgbench - implement strict TPC-B benchmark
Previous Message Sehrope Sarkuni 2019-08-01 12:24:17 Fix typos