rfc: TRUNCATE TABLE in Firebird

Vlad Khorsun posted on Firebird-Architect

One of the often task in ETL applications is to quick erase all data in some table(s). Often amount of data is big or huge (tens of millions records). In Firebird we have two choices currently – DELETE all rows or RECREATE TABLE. Both have its own drawbacks. DELETE produced a lot of record versions to clean up, its slow as works row-by-row basis and fire triggers which is almost always is not needed. RECREATE is free from this drawbacks but it will fail if there is dependencies and all related objects such as triggers, indices, constraints must be recreated too.