Re: Copy large amount of data from non-normalized to normalized table

2006-06-06 Thread Jeremy Cole
Hi Rob, So each of the old rows splits into 30 new rows. Really 180 rows, right? The existing table has about 85000 rows, equating to over 15 million in the new structure. Ways I have tried end up creating massive queries or just hogging the server for absolutely ages - what is the best wa

Re: Copy large amount of data from non-normalized to normalized table

2006-06-06 Thread René Seindal
Rob Desbois wrote (06-06-2006 15:22): Rob, to clarify, your new 'index' column will be based on the value of the 'part' column and individual column names from the old table? That is correct. Perhaps something like this, where [colnum] is derived from column name like p1? (part+1)*[colnum] T

Re: Copy large amount of data from non-normalized to normalized table

2006-06-06 Thread Dan Buettner
There may be a technique for that in SQL, but I sure don't know it. I'd likely approach this problem with an external language like perl. You'll still end up processing about 15 million inserts, so it'll take a while, but it shouldn't actually end up being all that rough on your database server

re[2]: Copy large amount of data from non-normalized to normalized table

2006-06-06 Thread Rob Desbois
> Rob, to clarify, your new 'index' column will be based on the value of > the 'part' column and individual column names from the old table? That is correct. > Perhaps something like this, where [colnum] is derived from column name > like p1? (part+1)*[colnum] The actual formula I want to use i

Re: Copy large amount of data from non-normalized to normalized table

2006-06-06 Thread Dan Buettner
Rob, to clarify, your new 'index' column will be based on the value of the 'part' column and individual column names from the old table? Perhaps something like this, where [colnum] is derived from column name like p1? (part+1)*[colnum] Dan Rob Desbois wrote: I need to upgrade a MyISAM DB

Copy large amount of data from non-normalized to normalized table

2006-06-06 Thread Rob Desbois
I need to upgrade a MyISAM DB, one of the tables has the structure: CREATE TABLE old_event_data ( event_id MEDIUMINT UNSIGNED NOT NULL, p1 UNSIGNED INT NOT NULL, ... p30 UNSIGNED INT NOT NULL, part UNSIGNED TINYINT(1) NOT NULL ); This is 'event data', each event having 6 entries wit