Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdlSB-0008Ru-56 for pgsql-jdbc@arkaria.postgresql.org; Tue, 05 Nov 2013 18:34:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VdlSA-0000CP-Kp for pgsql-jdbc@arkaria.postgresql.org; Tue, 05 Nov 2013 18:34:14 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdlS9-0000CJ-6y for pgsql-jdbc@postgresql.org; Tue, 05 Nov 2013 18:34:13 +0000 Received: from st11p05mm-asmtpout005.mac.com ([17.172.108.250] helo=st11p05mm-asmtp002.mac.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VdlS3-0000w3-MS for pgsql-jdbc@postgresql.org; Tue, 05 Nov 2013 18:34:12 +0000 Received: from [10.0.10.27] (ip70-162-240-85.ph.ph.cox.net [70.162.240.85]) by st11p05mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-27.08(7.0.4.27.7) 64bit (built Aug 22 2013)) with ESMTPSA id <0MVS006NRZKJNM90@st11p05mm-asmtp002.mac.com> for pgsql-jdbc@postgresql.org; Tue, 05 Nov 2013 18:33:57 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794,1.0.431,0.0.0000 definitions=2013-11-05_07:2013-11-05,2013-11-05,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1308280000 definitions=main-1311050127 Content-type: multipart/alternative; boundary="Apple-Mail=_C4542547-B427-4CE9-8858-8BB5849C3C79" MIME-version: 1.0 (Mac OS X Mail 7.0 \(1812\)) Subject: Re: JDBC slow performance on resultSet iteration? From: Kevin Wooten In-reply-to: Date: Tue, 05 Nov 2013 11:34:57 -0700 Cc: List Message-id: <1F2C740D-F8D4-465F-8968-ACB35B1FE65E@me.com> References: <73027CA6-419A-4EE4-BA8E-BD02C8802F5D@gmail.com> <15176B9F-C919-495C-8AC3-A68A6B1DD8D7@gmail.com> <2BDB1B12-F685-44C0-92CA-3799A01B9B46@gmail.com> <1221A887-18DF-4BE7-9C7F-CE53002B4EEE@me.com> <678F9D1C-4E88-45F6-B054-8046F1686F74@me.com> To: Dave Cramer X-Mailer: Apple Mail (2.1812) X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org --Apple-Mail=_C4542547-B427-4CE9-8858-8BB5849C3C79 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 In the FE/BE protocol the Simple Query can only transfer in text. = Doesn=92t the driver use the simple query protocol in a lot of cases or = is it always using the bind/exec version? Again, I may very well be = misremembering how it works. On Nov 5, 2013, at 11:25 AM, Dave Cramer wrote: > essentially everything is a prepared statement, and AFAIK, it is using = binary protocol >=20 > Dave Cramer >=20 > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca >=20 >=20 > On Tue, Nov 5, 2013 at 1:23 PM, Kevin Wooten wrote: > Am I remembering incorrectly? I thought the driver only used binary = for a few types and only if it was a prepared statement? >=20 > On Nov 5, 2013, at 11:18 AM, Dave Cramer wrote: >=20 >> I'd still like to know just how bad the getXXX calls are. Also the = driver is using binary protocol, so it shouldn't be that bad >>=20 >> Dave Cramer >>=20 >> dave.cramer(at)credativ(dot)ca >> http://www.credativ.ca >>=20 >>=20 >> On Tue, Nov 5, 2013 at 1:16 PM, Kevin Wooten wrote: >> Dave, >>=20 >> I don=92t believe he is not asking about the query time. He is = specifically asking about the cost of using JDBC vs whatever pgAdmin is = using (which seems to be libpq). >>=20 >>=20 >> On Nov 5, 2013, at 11:08 AM, Dave Cramer wrote: >>=20 >>> Rui, >>>=20 >>> The best way to settle this is to turn on log_duration in the server = and get the server timings. That will give you the query time without = rendering >>>=20 >>> Dave Cramer >>>=20 >>> dave.cramer(at)credativ(dot)ca >>> http://www.credativ.ca >>>=20 >>>=20 >>> On Tue, Nov 5, 2013 at 1:05 PM, Rui Pedro Leal = wrote: >>> Hello Edson. >>>=20 >>> I'm running everything locally on a laptop. I simply connect to PG = via JDBC localhost. Just a simple development setup. >>>=20 >>> [] Rui Pedro Leal >>> [] rui.pedro.leal@gmail.com >>>=20 >>> On 2013/11/05, at 17:47, Edson Richter wrote: >>>=20 >>>> Are you using a network between your station and the server? >>>> You're connection using IP address or server name? >>>> If the client machine has to access server several times (like in a = cursor scenario), would be necessary to solve machine names, which could = slow down the whole process. >>>>=20 >>>> Regards, >>>>=20 >>>> Edson >>>=20 >>>> Em 05/11/2013 15:42, Dave Cramer escreveu: >>>>> Kevin, >>>>>=20 >>>>> Ya, however I am still questioning the basic time measurement.=20 >>>>>=20 >>>>> Dave Cramer >>>>>=20 >>>>> dave.cramer(at)credativ(dot)ca >>>>> http://www.credativ.ca >>>>>=20 >>>>>=20 >>>>> On Tue, Nov 5, 2013 at 12:39 PM, Kevin Wooten = wrote: >>>>> Dave, >>>>> That is not necessarily true. Most of the drivers data conversion = is done in the getXXX calls of the ResultSet. All of which would count = as =93penalty=94. I=92m not saying it=92s a large penalty, just that = this is time that must be considered since pgAdmin is converting and = displaying the data as well. >>>>>=20 >>>>> On Nov 5, 2013, at 10:34 AM, Dave Cramer wrote: >>>>>=20 >>>>>> Rui Leal, >>>>>>=20 >>>>>> You shouldn't see that much of a penatly, but I question how you = are measuring it. Since you are timing the loop which is using cursors. >>>>>>=20 >>>>>> Just run a simple query and time it without iterating through the = result set. That would be equivalent=20 >>>>>>=20 >>>>>> Dave Cramer >>>>>>=20 >>>>>> dave.cramer(at)credativ(dot)ca >>>>>> http://www.credativ.ca >>>>>>=20 >>>>>>=20 >>>>>> On Tue, Nov 5, 2013 at 12:16 PM, Rui Pedro Leal = wrote: >>>>>> Hello Dave, thanks for the quick reply. >>>>>>=20 >>>>>> I'm just executing the same query on pgAdmin query interface. = Just a way to measure performance of the query + getting results vs the = JDBC way. >>>>>>=20 >>>>>> I'm using fetchsize in order to get some faster results when = iterating the resultSet. I've tried not to use fetchSize/cursor but the = performance is naturally slower (and worser than the simple pgAdmin = query). >>>>>>=20 >>>>>> What i'm asking is .. is this performance penalty i'm getting = using postgres JDBC normal and within what's expected? I'm i doing = something wrong? Can i do it in any other way? >>>>>>=20 >>>>>> Regards,=20 >>>>>>=20 >>>>>> Rui Leal >>>>>>=20 >>>>>> [] Rui Pedro Leal >>>>>> [] rui.pedro.leal@gmail.com >>>>>>=20 >>>>>>=20 >>>>>> On 2013/11/05, at 16:43, Dave Cramer wrote: >>>>>>=20 >>>>>>> How can you measure the same query in pgAdmin ? JDBC will use a = cursor when you set the fetchsize. >>>>>>>=20 >>>>>>> Dave Cramer >>>>>>>=20 >>>>>>> dave.cramer(at)credativ(dot)ca >>>>>>> http://www.credativ.ca >>>>>>>=20 >>>>>>>=20 >>>>>>> On Tue, Nov 5, 2013 at 11:12 AM, Rui Pedro Leal = wrote: >>>>>>> Just an quick info update: i'm using the = postgresql-9.2-1003-jdbc4 driver >>>>>>>=20 >>>>>>> On 2013/11/05, at 16:09, Rui Pedro Leal wrote: >>>>>>>=20 >>>>>>> > Hello everyone, >>>>>>> > >>>>>>> > I'm having slow JDBC performance on iterating a resultSet = obtained from a somewhat simple query. >>>>>>> > >>>>>>> > The query, although using PostGIS functions, is pretty = straight forward: >>>>>>> > >>>>>>> > SELECT _id, _spatial_type, ST_AsBinary(_geometry), _attribute, = _count, _references, countpersons, countfatals, countdrunks, density >>>>>>> > FROM accidents_5 >>>>>>> > WHERE (_geometry && = ST_MakeEnvelope(-126.60644531250001,26.43122806450644,-63.369140625,52.961= 87505907603, 4326) ) >>>>>>> > ORDER BY _pk_id >>>>>>> > >>>>>>> > The results are the following: >>>>>>> > - Executing the query directly from pgAdmin: ~2807ms >>>>>>> > - Executing from JVM + JDBC: 4184ms >>>>>>> > >>>>>>> > The code i'm executing is pretty much standard: >>>>>>> > >>>>>>> > -------------------- code -------------------- >>>>>>> > >>>>>>> > public static void main(final String[] args) throws = Exception { >>>>>>> > >>>>>>> > String sql =3D "SELECT _id, _spatial_type, = ST_AsBinary(_geometry), _attribute, _count, _references, countpersons, = countfatals, countdrunks, density"; >>>>>>> > sql +=3D " FROM accidents_5"; >>>>>>> > sql +=3D " WHERE (_geometry && = ST_MakeEnvelope(-126.60644531250001,26.43122806450644,-63.369140625,52.961= 87505907603, 4326) )"; >>>>>>> > sql +=3D " ORDER BY _pk_id"; >>>>>>> > >>>>>>> > System.out.println(sql); >>>>>>> > >>>>>>> > Long time =3D System.currentTimeMillis(); >>>>>>> > try { >>>>>>> > Connection connection =3D = DataStoreInfo.getDataStores().get(0); >>>>>>> > connection.setAutoCommit(false); >>>>>>> > >>>>>>> > System.out.println("[QUERY " + = Thread.currentThread().getId() >>>>>>> > + "] - connection in " >>>>>>> > + = (System.currentTimeMillis() - time) + "ms."); >>>>>>> > >>>>>>> > Statement st =3D = connection.createStatement( >>>>>>> > = ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, >>>>>>> > = ResultSet.CLOSE_CURSORS_AT_COMMIT); >>>>>>> > st.setFetchSize(250); >>>>>>> > >>>>>>> > System.out.println("[QUERY " + = Thread.currentThread().getId() >>>>>>> > + "] - statement in " + = (System.currentTimeMillis() - time) >>>>>>> > + "ms."); >>>>>>> > >>>>>>> > ResultSet resultSet =3D = st.executeQuery(sql); >>>>>>> > >>>>>>> > System.out.println("[QUERY " + = Thread.currentThread().getId() >>>>>>> > + "] - done in " + = (System.currentTimeMillis() - time) >>>>>>> > + "ms."); >>>>>>> > >>>>>>> > GeometryFactory geofact =3D new = GeometryFactory(new PrecisionModel(),4326); >>>>>>> > WKBReader wkbReader =3D new = WKBReader(geofact); >>>>>>> > >>>>>>> > String id; >>>>>>> > String spatialType; >>>>>>> > Geometry geometry; >>>>>>> > String attribute; >>>>>>> > Long count; >>>>>>> > String reference; >>>>>>> > Map properties; >>>>>>> > String granularSynthString =3D = "GranularSynthesis"; >>>>>>> > >>>>>>> > while (resultSet.next()) { >>>>>>> > id =3D resultSet.getString(1); >>>>>>> > spatialType =3D = resultSet.getString(2); >>>>>>> > >>>>>>> > // geometry =3D = wkbReader.read(resultSet.getBytes(3)); // ignored the WKBReader and the = results are about the same. >>>>>>> > attribute =3D = resultSet.getString(4); >>>>>>> > count =3D resultSet.getLong(5); >>>>>>> > reference =3D = resultSet.getString(6); >>>>>>> > >>>>>>> > properties =3D new = HashMap(); >>>>>>> > Double aux =3D = resultSet.getDouble(7); >>>>>>> > properties.put("countpersons", = aux); >>>>>>> > aux =3D resultSet.getDouble(8); >>>>>>> > properties.put("countfatals", = aux); >>>>>>> > aux =3D resultSet.getDouble(9); >>>>>>> > properties.put("countdrunks", = aux); >>>>>>> > aux =3D resultSet.getDouble(10); >>>>>>> > properties.put("density", aux); >>>>>>> > } >>>>>>> > >>>>>>> > System.out.println("[QUERY " + = Thread.currentThread().getId() >>>>>>> > + "] - done & iterated = in " >>>>>>> > + = (System.currentTimeMillis() - time) + "ms."); >>>>>>> > >>>>>>> > resultSet.close(); >>>>>>> > st.close(); >>>>>>> > connection.commit(); >>>>>>> > connection.close(); >>>>>>> > } catch (SQLException exception) { >>>>>>> > exception.printStackTrace(); >>>>>>> > // } catch (ParseException exception) { // = ignored from WKBreader >>>>>>> > // exception.printStackTrace(); >>>>>>> > } >>>>>>> > >>>>>>> > System.out.println("[End " + = Thread.currentThread().getId() >>>>>>> > + "] - done in " + = (System.currentTimeMillis() - time) + "ms."); >>>>>>> > } >>>>>>> > >>>>>>> > -------------------- end code -------------------- >>>>>>> > >>>>>>> > Although i'm executing this on slow MacbookPro (2.6 core duo, = 2Gbs RAM but SSD) and have a 9.1.2 postgres, i've also tested this on a = recent retina MBP and the ratio between pgAdmin and JDBC execution is = similar. >>>>>>> > >>>>>>> > Is this expected? Can someone point if i'm doing something = terrible wrong? >>>>>>> > >>>>>>> > I'm not concerned about the query performance per-se (i know = it CAN be optimized), but the differences just using JDBC and iterating = the resultSet are really annoying. >>>>>>> > >>>>>>> > Thanks in advance for any help. >>>>>>> > >>>>>>> > Kind regards, >>>>>>> > >>>>>>> > Rui Leal >>>>>>> > >>>>>>> > >>>>>>>=20 >>>>>>>=20 >>>>>>>=20 >>>>>>> -- >>>>>>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >>>>>>> To make changes to your subscription: >>>>>>> http://www.postgresql.org/mailpref/pgsql-jdbc >>>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>>=20 >>>=20 >>>=20 >>=20 >>=20 >=20 >=20 --Apple-Mail=_C4542547-B427-4CE9-8858-8BB5849C3C79 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 In the = FE/BE protocol the Simple Query can only transfer in text.  Doesn=92t= the driver use the simple query protocol in a lot of cases or is it = always using the bind/exec version?  Again, I may very well be = misremembering how it works.

