MergeAppend costing - Mailing list pgsql-hackers

From Robert Haas
Subject MergeAppend costing
Date
Msg-id AANLkTi=t6ietJ1gFvyfPNh-fJerq_hKdj5JTDcb5c6ZU@mail.gmail.com
Whole thread Raw
Responses Re: MergeAppend costing
List pgsql-hackers
See the attached test case.  With that setup, this uses MergeAppend:

explain select * from ma_parent order by id limit 10;

But this one does not:

explain select * from ma_parent order by name limit 10;

...which seems odd, because the index on ma_child1 and sorting the
other two ought to still be better than appending all three and
sorting the whole thing.  If you drop ma_child2, you get MergeAppend
again:

begin;
drop table ma_child2;
explain select * from ma_parent order by name limit 10;
rollback;

...which makes me wonder if our costing model is off?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: git diff script is not portable
Next
From: Andres Freund
Date:
Subject: Re: git diff script is not portable