Tuning Question sort_mem vs pgsql_tmp

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Tuning Question sort_mem vs pgsql_tmp
Date: 2003-02-04 16:43:27
Message-ID: 87u1fk6low.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-04 17:24:49 Re: Tuning Question sort_mem vs pgsql_tmp
Previous Message Tom Lane 2003-02-04 16:24:03 Re: Q: explain on delete