Skip to content

Commit

Permalink
CNDB-12308: Remove index-based sorting at CQL level
Browse files Browse the repository at this point in the history
Do all coordinator-side sorting for index queries in StorageAttachedIndexQueryPlan#postProcessor.
  • Loading branch information
adelapena committed Jan 9, 2025
1 parent db6f08f commit efcc375
Show file tree
Hide file tree
Showing 19 changed files with 357 additions and 493 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,6 @@ public final boolean hasSupportingIndex(IndexRegistry indexRegistry)
return false;
}

@Override
public final Index findSupportingIndex(IndexRegistry indexRegistry)
{
for (Index index : indexRegistry.listIndexes())
if (isSupportingIndex(index))
return index;
return null;
}

@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ public default boolean isOnToken()
*/
public boolean hasSupportingIndex(IndexRegistry indexRegistry);

/**
* Find first supporting index for current restriction
*
* @param indexRegistry the index registry
* @return <code>index</code> if the restriction is on indexed columns, <code>null</code>
*/
public Index findSupportingIndex(IndexRegistry indexRegistry);

/**
* Returns whether this restriction would need filtering if the specified index group were used.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ public boolean hasSupportingIndex(IndexRegistry indexRegistry)
return false;
}

@Override
public Index findSupportingIndex(IndexRegistry indexRegistry)
{
return null;
}

@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down Expand Up @@ -283,18 +277,6 @@ public boolean hasSupportingIndex(IndexRegistry indexRegistry)
return false;
}

@Override
public Index findSupportingIndex(IndexRegistry indexRegistry)
{
for (SingleRestriction restriction : restrictionsMap.values())
{
Index index = restriction.findSupportingIndex(indexRegistry);
if (index != null)
return index;
}
return null;
}

@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ public boolean hasSupportingIndex(IndexRegistry indexRegistry)
return restrictions.hasSupportingIndex(indexRegistry);
}

@Override
public Index findSupportingIndex(IndexRegistry indexRegistry)
{
return restrictions.findSupportingIndex(indexRegistry);
}

@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ public boolean hasSupportingIndex(IndexRegistry indexRegistry)
return false;
}

@Override
public Index findSupportingIndex(IndexRegistry indexRegistry)
{
for (Index index : indexRegistry.listIndexes())
if (isSupportedBy(index))
return index;

return null;
}

@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,6 @@ public boolean hasSupportingIndex(IndexRegistry indexRegistry)
return restrictions.hasSupportingIndex(indexRegistry);
}

@Override
public Index findSupportingIndex(IndexRegistry indexRegistry)
{
return restrictions.findSupportingIndex(indexRegistry);
}

@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ public boolean hasSupportingIndex(IndexRegistry indexRegistry)
return false;
}

@Override
public Index findSupportingIndex(IndexRegistry indexRegistry)
{
return null;
}
@Override
public boolean needsFiltering(Index.Group indexGroup)
{
Expand Down
Loading

0 comments on commit efcc375

Please sign in to comment.