Skip site navigation (1) Skip section navigation (2)

Re: experience sharing: select query returns more records than necessary

From: Kent Tong <kent(at)cpttm(dot)org(dot)mo>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: experience sharing: select query returns more records than necessary
Date: 2009-01-20 14:43:32
Message-ID: 21564410.post@talk.nabble.com (view raw or flat)
Thread:
Lists: pgsql-jdbc


Oliver Jowett wrote:
> 
> Dave Cramer wrote:
> Though, I would suggest that if you really only care about the first 50 
> results, then put a LIMIT 50 in your query! The query planner may come 
> up with a better plan if you do that, too ..
> 
> If you want to "stream" the whole resultset, then fetchsize is certainly 
> the way to do it.
> 

Yeah, I was actually settling on "LIMIT 50" before coming across
setFetchSize(). 
However, the support for LIMIT varies from one DBMS to another. To keep 
the code as portable as possible, I decided to go with setFetchSize().


-----
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA
-- 
View this message in context: http://www.nabble.com/experience-sharing%3A-select-query-returns-more-records-than-necessary-tp21556532p21564410.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


In response to

Responses

pgsql-jdbc by date

Next:From: Dave CramerDate: 2009-01-20 15:56:50
Subject: Re: experience sharing: select query returns more records than necessary
Previous:From: Mario SplivaloDate: 2009-01-20 14:27:09
Subject: Pg 8.3, jdbc and UUID

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group