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

From Surafel Temesgen
Subject Re: FETCH FIRST clause PERCENT option
Date
Msg-id CALAY4q-crgcaUhn+CMnXxqcP7yw15bws2DSzRT2+wdc6J-33ww@mail.gmail.com
Whole thread Raw
In response to Re: FETCH FIRST clause PERCENT option  (Ryan Lambert <ryan@rustprooflabs.com>)
Responses Re: FETCH FIRST clause PERCENT option  (Ryan Lambert <ryan@rustprooflabs.com>)
List pgsql-hackers

Hi Ryan,
On Tue, Jul 9, 2019 at 4:13 PM Ryan Lambert <ryan@rustprooflabs.com> wrote:

"It is possible for FETCH FIRST N PERCENT to create poorly performing query plans when the N supplied exceeds 50 percent.  In these cases query execution can take an order of magnitude longer to execute than simply returning the full table.  If performance is critical using an explicit row count for limiting is recommended."

I don’t understand how fetch first n percent functionality can be replaced with explicit row count limiting. There may be a way to do it in a client side but we can not be sure of its performance advantage


regards

Surafel

  

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: CVE-2017-7484-induced bugs, or, btree cmp functions are not leakproof?
Next
From: tushar
Date:
Subject: pg_rewind is failing on PG v12 BETA/PG HEAD