BTW, if we're to start taking joins on TID seriously, we should also add the missing hash opclass for TID, so that you can do hash joins when dealing with a lot of rows.
(In principle this also enables things like hash aggregation, though I'm not very clear on a use-case for grouping by TID.)
I don't think we are trying to do TID joins more seriously, just fix a special case.
The case cited requires the batches of work to be small, so nested loops works fine.
Looks to me that Edmund is trying to solve the same problem. If so, this is the best solution.
--
Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services