aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
index 184475fd70c..5735ddfd923 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
@@ -812,6 +812,7 @@ AttributeVector::getEstimatedSaveByteSize() const
uint64_t weightFileSize = 0;
uint64_t idxFileSize = 0;
uint64_t udatFileSize = 0;
+ size_t fixedWidth = getFixedWidth();
AddressSpace enumAddressSpace(getEnumStoreAddressSpaceUsage());
if (hasMultiValue()) {
@@ -822,8 +823,12 @@ AttributeVector::getEstimatedSaveByteSize() const
}
if (hasEnum() && getEnumeratedSave()) {
datFileSize = headerSize + 4 * totalValueCount;
- udatFileSize = headerSize + enumAddressSpace.used()
- - 8 * uniqueValueCount;
+ if (fixedWidth != 0) {
+ udatFileSize = headerSize + fixedWidth * uniqueValueCount;
+ } else {
+ udatFileSize = headerSize + enumAddressSpace.used()
+ - 8 * uniqueValueCount;
+ }
} else {
BasicType::Type basicType(getBasicType());
const Status &status = getStatus();
@@ -845,7 +850,7 @@ AttributeVector::getEstimatedSaveByteSize() const
}
break;
default:
- datFileSize = headerSize + getFixedWidth() * totalValueCount;
+ datFileSize = headerSize + fixedWidth * totalValueCount;
break;
}
}