Skip to content
Open
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
1 change: 1 addition & 0 deletions src/global/RuntimeParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RuntimeParameters::RuntimeParameters() {
add(materializedViewWriterMemory_);
add(defaultQueryTimeout_);
add(sortInMemoryThreshold_);
add(disableUpdateGraphMetadata_);

defaultQueryTimeout_.setParameterConstraint(
[](std::chrono::seconds value, std::string_view parameterName) {
Expand Down
4 changes: 4 additions & 0 deletions src/global/RuntimeParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ struct RuntimeParameters {
MemorySizeParameter sortInMemoryThreshold_{
ad_utility::MemorySize::gigabytes(5), "sort-in-memory-threshold"};

// If set to `true`, skip updating graph metadata for delta triples.
// This can improve performance when graph metadata is not needed.
Bool disableUpdateGraphMetadata_{false, "disable-update-graph-metadata"};

// ___________________________________________________________________________
// IMPORTANT NOTE: IF YOU ADD PARAMETERS ABOVE, ALSO REGISTER THEM IN THE
// CONSTRUCTOR, S.T. THEY CAN ALSO BE ACCESSED VIA THE RUNTIME INTERFACE.
Expand Down
6 changes: 6 additions & 0 deletions src/index/LocatedTriples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "index/LocatedTriples.h"

#include "backports/algorithm.h"
#include "global/RuntimeParameters.h"
#include "index/CompressedRelation.h"
#include "index/ConstantsIndexBuilding.h"
#include "util/ChunkedForLoop.h"
Expand Down Expand Up @@ -276,6 +277,11 @@ void LocatedTriplesPerBlock::setOriginalMetadata(
// the graph info is set to `nullopt`, which means that there is no info.
static auto updateGraphMetadata(CompressedBlockMetadata& blockMetadata,
const LocatedTriples& locatedTriples) {
// Early return if graph metadata updates are disabled.
if (getRuntimeParameter<&RuntimeParameters::disableUpdateGraphMetadata_>()) {
return;
}

// We do not know anything about the triples contained in the block, so we
// also cannot know if the `locatedTriples` introduces duplicates. We thus
// have to be conservative and assume that there are duplicates.
Expand Down
Loading