Efficient deletion of AO/CO files.
Previous algorithm scans entire directory to find specific relfilenode
extensions to be deleted. This is not optimal for large directory sizes. This
patch introduces extra logic based on the table extension pattern which helps
to avoid directory scan.
Algorithm is coded based on assumption that for CO tables a given concurrency
level either all columns have the file or none as well as the following file
table extension pattern:
Heap Tables: contiguous extensions, no upper bound
AO Tables: non contiguous extensions [.0 - .127]
CO Tables: non contiguous extensions
[ .0 - .127] for first column
[.128 - .255] for second column
[.256 - .283] for third column
etc
AO file format can be treated as a special case of CO tables with 1 column.
High level logic:
1) Finds for which concurrency levels the table has files. This is
calculated based off the first column. It performs 127
(MAX_AOREL_CONCURRENCY) unlink().
2) Iterates over the single column and deletes all concurrency level files.
For AO tables this will exit fast.
This algorithm can be used for heap tables as well, however to prevent merge
conflicts it currently is only used for CO/AO tables.
Co-authored-by: NDavid Kimura <dkimura@pivotal.io>
Showing
想要评论请 注册 或 登录