Not the answer you need?
Register and ask your own question!

Deleting data and the undo log

kerozebokerozebo EntrantInactive User Role Participant
Does "drop table" use the undo log (rollback segment) to temporarily store records to be purged later, the way "delete from table" does?


  • gmousegmouse Mod Squad Inactive User Role Leader
    Drop table cannot be undone, so I expect the answer to be negative.
  • xaprbxaprb Mentor Inactive User Role Leader
    I don't think it does, but I am not sure.
  • sterin71sterin71 Advisor Inactive User Role Mentor
    Dito! :)

    Since drop table is a DDL statement that:
    1. can't be part of a transaction and
    2. can't be undone

    I would say it's highly unlikely that it uses the undo log for anything.

    There are some interesting reading in the manual for the related statement TRUNCATE TABLE (which basically is like a DROP TABLE; CREATE TABLE combination) and hence is not related to normal DML statements that can be part of a transaction and in need of the undo log.
  • xaprbxaprb Mentor Inactive User Role Leader
    Inside InnoDB, absolutely everything is fully ACID. The non-transactinoality of DROP and other DDL is due to the MySQL layer outside of InnoDB.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.