Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Mark Kirkwood
I don't know if this provides any more info than you already have - but is my last few lines from a single process backend run with valgrind : ==19666== Syscall param write(buf) contains uninitialised or unaddressable byte(s) ==19666==at 0x404D94F8: __GI___libc_write (in /lib/libc-2.3.2.so) ==

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Gavin Sherry
I'm rewriting the patch so don't worry :-) Thanks, Gavin On Mon, 21 Jun 2004, Mark Kirkwood wrote: > I don't know if this provides any more info than you already have - > but is my last few lines from a single process backend run with valgrind : > > ==19666== Syscall param write(buf) contains u

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > On Mon, 21 Jun 2004, Tatsuo Ishii wrote: >> First of all I would like to ask you if you intend to leave indexes in >> the old tables space or not. > Yes, that is intentional. There's a related issue: what about the table's TOAST table (if any) and the in

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > On Sun, 20 Jun 2004, Tom Lane wrote: >> Maybe you have to dump each block into WAL as you copy it. >> That would be kinda ugly ... though in point of fact less of a WAL load >> than writing individual tuples ... > Should I use the WAL-enabled case of _bt

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Gavin Sherry
On Mon, 21 Jun 2004, Tom Lane wrote: > Gavin Sherry <[EMAIL PROTECTED]> writes: > > On Sun, 20 Jun 2004, Tom Lane wrote: > >> Maybe you have to dump each block into WAL as you copy it. > >> That would be kinda ugly ... though in point of fact less of a WAL load > >> than writing individual tuples

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Gavin Sherry
On Sun, 20 Jun 2004, Tom Lane wrote: > Gavin Sherry <[EMAIL PROTECTED]> writes: > > But I did implement it as a tuple at a time thing. I reused the code from > > rebuild_relation()... > > > What did you have in mind? > > Something about like > > for (b = 0; b < RelationGetNumberOfBlocks(src)

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > But I did implement it as a tuple at a time thing. I reused the code from > rebuild_relation()... > What did you have in mind? Something about like for (b = 0; b < RelationGetNumberOfBlocks(src); b++) { smgrread(src, b, b

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Gavin Sherry
On Sun, 20 Jun 2004, Tom Lane wrote: > Gavin Sherry <[EMAIL PROTECTED]> writes: > > On Mon, 21 Jun 2004, Tatsuo Ishii wrote: > >> Also I think we need to enhance ALTER INDEX to assign new table spaces > >> for indexes. Assigning different tables spaces for tables and indexes > >> are essential to

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: > On Mon, 21 Jun 2004, Tatsuo Ishii wrote: >> Also I think we need to enhance ALTER INDEX to assign new table spaces >> for indexes. Assigning different tables spaces for tables and indexes >> are essential to gain more I/O speed IMO. > I thought about this

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Scott Marlowe
On Sun, 2004-06-20 at 17:15, Tatsuo Ishii wrote: > > > Also I think we need to enhance ALTER INDEX to assign new table spaces > > > for indexes. Assigning different tables spaces for tables and indexes > > > are essential to gain more I/O speed IMO. > > > > I thought about this. ALTER INDEX doesn'

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tatsuo Ishii
> > Also I think we need to enhance ALTER INDEX to assign new table spaces > > for indexes. Assigning different tables spaces for tables and indexes > > are essential to gain more I/O speed IMO. > > I thought about this. ALTER INDEX doesn't exist yet and I figured that, > unlike the case of tables

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tatsuo Ishii
> On Sun, 20 Jun 2004, Tatsuo Ishii wrote: > > > > > Attached is a patch implementing this functionality. > > > > > > > > I've modified make_new_heap() as well as swap_relfilenodes() to not assume > > > > that tablespaces remain the same from old to new heap. I thought it better > > > > to go down

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Gavin Sherry
On Mon, 21 Jun 2004, Tatsuo Ishii wrote: > > On Sun, 20 Jun 2004, Tatsuo Ishii wrote: > > > > > > > Attached is a patch implementing this functionality. > > > > > > > > > > I've modified make_new_heap() as well as swap_relfilenodes() to not assume > > > > > that tablespaces remain the same from ol

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Gavin Sherry
On Sun, 20 Jun 2004, Tatsuo Ishii wrote: > > > Attached is a patch implementing this functionality. > > > > > > I've modified make_new_heap() as well as swap_relfilenodes() to not assume > > > that tablespaces remain the same from old to new heap. I thought it better > > > to go down this road tha

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tatsuo Ishii
> > Attached is a patch implementing this functionality. > > > > I've modified make_new_heap() as well as swap_relfilenodes() to not assume > > that tablespaces remain the same from old to new heap. I thought it better > > to go down this road than introduce a lot of duplicate code. > > I have tr

Re: [HACKERS] [PATCHES] ALTER TABLE ... SET TABLESPACE

2004-06-20 Thread Tatsuo Ishii
> Attached is a patch implementing this functionality. > > I've modified make_new_heap() as well as swap_relfilenodes() to not assume > that tablespaces remain the same from old to new heap. I thought it better > to go down this road than introduce a lot of duplicate code. I have tried your patch