From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | MergeAppend costing |
Date: | 2010-11-17 19:04:37 |
Message-ID: | AANLkTi=t6ietJ1gFvyfPNh-fJerq_hKdj5JTDcb5c6ZU@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 | Content-Type | Size |
---|---|---|
inh.sql | application/octet-stream | 733 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2010-11-17 19:06:46 | Re: git diff script is not portable |
Previous Message | Magnus Hagander | 2010-11-17 19:03:28 | Re: git diff script is not portable |