Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?

Поиск
Список
Период
Сортировка
От Grzegorz Jaskiewicz
Тема Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?
Дата
Msg-id B119A552-BB7C-4FE9-8EDE-7D4884BC603D@pointblue.com.pl
обсуждение исходный текст
Ответ на Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?  ("Hitoshi Harada" <umi.tanuki@gmail.com>)
Ответы Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?  ("Robert Haas" <robertmhaas@gmail.com>)
Список pgsql-hackers
that's a shame.
I figure, with the "WITH ... AS .." you can kind of speed up counts,  
just by doing it once - now. But still, it would be great to be able  
to use PERCENT, against estimate.
After all, imagine a table FOO with 5 rows, and something like this:

WITH c AS (select count(*)/4 as n from FOO) select * from FOO limit  
(select n from c) offset (select n*X from c);

now X is for every 25%, but you wan't get to see last row if you use  
offset 75 percent (X=3). Which kind of puts me off the idea of using  
PERCENT anyway, because it isn't quite accurate.

So thanks for answer, I'll pass on this one. Hopefully there would be  
another chance for me to write some patch in future.

ta.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hitoshi Harada"
Дата:
Сообщение: Re: SELECT TOP %d PERCENT, or SELECT ... LIMIT %d PERCENT ?
Следующее
От: Zdenek Kotala
Дата:
Сообщение: [PATCH] Extending pg_class info + more flexible TOAST chunk size