Thread: JDBC and Portals . Clarification

JDBC and Portals . Clarification

From
Dave Smith
Date:
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.

--
Dave Smith
CANdata Systems Ltd
416-493-9020


Re: JDBC and Portals . Clarification

From
Kris Jurka
Date:

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