Re: query plan - Mailing list pgsql-bugs

From Tom Lane
Subject Re: query plan
Date
Msg-id 399.1002224193@sss.pgh.pa.us
Whole thread Raw
In response to query plan  ("ag20" <ag20@co.merced.ca.us>)
List pgsql-bugs
"ag20" <ag20@co.merced.ca.us> writes:
> Is there a reason that the expressions:
>  Crops.change_e > '10/1/2001'
>  '10/1/2001' < Crops.change_e
> when used in a WHERE clause of a query should yield
> a good plan for the first and a bad plan for the second?

I think you have a broken installation.  I get this plan either way
on 7.1:

Nested Loop  (cost=0.00..4.96 rows=1 width=64)
  ->  Nested Loop  (cost=0.00..3.54 rows=1 width=48)
        ->  Index Scan using crops_loct on crops  (cost=0.00..2.02 rows=1 width=32)
        ->  Seq Scan on plantunits  (cost=0.00..1.17 rows=17 width=16)
  ->  Seq Scan on commtypes  (cost=0.00..1.13 rows=13 width=16)

The wacko numbers and "nan"s in your output look like something is
fairly hosed internally --- disagreement between different files about
a struct layout is my first thought.  How did you compile or come by
your executables?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Long options for psql in 7.1.3
Next
From: Peter Eisentraut
Date:
Subject: Re: \lo_unlink results in "ERROR: pg_description: Permission