MergeAppend costing
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: pgsql-hackers@postgresql.org
Date: 2010-11-17T19:04:37Z
Lists: pgsql-hackers
Attachments
- inh.sql (application/octet-stream)
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