Chat to a naked teenage girl - Updating mysql table


Updating mysql table

This is a "batch" process here, to update millions of records.

We need to replace the main ID for all entries in the database which is the PK in about 100 tables, largest of them have about 2 mln rows.

When done, we swap the partition of original data with the 'dummy' table (the one containing new values), rebuild indexes in parallel, and wha-la! i.e, to update field2 in a table:1) First create your dummy hold table: create table xyz_HOLD as select * from xyz where rownum Hi Tom, As u suggested us to create a new table ,then drop the original table and rename the new table to original table instead of updating a table with millions of records.

But what happen to dependent objects ,everything will get invalidated. We've a similar situation., We delete around 3 million records from 30 million rows table everyday.

If so -- sure, cause we could just drop partitions (fast) instead of deleting the data. We also have an absolutely incredible stored procedure that rebuilds all of our indexes concurrently after the load, using the Oracle job scheduler as the mechanism of allowing separate threads in pl/sql.