Re: Function call very slow from JDBC/java but super fast from DBear

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "An, Hongguo (CORP)" <Hongguo(dot)An(at)adp(dot)com>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Function call very slow from JDBC/java but super fast from DBear
Date: 2023-08-10 03:33:58
Message-ID: CAKFQuwYiHoqFCdG_vabOz1vM8YuJOW2j5F-uq5F-y+JeLedaBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tuesday, August 8, 2023, An, Hongguo (CORP) <Hongguo(dot)An(at)adp(dot)com> wrote:

> Hi:
>
> I have a function, if I call it from DBeaver, it returns within a minute.
>
> *call* commonhp.run_unified_profile_load_script_work_assignment_details(
> 'BACDHP', 'G3XPM6YE2JHMSQA2');
>
> but if I called it from spring jdbc template, it never comes back:
>

If you are passing in exactly the same text values and running this within
the same database then executing the call command via any method should
result in the same exact outcome in terms of execution. You can get shared
buffer cache variations but that should be it. I’d want to exhaust the
possibility that those preconditions are not met before investigating this
as some sort of bug. At least, a PostgreSQL bug. I suppose the relative
novelty of using call within the JBC driver leaves open the possibility of
an issue there. Removing the driver by using PREPARE may help to move
things forward (as part of a well written bug report). In any case this is
not looking to be on-topic for the performance list. Some more research
and proving out should be done then send it to either the jdbc list or
maybe -bugs, if not then -general.

You may want to install the auto-explain extension to get the inner query
explain plan(s) into the logs for examination.

David J.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dorian Hoxha 2023-08-10 08:36:12 Partitioning update-heavy queue with hash partitions vs partial indexes
Previous Message An, Hongguo (CORP) 2023-08-09 16:50:05 Re: Function call very slow from JDBC/java but super fast from DBear