Re: Explain reports unexpected results with inheritance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: davidl(at)ayamba(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Explain reports unexpected results with inheritance
Date: 2001-02-14 19:13:43
Message-ID: 15428.982178023@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-02-14 23:00:16 NOTICE: pg_setlocale()
Previous Message Peter Eisentraut 2001-02-14 18:46:43 Re: Sequence increased before constraint check