Search Postgresql Archives

DBD::Pg behavior for large queries

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

 



I'm using DBD::Pg under mod perl, and I'm trying to find a way to
workaround the fact that DBD::Pg fetches all the data at once in a
query and sticks it into memory before you execute a fetch.  Right now
I'm having to kill the apache child after it's finished running in
certain cases, and I'd rather not do that.

The DBD::Pg man page say's this about cursors.  What I don't
understand is the nested selects being in a different transactions. 
Can someone clarify for me what is being said here?  Does this
basically mean that I can use cursors in DBD::Pg, I just can't use the
built in DBI cursor functions?  And If I'm reading this correctly you
can't do nested selects within cursors period?

"Although PostgreSQL has a cursor concept, it has not been used in the
       current implementation. Cursors in PostgreSQL can only be used inside a
       transaction block. Because only one transaction block at a time is
       allowed, this would have implied the restriction, not to use any nested
       SELECT statements. Hence the execute method fetches all data at once
       into data structures located in the frontend application. This has to
       be considered when selecting large amounts of data!"


Chris

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[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