Re: Explain reports unexpected results with inheritance - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Explain reports unexpected results with inheritance
Date
Msg-id 15428.982178023@sss.pgh.pa.us
Whole thread Raw
In response to Explain reports unexpected results with inheritance  (pgsql-bugs@postgresql.org)
List pgsql-bugs
pgsql-bugs@postgresql.org writes:
> Explain reports unexpected results with inheritance

I see no unexpected behavior here, nor anything that has anything to do
with inheritance.  The CREATE INDEX updates (some of) the planner's
statistics about the table, so that it now knows tab2 contains only one
page and two rows.  Under those conditions it's never going to select
an index scan --- seqscan will always look cheaper.  (A seqscan will
only need one disk page fetch, indexscan must take at least two.)

Load up more data, do a VACUUM, and try the EXPLAIN again.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Sequence increased before constraint check
Next
From: Chris Storah
Date:
Subject: create table bug with reserved words?