On Nov 5, 2013, at 11:25 = AM, Dave Cramer <pg@fastcrypt.com> = wrote:

essentially everything is a prepared = statement, and AFAIK, it is using binary protocol

Dave = Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Tue, Nov 5, 2013 at 1:23 PM, Kevin = Wooten <kdubb@me.com> wrote:
Am I remembering incorrectly? =  I  thought the driver only used binary for a few types and = only if it was a prepared statement?

On Nov 5, 2013, at 11:18 AM, Dave Cramer = <pg@fastcrypt.com> wrote:

I'd still like to know = just how bad the getXXX calls are. Also the driver is using binary = protocol, so it shouldn't be that bad

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Tue, Nov 5, 2013 at 1:16 PM, Kevin = Wooten <kdubb@me.com> wrote:
Dave,

I don=92t believe he is not = asking about the query time.  He is specifically asking about the = cost of using JDBC vs whatever pgAdmin is using (which seems to be = libpq).


On Nov 5, 2013, at 11:08 AM, Dave Cramer = <pg@fastcrypt.com> wrote:

Rui,

The best way to settle this is to turn on log_duration in = the server and get the server timings. That will give you the query time = without rendering

Dave = Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Tue, Nov 5, 2013 at 1:05 PM, Rui = Pedro Leal <rui.pedro.leal@gmail.com> = wrote:
Hello Edson.

I'm = running everything locally on a laptop. I simply connect to PG via JDBC = localhost. Just a simple development setup.

[] Rui Pedro Leal

On 2013/11/05, at 17:47, Edson = Richter wrote:

Are you using a network between your station and the server?
You're = connection using IP address or server name?
If the client machine has = to access server several times (like in a cursor scenario), would be = necessary to solve machine names, which could slow down the whole = process.

Regards,

Edson

=20 =20 =20
Em 05/11/2013 15:42, Dave Cramer escreveu:
Kevin,

Ya, however I am still questioning the basic time measurement. 

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Tue, Nov 5, 2013 at 12:39 PM, = Kevin Wooten <kdubb@me.com> wrote:
Dave,
That is not necessarily true. Most of the drivers data conversion is done in the getXXX calls of the ResultSet.  All of which would count as =93penalty=94. =  I=92m not saying it=92s a large penalty, just that this is time that must be considered since pgAdmin is converting and displaying the data as well.

On Nov 5, 2013, at 10:34 AM, Dave Cramer = <pg@fastcrypt.com> wrote:

Rui Leal,

You shouldn't see that much of a penatly, but I question how you are measuring it. Since you are timing the loop which is using cursors.

Just run a simple query and time it without iterating through the result set. That would be equivalent 

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Tue, Nov 5, 2013 at 12:16 PM, Rui Pedro Leal <rui.pedro.leal@gmail.com> wrote:
Hello Dave, thanks for the quick reply.

