Re: [WIP] GUC for temp_tablespaces

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, "Bruce Momjian" <bruce(at)momjian(dot)us>
Subject: Re: [WIP] GUC for temp_tablespaces
Date: 2007-05-10 05:13:50
Message-ID: c2d9e70e0705092213t6d266bafp7062bebed1c7adc5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On 5/9/07, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Am Mittwoch, 9. Mai 2007 02:21 schrieb Jaime Casanova:
> > > What I have been missing all along in these patches is an explanation for
> > > what it means to list multiple temporary tablespaces. Are they used in
> > > order, or the first one that exists, or what?
> >
> > http://archives.postgresql.org/pgsql-hackers/2007-01/msg00531.php
> > http://archives.postgresql.org/pgsql-patches/2007-01/msg00282.php
>
> Those are discussions of possible ideas, not an acceptable documentation of
> this feature.
>

ahh... ok, obviously a misunderstood you... what you were asking for
is user visible documentation, isn't it?

what the patch does is to select the first tablespace from the list
pseudo-randomicaly (MyProcPid % num_temp_tablespaces) and then cycle
in order through the list every time we call GetTempTablespace().
Every backend will start (hopefully) in a different tablespace and
will keep its own iterator for the list.
A BufFile will use the same tablespace for every file it has.
If we can't create the file in the selected tablespace we fall into
$PGDATA/base/pgsql_tmp, now that i think on it we should be sending a
warning that the file couldn't be created.

About the docs, what about something along the lines, in config.sgml:
"The first tablespace that will be used is choosen randomly from the
list, starting from that with cycle through the list in order.

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

Attachment Content-Type Size
temp_tablespaces-1.2.6.diff text/plain 28.6 KB

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Michael Meskes 2007-05-10 10:00:44 Re: ECPG patch to use prepare for improved performance
Previous Message CK Tan 2007-05-10 03:49:26 Patch for seq scan & scan resistant bufmgr