[ 
https://issues.apache.org/jira/browse/CASSANDRA-21288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18071491#comment-18071491
 ] 

Dmitry Konstantinov commented on CASSANDRA-21288:
-------------------------------------------------

plus this iterator too is allocated in the same logic, so + 1.82%
 !LeafBTreeSearchIterator_metricRecording.png|width=700! 

> Avoid Cell iterator for alive rows in withMetricsRecording transformation of 
> ReadCommand
> ----------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-21288
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-21288
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Local/Other
>            Reporter: Dmitry Konstantinov
>            Assignee: Dmitry Konstantinov
>            Priority: Normal
>             Fix For: 6.x
>
>         Attachments: LeafBTreeSearchIterator_metricRecording.png, 
> image-2026-04-06-17-38-09-839.png
>
>
>  !image-2026-04-06-17-38-09-839.png|width=600! 
> for every selected row we iterate over cells to check if they have have any 
> tombstones:
> {code}
> @Override
>             public Row applyToRow(Row row)
>             {
>                 boolean hasTombstones = false;
>                 for (Cell<?> cell : row.cells())
>                 {
>                     if (!cell.isLive(ReadCommand.this.nowInSec()))
>                     {
>                         countTombstone(row.clustering());
>                         hasTombstones = true; // allows to avoid counting an 
> extra tombstone if the whole row expired
>                     }
>                 }
> {code}
> the logic allocates org.apache.cassandra.db.rows.BTreeRow$CellIterator, with 
> 2% of total allocations for the test shared in CASSANDRA-21285
> we can skip the iteration by checking 
> row.hasDeletion(ReadCommand.this.nowInSec()) first



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to