Search Postgresql Archives

I know the bad way...what is the good way?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I confess to having once written code that prints something like
"Items # 1 to 10 of 45"
by using select count(*) from t where condition; and select * from t where condition limit 10 offset x;

I now know this is "bad", I guess because of the count() and the offset.

So what is the preferred way? If it matters, my new application is servlet based, so I believe (but not positive) this means cursors are an option? Is this a better way to do this?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux