Re: [HACKERS] Interesting behaviour ! - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Interesting behaviour !
Date
Msg-id 25433.931961494@sss.pgh.pa.us
Whole thread Raw
In response to Interesting behaviour !  (Constantin Teodorescu <teo@flex.ro>)
List pgsql-hackers
Constantin Teodorescu <teo@flex.ro> writes:
> So, I think that PostgreSQL is doing right when he chooses not to use
> "note_perioada" index for that type of query by comparing different
> costs (althought it still remains strange at the first look).

Although the real problem here was a type clash (which I agree ought
to be fixed), it should be pointed out that there *is* a threshold of
selectivity below which the optimizer will choose not to use an index
scan.  I'm not sure what it is offhand, nor whether it's set at a
good level.  This behavior emerges indirectly from the cost estimate
functions for sequential and index scans, and I'm not convinced that
they are as accurate as they need to be...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "John Ridout"
Date:
Subject: RE: [HACKERS] Updated TODO list
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] MAX Query length