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