Use the truncate TABLE statement to delete table data

Source: Internet
Author: User
Use the truncate TABLE statement to delete table data
To delete all records in a large table, run the truncate command to release
The data block tablespace used. This operation cannot be rolled back.
Syntax format:
Truncate table table_name
Table_name indicates the name of the table to be deleted. Because the truncate TABLE statement deletes a table
And cannot be recovered.
Use truncate table to delete all rows in the specified table.
Bundle and index remain unchanged. The truncate table function and does not contain the WHERE clause
The delete statement is the same. Both delete all rows in the table. However, truncate table execution speed
Faster than Delete.
The table referenced by the foreign key (foreign key) constraint cannot be deleted using the truncate table.
Instead of using the WHERE clause. In addition, truncate table
The table cannot be used to index the view.

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.