tgl@postgresql.org (Tom Lane) writes:
> (The materialize protects the sort from having to support mark/restore,
> allowing it to do its final merge pass on-the-fly.) We neglected to teach
> cost_mergejoin about that hack, so it was failing to include the
> materialize's costs in the estimated cost of the mergejoin.
Is that right? The materialize is just doing the same writing that the final
pass of the sort would have been doing. Did we discount the costs for sort for
that skipping writing that final pass when that was done?
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's 24x7 Postgres support!