Skip to content

Truncate mviews before dropping#28

Closed
whit0694 wants to merge 1 commit intocdinger:mainfrom
whit0694:truncate
Closed

Truncate mviews before dropping#28
whit0694 wants to merge 1 commit intocdinger:mainfrom
whit0694:truncate

Conversation

@whit0694
Copy link
Contributor

Doing a drop on a large table can be quite slow as Oracle stuffs the whole thing in to its undo log.

A truncate removes all records w/o possibility of undo. It's quite fast. And then the subsequent drop is also fast.

Doing a drop on a large table can be quite slow as Oracle stuffs the
whole thing in to its undo log.

A truncate removes all records w/o possibility of undo. It's quite fast.
And then the subsequent drop is also fast.
@cdinger
Copy link
Owner

cdinger commented Jul 20, 2025

@whit0694 are you sure this is the case? The version 19 docs say that dropped materialized view aren't undoable and don't hit the recycle bin:

When you drop a materialized view, Oracle Database does not place it in the recycle bin. Therefore, you cannot subsequently either purge or undrop the materialized view.

I'm curious about what you're seeing. Do your materialized view have mview logs?

@whit0694
Copy link
Contributor Author

whit0694 commented Aug 8, 2025

Hmm. Let's skip it then!

@whit0694 whit0694 closed this Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants