Paul Tillotson <pntil@shentel.net> writes:
> Does postgres actually do multiple concurrent sorts within a single
> backend?
Certainly. Consider for example a merge join with each input being
sorted by an explicit sort step. DISTINCT, ORDER BY, UNION, and related
operators require their own sort steps in the current implementation.
It's not difficult to invent queries that require arbitrarily large
numbers of sort steps.
regards, tom lane