Search Postgresql Archives

Re: Slow query: select * order by XXX desc offset 10 limit 10

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

 



Thank you -

On Fri, Oct 14, 2011 at 11:30 AM, Pavel Stehule <pavel.stehule@xxxxxxxxx> wrote:
> you should to use a DECLARE statement
> http://www.postgresql.org/docs/9.1/interactive/sql-declare.html
> and fetch statement
> http://www.postgresql.org/docs/9.1/interactive/sql-fetch.html

I've managed to create a cursor
and can fetch the data row by row:

quincy=> start TRANSACTION;
quincy=> declare XXX cursor for select to_char(qdatetime,
'YYYY-MM-DD') as
QDATETIME,ID,NAME,CATEGORY,APPSVERSION,OSVERSION,DETAILS,DEVINFO from
quincyview where qdatetime <= now() order by QDATETIME desc ;
quincy=> fetch XXX;
.....
quincy=> fetch XXX;
.....

But how do I "go back"?

For my jQuery HTML table (DataTables.net)
I need to be able to go back and forth.

Regards
Alex

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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