Tuning Question sort_mem vs pgsql_tmp - Mailing list pgsql-general

From Greg Stark
Subject Tuning Question sort_mem vs pgsql_tmp
Date
Msg-id 87u1fk6low.fsf@stark.dyndns.tv
Whole thread Raw
Responses Re: Tuning Question sort_mem vs pgsql_tmp
List pgsql-general
Is pgsql_tmp.* used for anything other than sorts? The only thing I see in a
quick review of the sources is hash joins but that shouldn't be relevant.

I've raised sort_mem to 49152 (1k blocks as I understand it) Yet pgsql_tmp
files are still being created. They range in size from 7M up to 34M. I don't
understand why posgres would need a 34M temporary sort space if it has 48M of
sort memory available. The results weren't much different before I raised
sort_mem.

The query being run is of the form INSERT INTO () (SELECT DISTINCT ON...)
Does the insert have the accumulate temporary data somewhere?

Does sort_mem have to be larger than the corresponding pgsql_tmp area that
would be used if postgres runs out of sort_mem?

--
greg

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Q: explain on delete
Next
From: Tom Lane
Date:
Subject: Re: Tuning Question sort_mem vs pgsql_tmp