Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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
123 views