Skip to content
Snippets Groups Projects
Commit a4cbfdbe authored by Johannes Mey's avatar Johannes Mey
Browse files

keep index if no lookups AND no inserts occur. @kissinger is this a good idea?

parent 7838c686
No related branches found
No related tags found
No related merge requests found
......@@ -273,14 +273,14 @@ public class ERISConnector {
// get the new config
ERISLPConfiguration newDOrOConfig = currentDOrIConfigs.get(attribute);
ERISAttributeStatistics as = livingPartition.getAttributeStatistics(attribute);
ERISAttributeStatistics attributeStatistics = livingPartition.getAttributeStatistics(attribute);
logger.debug(" attribute {}:", attribute.getName());
logger.debug(" stats: lookups: {} inserts: {} scans: {} links: {} count: {}",
as.getLookups(),
as.getInserts(),
as.getScans(),
as.getLinks(),
as.getCount());
attributeStatistics.getLookups(),
attributeStatistics.getInserts(),
attributeStatistics.getScans(),
attributeStatistics.getLinks(),
attributeStatistics.getCount());
// get the old config for the same attribute (if there is one)
Optional<ERISLPConfiguration> oldConfig = livingPartition.getConfigForAttribute(attribute, false);
......@@ -342,6 +342,13 @@ public class ERISConnector {
} else {
logger.debug(" do NOT create an index {} to get an (index-) objective of {} (compared to {} without an index)", newIndexConfig, indexScore, lookupScoreWithoutIndex);
}
} else {
// TODO this is our guess, but it seems reasonable to not get rid of an index if it causes no harm
// if there are no inserts, keep a potentially existing index
if (attributeStatistics.getInserts() == 0) {
// see if there is an index for the current attribute
livingPartition.getConfigForAttribute(attribute, true).ifPresent(configsToUse::add);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment