pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: Eyal Wilde <eyal.wilde@gmail.com>
To: PostgreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: bug report: slow getColumnTypeName
Date: Tue, 09 Oct 2012 10:48:01 -0600
Message-ID: <50745541.8060204@ttc-cmc.net> (raw)
In-Reply-To: <CAMiEbchygfLbpytyOdDXL3-ORjMD76u_0MqwX9QROzCkHUUp0Q@mail.gmail.com>
References: <CAMiEbch4MsNhkTamK3dt4GpJ8qU0BObYPmMNGkrzVFLjwONMpQ@mail.gmail.com>
	<CAMiEbchygfLbpytyOdDXL3-ORjMD76u_0MqwX9QROzCkHUUp0Q@mail.gmail.com>

Eyal Wilde wrote:
> I verified with wireshark that  getColumnTypeName indeed do a request to
> the postgres server. This happens with 9.1-901 and 9.1-903 BUT NOT WITH
> 9.0-801!!
>
> So, the reason for the slowness seems to be obviouse now.
>
> it will take me some time to wrap up it into a test case. I would realy
> like to help, but please let me know if it's realy necessary.
>
> On Oct 5, 2012 1:07 AM, "Eyal Wilde" <eyal@impactsoft.co.il
> <mailto:eyal@impactsoft.co.il>> wrote:
>
>
>                          ResultSetMetaData __md = __rs.getMetaData();
>       //this is fine
>                          String __sf1name = __md.getColumnName(1);
>        //this is fine
>                          int __if1type = __md.getColumnType(1);
>             //this is fine
>                          String __sf1type =
>     __md.getColumnTypeName(1); //this is SLOW!! ~15msec
>
>     postgres server version is 9.1.5
>     jdbc version, i checked both 9.1-901 and 9.1-903
>     and... BTW, 9.0-801 works good (while connected pg9.1)!

There does appear to be a change in the code that may have created the
slowness that you are observing. Please try a a test case in which two
back to back getColumnTypeName() calls are made. Is there a difference
in time between the first and second and is there still on the second
call a request to the postgres server.

The code between 9.0-801 and later version does have a change in it
that looks like for the caching for field metadata through fetchFieldMetaData().
That method is called in the later versions for getColumnTypeName()
with isAutoIncrement(), with was also added in later versions.

danap.





view thread (30+ messages)  latest in thread

Message-ID: <50745541.8060204@ttc-cmc.net>
Permalink:  ../50745541.8060204@ttc-cmc.net/
Also on:    postgresql.org/message-id/50745541.8060204@ttc-cmc.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: danap@ttc-cmc.net, eyal.wilde@gmail.com
  Subject: Re: bug report: slow getColumnTypeName
  In-Reply-To: <50745541.8060204@ttc-cmc.net>
  References: <CAMiEbch4MsNhkTamK3dt4GpJ8qU0BObYPmMNGkrzVFLjwONMpQ@mail.gmail.com> <CAMiEbchygfLbpytyOdDXL3-ORjMD76u_0MqwX9QROzCkHUUp0Q@mail.gmail.com> <50745541.8060204@ttc-cmc.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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