[
https://issues.apache.org/jira/browse/CASSANDRA-21288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dmitry Konstantinov updated CASSANDRA-21288:
--------------------------------------------
Description:
!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 in
we can skip the iteration by checking
row.hasDeletion(ReadCommand.this.nowInSec()) first
was:
!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}
we can skip the iteration by checking
row.hasDeletion(ReadCommand.this.nowInSec()) first
> 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
> Attachments: 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 in
> 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]