I'm just executing the same query on pgAdmin query interface. Just a way to measure performance of the query + getting results vs the JDBC way.

I'm using fetchsize in order to get some faster results when iterating the resultSet. I've tried not to use fetchSize/cursor but the performance is naturally slower (and worser than the simple pgAdmin query).

What i'm asking is .. is this performance penalty i'm getting using postgres JDBC normal and within what's expected? I'm i doing something wrong? Can i do it in any other way?

Regards, 

Rui Leal

[] Rui Pedro = Leal


On 2013/11/05, at 16:43, Dave Cramer wrote:

How can you measure the same query in pgAdmin ? JDBC will use a cursor when you set the fetchsize.

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Tue, Nov 5, 2013 at 11:12 AM, Rui Pedro Leal <rui.pedro.leal@gmail.com> wrote:
Just an quick info update: i'm using the postgresql-9.2-1003-jdbc4 driver

On 2013/11/05, at 16:09, Rui Pedro Leal = wrote:

> Hello everyone,
>
> I'm having slow JDBC performance on iterating a resultSet obtained from a somewhat simple query.
>
> The query, although using PostGIS functions, is pretty straight forward:
>
> SELECT _id, _spatial_type, ST_AsBinary(_geometry), _attribute, _count, _references, countpersons, countfatals, countdrunks, density
> FROM = accidents_5
> WHERE (_geometry && = ST_MakeEnvelope(-126.60644531250001,26.43122806450644,-63.369140625,52.961= 87505907603, 4326) )
> ORDER BY _pk_id
>
> The results are the following:
> - Executing the query directly from pgAdmin: ~2807ms
> - Executing from JVM + JDBC: 4184ms
>
> The code i'm executing is pretty much standard:
>
> -------------------- code --------------------
>
>     =   public static void main(final String[] args) throws Exception = {
>
>     =           String sql =3D "SELECT _id, _spatial_type, ST_AsBinary(_geometry), _attribute, _count, _references, countpersons, countfatals, countdrunks, = density";
>     =           sql +=3D " FROM = accidents_5";
>     =           sql +=3D " WHERE (_geometry && = ST_MakeEnvelope(-126.60644531250001,26.43122806450644,-63.369140625,52.961= 87505907603, 4326) )";
>     =           sql +=3D " ORDER BY = _pk_id";
>
>     =           = System.out.println(sql);
>
>     =           Long time =3D = System.currentTimeMillis();
>     =           try {
>     =                   Connection = connection =3D = DataStoreInfo.getDataStores().get(0);
>     =                   = connection.setAutoCommit(false);
>
>     =                   = System.out.println("[QUERY " + = Thread.currentThread().getId()
>     =                       =             + "] - connection in "
>     =                       =             + = (System.currentTimeMillis() - time) + "ms.");
>
>     =                   Statement st =3D = connection.createStatement(
>     =                       =             = ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
>     =                       =             = ResultSet.CLOSE_CURSORS_AT_COMMIT);
>     =                   = st.setFetchSize(250);
>
>     =                   = System.out.println("[QUERY " + = Thread.currentThread().getId()
>     =                       =             + "] - statement in " + = (System.currentTimeMillis() - time)
>     =                       =             + "ms.");
>
>     =                   ResultSet = resultSet =3D = st.executeQuery(sql);
>
>     =                   = System.out.println("[QUERY " + = Thread.currentThread().getId()
>     =                       =             + "] - done in " + = (System.currentTimeMillis() - time)
>     =                       =             + "ms.");
>
>     =                   GeometryFactory geofact =3D new GeometryFactory(new = PrecisionModel(),4326);
>     =                   WKBReader = wkbReader =3D new = WKBReader(geofact);
>
>     =                   String id;
>     =                   String = spatialType;
>     =                   Geometry = geometry;
>     =                   String = attribute;
>     =                   Long count;
>     =                   String = reference;
>     =                   Map<String, Double> = properties;
>     =                   String granularSynthString =3D "GranularSynthesis";
>
>     =                   while (resultSet.next()) {
>     =                       =     id =3D = resultSet.getString(1);
>     =                       =     spatialType =3D = resultSet.getString(2);
>
>     =                       =     // geometry =3D = wkbReader.read(resultSet.getBytes(3)); // ignored the WKBReader and the results are about the same.
>     =                       =     attribute =3D = resultSet.getString(4);
>     =                       =     count =3D = resultSet.getLong(5);
>     =                       =     reference =3D = resultSet.getString(6);
>
>     =                       =     properties =3D new HashMap<String, Double>();
>     =                       =     Double aux =3D = resultSet.getDouble(7);
>     =                       =     = properties.put("countpersons", aux);
>     =                       =     aux =3D = resultSet.getDouble(8);
>     =                       =     = properties.put("countfatals", aux);
>     =                       =     aux =3D = resultSet.getDouble(9);
>     =                       =     = properties.put("countdrunks", aux);
>     =                       =     aux =3D = resultSet.getDouble(10);
>     =                       =     = properties.put("density", aux);
>     =                   }
>
>     =                   = System.out.println("[QUERY " + = Thread.currentThread().getId()
>     =                       =             + "] - done & iterated in = "
>     =                       =             + = (System.currentTimeMillis() - time) + "ms.");
>
>     =                   = resultSet.close();
>     =                   st.close();
>     =                   = connection.commit();
>     =                   = connection.close();
>     =           } catch (SQLException exception) {
>     =                   = exception.printStackTrace();
>     =           // } catch (ParseException exception) {  // = ignored from WKBreader
>     =           // = exception.printStackTrace();
>     =           }
>
>     =           System.out.println("[End " + = Thread.currentThread().getId()
>     =                       =     + "] - done in " + = (System.currentTimeMillis() - time) + "ms.");
>     =   }
>
> -------------------- end code --------------------
>
> Although i'm executing this on slow MacbookPro (2.6 core duo, 2Gbs RAM but SSD) and have a 9.1.2 postgres, i've also tested this on a recent retina MBP and the ratio between pgAdmin and JDBC execution is = similar.
>
> Is this expected? Can someone point if i'm doing something terrible wrong?
>
> I'm not concerned about the query performance per-se (i know it CAN be optimized), but the differences just using JDBC and iterating the resultSet are really annoying.
>
> Thanks in advance for any help.
>
> Kind regards,
>
> Rui Leal
>
>



--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc




=


=




= --Apple-Mail=_C4542547-B427-4CE9-8858-8BB5849C3C79--