Search Postgresql Archives

Re: JDBC and Portals . Clarification

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

 




On Fri, 25 Feb 2005, Dave Smith wrote:

> Is a portal using the V3 protocol the same as a cursor? I am trying to
> debug a slow query and I want the JDBC driver to use the cursor syntax.
> It says it is using a portal but the performance seems like just a
> regular sql statement. 
> 

Yes, portals and cursors are pretty much the same thing.  Depending on 
your query using a cursor may not actually speed it up, consider SELECT * 
FROM tab ORDER BY col; The whole result must be sorted before any row is 
returned.  What it will do in this case is just reduce the memory 
consumption on the client by not fetching all the rows at once.  Also 
please check the list of restrictions for the JDBC driver to actually use 
a portal/cursor backed ResultSet:
 
http://jdbc.postgresql.org/documentation/80/query.html#query-with-cursor

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

[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