I wrote: > [ assorted possible workarounds ] Actually, an easy fix might be to create a 2-column index on usagestats(type, tid). I think the planner should be able to use that to produce sorted output for the mergejoin, and you'd get the best of both worlds, because the indexscan will stop immediately when it's exhausted the rows with type = 'vehicle'. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance