pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
strange problem
3+ messages / 3 participants
[nested] [flat]

* strange problem
@ 2006-01-25 19:51  Gilbert, Antoine <AGilbert@korem.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Gilbert, Antoine @ 2006-01-25 19:51 UTC (permalink / raw)
  To: pgsql-jdbc

Hi

 

I have a single PostGIS table in PostgreSQL

 

This table has like 500000 records

 

I use the JDBC driver to only send a quick query without browsing
resultset and it take forever. For example:

 

Statement stmt = connection.createStatement();

ResultSet rs =stmt.executeQuery("select street from \"QCs_polyline\"");

stmt.close();

 

This takes 19 sec. Does I am missing something like a configuration on
the driver? So far I was just testing PostGIS/PostgreSQL with tiny
tables. 

 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: strange problem
@ 2006-01-25 20:20  Kris Jurka <books@ejurka.com>
  parent: Gilbert, Antoine <AGilbert@korem.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Kris Jurka @ 2006-01-25 20:20 UTC (permalink / raw)
  To: Gilbert, Antoine <AGilbert@korem.com>; +Cc: pgsql-jdbc



On Wed, 25 Jan 2006, Gilbert, Antoine wrote:

> I have a single PostGIS table in PostgreSQL
> This table has like 500000 records
> I use the JDBC driver to only send a quick query without browsing
> resultset and it take forever. For example:
>
> Statement stmt = connection.createStatement();
> ResultSet rs =stmt.executeQuery("select street from \"QCs_polyline\"");
> stmt.close();
>
> This takes 19 sec. Does I am missing something like a configuration on
> the driver? So far I was just testing PostGIS/PostgreSQL with tiny
> tables.
>

By default the JDBC driver will fetch the entire ResultSet before the 
executeQuery call returns.  If you don't want this behavior set the 
fetchsize appropriately.  See the following for more information:

http://jdbc.postgresql.org/documentation/81/query.html#query-with-cursor

Kris Jurka



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: strange problem
@ 2006-01-26 05:32  Andres Ledesma <aledes@euskalnet.net>
  parent: Gilbert, Antoine <AGilbert@korem.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Andres Ledesma @ 2006-01-26 05:32 UTC (permalink / raw)
  To: pgsql-jdbc

On Wednesday 25 January 2006 08:51 pm, Gilbert, Antoine wrote:
>
> Statement stmt = connection.createStatement();
>
> ResultSet rs =stmt.executeQuery("select street from \"QCs_polyline\"");
>
> stmt.close();
>
>
>
> This takes 19 sec. Does I am missing something like a configuration on
> the driver? So far I was just testing PostGIS/PostgreSQL with tiny
> tables.

Did you try to create a function in the database returning the rows you want 
to fetch and to use CallableStatement ? 

-- 

Andres Ledesma
=================



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-01-26 05:32 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-25 19:51 strange problem Gilbert, Antoine <AGilbert@korem.com>
2006-01-25 20:20 ` Kris Jurka <books@ejurka.com>
2006-01-26 05:32 ` Andres Ledesma <aledes@euskalnet.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox