This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,899 Users
  • 2,269,649 Discussions
  • 7,916,821 Comments

Discussions

Performance when using default null implicitly and explicitly.

User_Q0LCC
User_Q0LCC Member Posts: 1 Green Ribbon

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?