CSN wrote:
>
> Behind the scenes, is there much performance
> difference between:
>
> SELECT *
> FROM table_with_millions_of_rows
> ORDER BY col1;
>
> and:
>
> SELECT *
> FROM table_with_millions_of_rows
> ORDER BY col1
> LIMIT 100
> OFFSET 100000;
Yes, the optimizer knows it doesn't have to execute the entire query, so
the later can be faster, but that doesn't return the COUNT(*), as
requested.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073