If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Creating and populating a field on table with 720 million data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-22-05, 04:23
jisc jisc is offline
Registered User
 
Join Date: Jan 2003
Location: Nomad
Posts: 3
Creating and populating a field on table with 720 million data

Hi, peeps, I hope this problem is usual and have been encountered by many. basically, what i need to do is create a new unique field in a large table with 720 million records. Basically this is the direct approach.

Quote:
create new table temptable sameas mytab + new serial field;

insert into temptable
select 0, mytab.* from mytab order by insert_datetime;

alter table temptable modify (serial_field decimal(14,0));

drop table mytab;

rename table temptable to mytab;
this is what i'm thinking to do, but then again, with 720 million data, that will run for days or maybe run out of memory, especially that order by clause is in there. so can you guys suggest a diff. and better approach? a way to cut the time this migration will run? thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On