Check out our latest eBook: "Efficient Search in Rails with Postgres". We've updated our Terms of Service and Privacy Policy, effective Jan 30, 2021.

EXPLAIN - Insights: Disk Sorts


A Sort node consumes all rows from its child node and produces sorted output. To stay within bounds of work_mem, it may need to “spill” the sort operation to disk. This ensures it can continue, but, writing to disk during query execution can slow things down dramatically.

Recommended Action:

Increase work_mem until the sort can be performed in memory.

Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →