RE: JDBC Meta-data performance for Foreign Keys

From: "ldh(at)laurent-hasson(dot)com" <ldh(at)laurent-hasson(dot)com>
To: Mark Rotteveel <mark(at)lawinegevaar(dot)nl>, "pgsql-jdbc(at)lists(dot)postgresql(dot)org" <pgsql-jdbc(at)lists(dot)postgresql(dot)org>
Subject: RE: JDBC Meta-data performance for Foreign Keys
Date: 2021-10-04 03:02:47
Message-ID: MN2PR15MB2560BA59E0E4FD739B388BFD85AE9@MN2PR15MB2560.namprd15.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> -----Original Message-----
> From: Mark Rotteveel <mark(at)lawinegevaar(dot)nl>
> Sent: Saturday, October 2, 2021 04:57
> To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
> Subject: Re: JDBC Meta-data performance for Foreign Keys
>
> On 02-10-2021 08:29, ldh(at)laurent-hasson(dot)com wrote:
> > Lots of code refactoring on our end, but it was worth it as the results
> are quite good with a ~70% improvement!
> >
> > The only gotcha is what I tried to also optimize the calls for indices, I
> was surprised that the jdbc method DatabaseMetaData.getIndexInfo()
> doesn't take a table pattern like other "getXXXInfo" methods. For now
> we have decent performance, so dropping to a custom query to optimize
> indices is something we can do later.
> >
> >
> > pre-optimization
> > ==========================================
> > [..]
> > Views: 362 in 22.00ms or 0.1%
> > ------------------------------------------
> > Total: 19,667.00ms
> >
> >
> > post-optimization
> > ==========================================
> > [..]
> > Views: 362 in 113.00ms or 1.9%
> > ----------------------------------------------------------------------------
> > Total: 5,809.00ms
>
> I notice that you seem to be requesting views separately. You should be
> able to do that in a single call to DatabaseMetaData.getTables together
> with retrieving the tables.
>
> Mark
> --
> Mark Rotteveel
>

It's the way we do the logging for processing... But in any case, we are talking a few milliseconds here so not something I was paying attention to specifically.

Thank you,
Laurent.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2021-10-04 10:41:46 [pgjdbc/pgjdbc] 3cf175: fix: Regressions caused by PR#1949 (#2266)
Previous Message Thomas Kellerer 2021-10-03 12:07:59 Can't run CREATE PROCEDURE with new Postgres' 14 new SQL-standard body