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

Re: Tablespace for temporary objects and sort files

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Albert Cervera Areny" <albertca(at)hotpop(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Tablespace for temporary objects and sort files
Date: 2006-10-25 11:07:25
Message-ID: c2d9e70e0610250407y1a7d10cdmde17d74e9d491c31@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-patches
On 10/24/06, Albert Cervera Areny <albertca(at)hotpop(dot)com> wrote:
> 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.

some comments from a non-hacker:

your patch isn't doing nothing at all for temporary indexes... a quick
search for GetDefaultTablespace() shows this places...

postgres(at)casanova:~/PG_RELEASES/pgsql$ grep -lR GetDefaultTablespace *
src/backend/commands/indexcmds.c
src/backend/commands/tablecmds.c
src/backend/commands/tablespace.c
src/backend/executor/execMain.c
src/include/commands/tablespace.h


Now a question, why not using the same GetDefaultTablespace() with an
argument indicating if the object is temporary, if it is get the
default tablespace for temp objects else get the default tablespace
for permanent object... just an idea...

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

yes, that seems to work... i reduce, just in case, work_mem,
shared_buffers and temp_buffers...

Now, PG_TEMP_FILES_DIR seems to add just pgsql_temp to the filename. i
think you the function you have to modify here is
make_database_relative() that adds base/#database_oid# at the
beginning of the path of the file.

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

diff -c is the way

-- 
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

In response to

Responses

pgsql-patches by date

Next:From: Magnus HaganderDate: 2006-10-25 14:50:05
Subject: Re: BUG #2712: could not fsync segment: Permission
Previous:From: Neil ConwayDate: 2006-10-25 07:07:35
Subject: Re: Tablespace for temporary objects and sort files

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