Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DH-18364: Add Property to Disable Core DataIndex (#6539) #6561

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ public interface MemoizableOperation<T extends DynamicNode & NotificationStepRec
*/
static boolean USE_REDIRECTED_COLUMNS_FOR_SELECT =
Configuration.getInstance().getBooleanWithDefault("QueryTable.redirectSelect", false);

/**
* If set to true, then permit where filters to use a data index, when applicable. If false, data indexes are not
* used even if present.
*/
public static boolean USE_DATA_INDEX_FOR_WHERE =
Configuration.getInstance().getBooleanWithDefault("QueryTable.useDataIndexForWhere", true);

/**
* For a static select(), we would prefer to flatten the table to avoid using memory unnecessarily (because the data
* may be spread out across many blocks depending on the input RowSet). However, the select() can become slower
Expand Down Expand Up @@ -1174,7 +1182,7 @@ public Table where(Filter filter) {
}

private void initializeAndPrioritizeFilters(@NotNull final WhereFilter... filters) {
final DataIndexer dataIndexer = DataIndexer.existingOf(rowSet);
final DataIndexer dataIndexer = USE_DATA_INDEX_FOR_WHERE ? DataIndexer.existingOf(rowSet) : null;
final int numFilters = filters.length;
final BitSet priorityFilterIndexes = new BitSet(numFilters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import io.deephaven.engine.table.Table;
import io.deephaven.engine.table.TableDefinition;
import io.deephaven.engine.table.impl.QueryCompilerRequestProcessor;
import io.deephaven.engine.table.impl.QueryTable;
import io.deephaven.engine.table.impl.lang.QueryLanguageFunctionUtils;
import io.deephaven.engine.table.impl.preview.DisplayWrapper;
import io.deephaven.engine.table.impl.DependencyStreamProvider;
Expand Down Expand Up @@ -248,6 +249,10 @@ public SafeCloseable beginOperation(@NotNull final Table sourceTable) {
if (initialDependenciesGathered || dataIndex != null) {
throw new IllegalStateException("Inputs already initialized, use copy() instead of re-using a WhereFilter");
}
if (!QueryTable.USE_DATA_INDEX_FOR_WHERE) {
return () -> {
};
}
try (final SafeCloseable ignored = sourceTable.isRefreshing() ? LivenessScopeStack.open() : null) {
dataIndex = DataIndexer.getDataIndex(sourceTable, columnName);
if (dataIndex != null && dataIndex.isRefreshing()) {
Expand Down
Loading