Need to migrate large amount of data from default #666
Replies: 1 comment 9 replies
-
I'm moving this to a Discussion since it's not really reporting a bug, but trying to plan out a method to move a lot of data in the default. So The only locks that will happen will be on the rows that are being moved in that transaction. There is no aoviding this because the rows are being moved between tables. Old transactions before the rows are moved may not be blocked, but new transactions trying to see those rows may be blocked. The other lock that will occur is when a new child table is added. This is a lighter weight lock and generally doesn't block most transactions, however it may do that here a little more frequently since you're creating child partitions that may contain data that users are trying to access. These locks will only last the length of a single transactional commit of If you're able to uniherit the default table, turn it into a new partitioned table on its own and then run Hope that makes sense. If you have any other questions, let me know. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have an issue where I have a table that has been partitioned, however, auto partitioning was not setup and the latest partition was from 2023w09. This has resulted in all the data since then going into the default partition. I am now trying to setup auto partitioning again. I want to keep the data in default and also want to prevent the database from going offline if possible. I know that we could try running
partition_data_proc
, but the default partition has around 2.5 TB of data and over 1 billion rows. I'm concerned about the length of timepartition_data_proc
will take to move the data from default, especially if there are reads and writes to the table at the same time. I have also considered moving the data out of default, fixing the partitions and then moving the data back into the correct partitions, or just creating a new database entirely with partitioning setup correctly. Is there a way to runpartition_data_proc
orcreate_patition_time
asynchronously that won't lock the table? I'm wondering what is the best solution here. Thanks!Beta Was this translation helpful? Give feedback.
All reactions