Re: Perplexing Query Performance - Mailing list pgsql-general

From Tom Lane
Subject Re: Perplexing Query Performance
Date
Msg-id 15524.1018966922@sss.pgh.pa.us
Whole thread Raw
In response to Re: Perplexing Query Performance  (mdklatt@ou.edu (Michael Klatt))
List pgsql-general
mdklatt@ou.edu (Michael Klatt) writes:
> select *
> from daily_rainfall as p, sites as s
> where p.site = s.ident and s.latitude >= -90 and s.latitude <= 90 and
>   s.longitude >= -180 and terrain in ('A', 'I', 'L');

> Almost any combination of 'A', 'I', and/or 'L' consistently executes
> in the same time, but if it's ONLY 'A' PostgreSQL seems to go off into
> Never Never Land.  There is no problem if 'I' or 'L' is used alone,
> just 'A'.

Sounds to me like it's switching from a good query plan to a bad one...
but since you haven't shown us EXPLAIN output nor described the
available indexes, it's hard to say much.

            regards, tom lane

pgsql-general by date:

Previous
From: Maurice Balick
Date:
Subject: Re: index problem (uses one index but not the other)
Next
From: Tom Lane
Date:
Subject: Re: Testers needed ...