Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group