Re: [PATCHES] Tablespace for temporary objects and sort files

2006-10-25 Thread Neil Conway
On Wed, 2006-10-25 at 00:45 +0200, Albert Cervera Areny wrote:
 Hope the diff and idents are ok.

Patches should be submitted in context diff (diff -c) format.

-Neil



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [PATCHES] Tablespace for temporary objects and sort files

2006-10-25 Thread Jaime Casanova

On 10/24/06, Albert Cervera Areny [EMAIL PROTECTED] 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...

[EMAIL PROTECTED]:~/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

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly