In Greenplum, what is the best practice to delete all rows from a table? DELETE FROM TABLE or TRUNCATE TABLE? I dont have any child tables or foreign key constraints.
How to delete all rows in a Greenplum row oriented table
deletedisk-spacegreenplum
Related Question
- How bad is it to delete from a Greenplum AO table
- Greenplum : Inserting non-duplicate rows on unique constraint violation
- Mysql – Delete all row from all table from MYSQL DB with some ID clause
- SQLite – Multiple Foreign Keys with Cascade Delete
- SQL Server – How to Delete Rows from Relational Database
- Postgresql – Delete rows on a table with cascading foreign keys
Best Answer
Since Greenplum uses the Postgres database engine, reasoning applicable to a Postgres database seems appropriate. I don't see any reason not to use
TRUNCATE
when deleting all rows in a table with no children or foreign keys (which is your case), unless you have theON DELETE
triggers that you want to fire.