I’m trying to optimize the following plan and noticed that PostgreSQL spends a lot of time (relatively speaking) on sorting before the merge joins.
Is there a way (using indexes, cluster the table, etc) to eliminate the sorting steps? Or to improve it’s performance?
http://explain.depesz.com/s/qPK
I’m using PostgreSQL 9.3.5.