Skip to content

Commit

Permalink
feat: Disable period type analytics table indexing (#17715)
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge authored Jun 5, 2024
1 parent 8b6332e commit 29217dd
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ protected List<AnalyticsTableColumn> getPeriodTypeColumns(String prefix) {
.name(name)
.dataType(TEXT)
.selectExpression(prefix + "." + quote(name))
.skipIndex(skipIndex(name))
.build();
})
.toList();
Expand Down Expand Up @@ -626,8 +627,19 @@ protected List<AnalyticsTableColumn> getAttributeCategoryColumns() {
* @return {@link Skip#SKIP} if index should be skipped, {@link Skip#INCLUDE} otherwise.
*/
protected Skip skipIndex(DimensionalObject dimension) {
return skipIndex(dimension.getUid());
}

/**
* Indicates whether indexing should be skipped for the given dimensional identifier based on the
* system configuration.
*
* @param dimension the dimension identifier.
* @return {@link Skip#SKIP} if index should be skipped, {@link Skip#INCLUDE} otherwise.
*/
protected Skip skipIndex(String dimension) {
Set<String> dimensions = analyticsTableSettings.getSkipIndexDimensions();
return dimensions.contains(dimension.getUid()) ? Skip.SKIP : Skip.INCLUDE;
return dimensions.contains(dimension) ? Skip.SKIP : Skip.INCLUDE;
}

/**
Expand Down

0 comments on commit 29217dd

Please sign in to comment.