Search Postgresql Archives

cursor MOVE vs OFFSET in SELECT

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

 



Suppose that you have a query, say $sql_query, which is very
complicated and produces many rows. Which of the following is going to
be faser:

    $sql_query OFFSET 3000 LIMIT 12;

or

    BEGIN;
    DECLARE cur1 CURSOR FOR $sql_query;
    MOVE 3000 IN cur1;
    FETCH 12 FROM cur1;
    COMMIT;

Naturally, the former cannot be slower than the latter. So my question
essentially is whether the MOVE operation on a cursor is
(significantly) slower that a OFFSET on the SELECT.

-- 
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