Skip site navigation (1) Skip section navigation (2)

Re: Tablespace for temporary objects and sort files

From: Albert Cervera Areny <albertca(at)hotpop(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Tablespace for temporary objects and sort files
Date: 2006-12-28 02:11:59
Message-ID: 200612280311.59274.albertca@hotpop.com (view raw or flat)
Thread:
Lists: pgsql-patches
Hi,
	here's a new version of the patch against HEAD with both, table and sort 
files working correctly for me. Regression tests work too.
	I'd like to ask again the question I made on the first post as no answer was 
given at that time:

"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?"

	Now I'm working on some regression tests that could be added to 
tablespace.source using something like:

SET temp_tablespaces='testspace';

CREATE TEMP TABLE temp_foo(a VARCHAR);

SELECT COUNT(pg_ls_dir('pg_tblspc/' || (SELECT oid FROM 
pg_catalog.pg_tablespace WHERE spcname='testspace' .... ) 

	Do you think it's a good idea to list the files in the directory of the 
tablespace to ensure temporary table files are created where they should? Do 
you think there is a smart way to ensure the same with sort files?

	Any feedback welcome!


A Dimecres 25 Octubre 2006 00:45, Albert Cervera Areny va escriure:
> 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: temp_tablespaces.diff
Description: text/x-diff (13.0 KB)

In response to

Responses

pgsql-patches by date

Next:From: ITAGAKI TakahiroDate: 2006-12-28 06:14:56
Subject: Dead Space Map patch
Previous:From: Bruce MomjianDate: 2006-12-28 01:45:33
Subject: Re: [BUGS] BUG #2846: inconsistent and confusing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group