Re: JDBC and Portals . Clarification

From: Kris Jurka <books(at)ejurka(dot)com>
To: Dave Smith <dave(dot)smith(at)candata(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: JDBC and Portals . Clarification
Date: 2005-03-01 23:49:38
Message-ID: Pine.BSO.4.56.0503011845410.20222@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message L. Fletcher 2005-03-02 00:04:33 basic temp table question
Previous Message Christopher Browne 2005-03-01 23:23:22 Re: Trigger email?