You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "jiaqizho (via GitHub)" <gi...@apache.org> on 2025/10/10 11:30:53 UTC
Re: [PR] Enhancement: Optimize Pax table insertion performance [cloudberry]
jiaqizho commented on code in PR #1364:
URL: https://github.com/apache/cloudberry/pull/1364#discussion_r2419586060
##########
contrib/pax_storage/src/cpp/storage/pax.cc:
##########
@@ -280,14 +282,19 @@ void TableWriter::Open() {
// insert tuple into the aux table before inserting any tuples.
cbdb::InsertMicroPartitionPlaceHolder(RelationGetRelid(relation_),
current_blockno_);
+ cur_physical_size_ = 0;
}
void TableWriter::WriteTuple(TupleTableSlot *slot) {
Assert(writer_);
Assert(strategy_);
- // should check split strategy before write tuple
- // otherwise, may got a empty file in the disk
- if (strategy_->ShouldSplit(writer_->PhysicalSize(), num_tuples_)) {
+ // Sampled split check to reduce PhysicalSize() overhead
+ // We first perform a sampled pre-write check to avoid empty files.
+ if ((num_tuples_ % PAX_SPLIT_CHECK_INTERVAL) == 0) {
Review Comment:
should be?
```
if ((num_tuples_ % PAX_SPLIT_CHECK_INTERVAL) == 0) {
cur_physical_size_ = writer_->PhysicalSize();
if (strategy_->ShouldSplit(cur_physical_size_, num_tuples_)) {
...
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org