Skip site navigation (1) Skip section navigation (2)

Re: Large # of rows in query extremely slow, not using index

From: Stephen Crowley <stephen(dot)crowley(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Cc: Kris Jurka <books(at)ejurka(dot)com>
Subject: Re: Large # of rows in query extremely slow, not using index
Date: 2004-09-23 23:36:49
Message-ID: 3f71fdf104092316367c5f3052@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
Thanks for the explanation. So what sort of changes need to be made to
the client/server protocol to fix this problem?



On Thu, 23 Sep 2004 18:22:15 -0500 (EST), Kris Jurka <books(at)ejurka(dot)com> wrote:
> 
> 
> On Tue, 14 Sep 2004, Stephen Crowley wrote:
> 
> > Problem solved.. I set the fetchSize to a reasonable value instead of
> > the default of unlimited  in the PreparedStatement and now the query
> > is . After some searching it seeems this is a common problem, would it
> > make sense to change the default value to something other than 0 in
> > the JDBC driver?
> 
> In the JDBC driver, setting the fetch size to a non-zero value means that
> the query will be run using what the frontend/backend protocol calls a
> named statement.  What this means on the backend is that the planner will
> not be able to use the values from the query parameters to generate the
> optimum query plan and must use generic placeholders and create a generic
> plan.  For this reason we have decided not to default to a non-zero
> fetch size.  This is something whose default value could be set by a URL
> parameter if you think that is something that is really required.
> 
> Kris Jurka
> 
>

In response to

Responses

pgsql-performance by date

Next:From: Kris JurkaDate: 2004-09-23 23:47:59
Subject: Re: Large # of rows in query extremely slow, not using
Previous:From: Kris JurkaDate: 2004-09-23 23:22:15
Subject: Re: Large # of rows in query extremely slow, not using

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group