Skip to content

Commit

Permalink
Minor optimization for single-row partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
thobbs committed Nov 4, 2015
1 parent 9938b0a commit 4e89a92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/java/org/apache/cassandra/db/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,10 @@ public Collection<Mutation> createMutations(AbstractBTreePartition partition, Te
Collection<Mutation> mutations = null;
for (TemporalRow temporalRow : rowSet)
{
if (!selectQuery.selectsClustering(partition.partitionKey(), temporalRow.baseClustering()))
// In updateAffectsView, we check the partition to see if there is at least one row that matches the
// filters and is live. If there is more than one row in the partition, we need to re-check each one
// invididually.
if (partition.rowCount() != 1 && !selectQuery.selectsClustering(partition.partitionKey(), temporalRow.baseClustering()))
continue;

// If we are building, there is no need to check for partition tombstones; those values will not be present
Expand Down

0 comments on commit 4e89a92

Please sign in to comment.