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
Branches
Tags
No related merge requests found
...@@ -273,14 +273,14 @@ public class ERISConnector { ...@@ -273,14 +273,14 @@ public class ERISConnector {
// get the new config // get the new config
ERISLPConfiguration newDOrOConfig = currentDOrIConfigs.get(attribute); ERISLPConfiguration newDOrOConfig = currentDOrIConfigs.get(attribute);
ERISAttributeStatistics as = livingPartition.getAttributeStatistics(attribute); ERISAttributeStatistics attributeStatistics = livingPartition.getAttributeStatistics(attribute);
logger.debug(" attribute {}:", attribute.getName()); logger.debug(" attribute {}:", attribute.getName());
logger.debug(" stats: lookups: {} inserts: {} scans: {} links: {} count: {}", logger.debug(" stats: lookups: {} inserts: {} scans: {} links: {} count: {}",
as.getLookups(), attributeStatistics.getLookups(),
as.getInserts(), attributeStatistics.getInserts(),
as.getScans(), attributeStatistics.getScans(),
as.getLinks(), attributeStatistics.getLinks(),
as.getCount()); attributeStatistics.getCount());
// get the old config for the same attribute (if there is one) // get the old config for the same attribute (if there is one)
Optional<ERISLPConfiguration> oldConfig = livingPartition.getConfigForAttribute(attribute, false); Optional<ERISLPConfiguration> oldConfig = livingPartition.getConfigForAttribute(attribute, false);
...@@ -342,6 +342,13 @@ public class ERISConnector { ...@@ -342,6 +342,13 @@ public class ERISConnector {
} else { } else {
logger.debug(" do NOT create an index {} to get an (index-) objective of {} (compared to {} without an index)", newIndexConfig, indexScore, lookupScoreWithoutIndex); 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