Re: Slow query in JDBC

From: Subramaniam C <subramaniam31784(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query in JDBC
Date: 2017-09-28 08:58:24
Message-ID: CAL=06Wme9NwYw9nDv034_DUJdzRxoDpK3r0v48-8fn-y=q+yyA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I configured cursor_tuple_fraction to 1 but still I am facing the same
issue.
Please help.

On Thu, Sep 28, 2017 at 2:18 PM, Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> On Thu, Sep 28, 2017 at 10:19 AM, Subramaniam C
> <subramaniam31784(at)gmail(dot)com> wrote:
> > Hi
> >
> > When I try to execute the query from sql command line then that query is
> > taking only around 1 sec. But when I execute the query using JDBC(Java)
> > using preparedStatement then the same query is taking around 10 secs.
> >
> > Can you please let us know the reason and how to fix this issue?
>
>
> I think jdbc always uses cursor, which can be problematic with default
> configuration, because postgres will try to generate plans that
> returns fast the first rows but not all the rows . Can you try to
> configure cursor_tuple_fraction to 1 and see if that fixes your issue?
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Julien Rouhaud 2017-09-28 09:20:45 Re: Slow query in JDBC
Previous Message Julien Rouhaud 2017-09-28 08:48:53 Re: Slow query in JDBC