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