"Ron Mayer" <[EMAIL PROTECTED]> writes: > One thing I've been wondering, is if "sort_mem" could be > per connection/backend-process instead of per sorting operation > so that sort_mem could be set more aggressivelly without running out > of memory so easily with large queries.
Not very readily. To estimate the cost of a given operation that needs working memory, the planner has to know how much memory that operation will be permitted to use. If you try to make that depend on how many such operations exist in the total plan, then you are chasing your tail, because the number of such operations depends on what the total plan looks like, which depends on which operations are chosen, which depends on the cost estimates. The cost estimates are pretty squishy anyway, but they'd become a complete joke if we didn't know how much RAM each operation would be allowed ... regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html