[Maria-discuss] Adding timestamp column to a system
Hi All Running Mariadb 10.0.16 and need to add a timestamp column to a table with has around 60m rows Testing on lesser hardware instances suggest around 40 minutes to make this change on the production system. To reduce the down time I was planning to alter the slave and role swap the slave to become the master I have added the column to a test slave and notice it alway populates as Unix_epoch 0 ie no current timestamp date | timestamp 2016-01-29 | 0000-00-00 00:00:00 This sounds about right, but to confirm it's not a bug. Other than the timestamp value not being correct up to that time of making any changes, which is acceptable for why it is being added, like the role swap, is there any things to be concerned about if I follow that as an approach? The role swap was needing to be done soon anyway so that in itself isn't a stumpling block I know Percona has their tools that allow online schema changes, I have never used it in anger to achieve this sort of change. Would I be better off using that. Cheers -- *Peter McLarty* * DBA* -- Compare The Market is a brand and trading name of Compare The Market (Pty) Ltd (CTM). This email is for the intended addressee and is confidential and subject to copyright. If you are not the intended addressee, confidentiality has not been waived and any use, interference with, or disclosure of this email is unauthorised. If you are not the intended addressee please immediately notify CTM and then delete the email. CTM does not warrant that this email is error or virus free.
Hi, Peter! On Jan 29, Peter Mclarty wrote:
Hi All Running Mariadb 10.0.16 and need to add a timestamp column to a table with has around 60m rows
Testing on lesser hardware instances suggest around 40 minutes to make this change on the production system.
To reduce the down time I was planning to alter the slave and role swap the slave to become the master
I have added the column to a test slave and notice it alway populates as Unix_epoch 0 ie no current timestamp date | timestamp 2016-01-29 | 0000-00-00 00:00:00
This sounds about right, but to confirm it's not a bug.
Depends on what you want. If you do ALTER TABLE ... ADD COLUMN x TIMESTAMP DEFALT CURRENT_TIMESTAMP you'll get current timestamp; Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (2)
-
Peter Mclarty
-
Sergei Golubchik