sql - Truncate partition based on condition -
i need truncate partition in greenplum based on condition. easiest possible way achieve that?
example:
alter table package_info truncate partition ('box');
i need truncate partition value - box in table package_info particular condition. few package_ids.
some thing like, truncate partition containing package_type data package_id - 100,200,300. not inclined towards delete because if use delete, won't able compress table.
thanks.
in gpdb 4.3.x can delete ao , compressed table. should upgrade 4.2.x eol in 2 months , no longer have support
truncate command in databases used drop whole table/partition without validation , data scan, why fast. in gpdb alters pg_class different relfilenode , deletes table file underlying filesystem. there no option partially truncate table data
if still on 4.2.x have more smart. 1 option recreate partition without data. second option have separate "visibility map" table contain list of deleted package_ids, each time query table have join table remove "deleted" records
Comments
Post a Comment