Tablespace for temporary objects and sort files - Mailing list pgsql-patches

From Albert Cervera Areny
Subject Tablespace for temporary objects and sort files
Date
Msg-id 200610250045.48361.albertca@hotpop.com
Whole thread Raw
Responses Re: Tablespace for temporary objects and sort files  (Neil Conway <neilc@samurai.com>)
Re: Tablespace for temporary objects and sort files  ("Jaime Casanova" <systemguards@gmail.com>)
Re: Tablespace for temporary objects and sort files  ("Jaime Casanova" <systemguards@gmail.com>)
Re: Tablespace for temporary objects and sort files  (Albert Cervera Areny <albertca@hotpop.com>)
List pgsql-patches
Hi,

I'm trying to introduce myself into postgresql development and I'm working on
the "tablespace for temporary objects and sort files" TODO item. The attached
patch shows what I've already done. The GUC is currently
called "temp_tablespaces".

The tablespace changes correctly for me when creating temporary tables.  I've
got some questions though:

    How can I test that the tablespace is correctly used for sort files? Is there
an easy way? Or should I reduce work_mem to a minimum, populate the database
with data and try an "ORDER BY"?

    The GetTempTablespace function correctly returns a different tablespace each
time is called, but I store the position of the last tablespace used with an
integer and iterate through the list of tablespaces each time. I tried to
keep the iterator from call to call but I got a segfault, I imagine due to
the memory context. Should I try to keep the iterator? How can I do it?

Hope the diff and idents are ok. Please let me know if there's something wrong
with them.

Thanks!

Attachment

pgsql-patches by date:

Previous
From: Toru SHIMOGAKI
Date:
Subject: Re: [BUGS] BUG #2704: pg_class.relchecks overflow problem
Next
From: Neil Conway
Date:
Subject: Re: Tablespace for temporary objects and sort files