Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Performance when using default null implicitly and explicitly.

User_Q0LCCJul 27 2022 — edited Jul 28 2022

Is there any difference in performance when using
ALTER TABLE BIG_TABLE ADD(NEW_COLUMN)
and
ALTER TABLE BIG_TABLE ADD(NEW_COLUMN DEFAULT NULL)?
For my use case, I have a large table with approximately 300 million rows. Now providing a default does take a lock on the table and iterates over it. For a table my size I wish to do it as fast as possible to minimize the impact on my product and cannot be stopped temporarily for this update.
I do realize that the default is NULL when using ALTER TABLE if none is provided, and have no performance impact and the DB handles it without any issues.
But does adding it explicitly impact performance for large tables?

Comments
Post Details
Added on Jul 27 2022
0 comments
28 views