compaer LOAD and ALTER... ATTACH
Posted in 2006
Topics: Storage & Space Management
HI, I am using IDS9.4 and attaching a fragment to a fragmented table. The table has two indexes are fragmented by default. I found, (1) ALTER FRAGMENT ON table ATTACH... is very resource consuming, slow and failed (complained : No More Space). I also found it wrote and read many unrelated db spaces where the loaded data will not go. Since the data I was attaching is only fit to ONE dbspace(fragment), NOT the others. (2) LOAD FROM file INSERT ... worked well and finished the job quickly. I also watched that it only accessed the dbspace where the data should go( I expected) , NOT bothered other unrelated dbspaces. So, sounds the conclusion is LOAD is much better than ALTER.. ATTACH.. Is this true? why? I was thinking I should ALTER..ATTACH instead of LOAD statement for attaching a table to a fragmented table. Thanks for your info Frank -- Yunyao "Frank" Qu Computer Sciences Corporation(CSC) NOAA/CLASS, (301)817-4696
IFF you can give the table you are attaching it's own fragment such that the
resulting fragmentation schema will maintain the rows in the original partition
(ie adding a new 'IN' clause specific to the rows in the new partition) will
the
ALTER FRAGMENT be fast and use minimal resources. You will still need logicallog space for a full copy of the consumed table if the database and tables are
logged. Even so, it is faster if you can turn off logging for the database or
at least for the two tables < ALTER TABLE mytab TYPE (RAW); > for the duration
of the joining. This should be done only after a level 0 archive is taken for
maximum safety.
If the overall fragmentation scheme is changing or if there are rows in the new
partition that belong in other partitions/fragments then the operation will
neccessarily be slow as the engine must verify each row.
Art S. Kagel
----- Original Message -----
From: Yunyao (Fra.... <ids@iiug.org>
At: 5/26 11:48:30
HI,
I am using IDS9.4 and attaching a fragment to a fragmented table. The
table has two indexes are fragmented by default.
I found,
(1) ALTER FRAGMENT ON table ATTACH... is very resource consuming, slow
and failed (complained : No More Space). I also found it wrote and read
many unrelated db spaces where the loaded data will not go. Since the
data I was attaching is only fit to ONE dbspace(fragment), NOT the others.
(2) LOAD FROM file INSERT ... worked well and finished the job quickly.
I also watched that it only accessed the dbspace where the data should
go( I expected) , NOT bothered other unrelated dbspaces.
So, sounds the conclusion is LOAD is much better than ALTER.. ATTACH..
Is this true? why?
I was thinking I should ALTER..ATTACH instead of LOAD statement for
attaching a table to a fragmented table.
Thanks for your info
Frank
--
Yunyao "Frank" Qu
Computer Sciences Corporation(CSC)
NOAA/CLASS, (301)817-4696
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.