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

Re: different clients, different query plans

From: Uwe Bartels <uwe(dot)bartels(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: different clients, different query plans
Date: 2011-02-18 15:06:12
Message-ID: AANLkTimz8Qfqsfqc6Uw+DN-0BUMFD_5Ev69sKm0ynHqO@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
the types are integer.
excellent!
you saved my weekend.

Uwe

Uwe Bartels
Systemarchitect - Freelancer
mailto: uwe(dot)bartels(at)gmail(dot)com
tel: +49 172 3899006
profile: https://www.xing.com/profile/Uwe_Bartels
website: http://www.uwebartels.com



On 18 February 2011 15:58, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>wrote:

> Uwe Bartels <uwe(dot)bartels(at)gmail(dot)com> wrote:
>
> > I have a java application which generates inperformant query
> > plans.
>
> > Index Cond: ((lat >= $3) AND (lat <= $4) AND (lon >= $1) AND (lon
> > <= $2))
>
> > Filter: (((lon)::double precision >= $1) AND ((lon)::double
> > precision <= $2) AND ((lat)::double precision >= $3) AND
> > ((lat)::double precision <= $4))
>
> It is the cast of the table columns to double precision which is
> taking the index out of play.
>
> What are the data types of those columns?  What does the code look
> like where you're setting the values for the parameters?  If nothing
> else, writing the query so that the parameters are cast to the right
> type before use might solve the problem, but I would start by
> looking at the object classes used in the Java app.
>
> -Kevin
>

In response to

pgsql-performance by date

Next:From: Clemens EissererDate: 2011-02-19 10:30:42
Subject: Slow query execution over high latency network
Previous:From: Kevin GrittnerDate: 2011-02-18 14:58:29
Subject: Re: different clients, different query plans

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