Differences between truncate, drop, and delete

Source: Internet
Author: User
Differences among truncate, drop, and delete: 1. truncate and drop belong to DDL (DataDefinitionLanguage Data Definition Language). delete belongs to DML (DataManipulationLanguage data operation language) 2. From the perspective of table structure, truncate and delete only delete data, but do not delete the table structure drop delete data and table knot

Differences between truncate, drop, and delete 1. From the classification perspective, truncate and drop belong to DDL (Data Definition Language). delete belongs to DML (Data Manipulation Language Data operation Language) 2. From the perspective of table structure, truncate and delete only delete data, but do not delete the table structure drop delete data and table knot

Differences between truncate, drop, and delete

1. From the classification perspective

Truncate and drop are DDL (Data Definition Language)

Delete belongs to DML (Data Manipulation Language)

2. From the perspective of Table Structure

Truncate and delete only delete data, not delete table structure

Drop delete data and Table Structure

3. Security

Truncate and drop do not support rollback

Delete supported

4. Speed ()

The drop table Employees and truncate table Employees query overhead is 0%

The query overhead of delete from Employees is 95%.

Delete from Employees where dep_id = 3 the query overhead is 5%

From the perspective of execution plan query overhead, drop is equal to truncate, delete from tab where ...... Speed greater than delete from tab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.