Hi I have huge table which is coming from network in chunks. Rows are not ordered so can be duplicates. I need to keep track of duplicates and preserve all rows so that in future I can return rows as and when it came. Is there any framework or algorithms that help me achive this task? I would like to do versioning for all the rows so that I can go back in time and get rows for particular time date etc.
Please guide. How should I approach? I am new to Database. I need to implement this in Java. Thanks in advance.
Add an extra column to the table...
input_order BIGINT NOT NULL DEFAULT AUTOINCREMENT,
Load the input data into the other columns, but let this column default by leaving it out of the column list being inserted. You can do this (leave a column out) when using either the INSERT or LOAD TABLE statements.
Then, input_order will be assigned the values 1, 2, 3 according to the order the rows were inserted.
This column WILL be unique, so you can make it the primary key if you want.
answered 22 Jul '13, 16:09