Create flags for enabling auto index creation
This commit is contained in:
parent
2ac649f3b5
commit
be32e8893d
@ -119,6 +119,14 @@ modifications:
|
|||||||
value: "false"
|
value: "false"
|
||||||
override: true
|
override: true
|
||||||
|
|
||||||
|
- name: "storage_enable_automatic_label_index_creation"
|
||||||
|
value: "false"
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: "storage_enable_automatic_edge_type_index_creation"
|
||||||
|
value: "false"
|
||||||
|
override: true
|
||||||
|
|
||||||
- name: "query_callable_mappings_path"
|
- name: "query_callable_mappings_path"
|
||||||
value: "/etc/memgraph/apoc_compatibility_mappings.json"
|
value: "/etc/memgraph/apoc_compatibility_mappings.json"
|
||||||
override: true
|
override: true
|
||||||
|
@ -131,6 +131,14 @@ DEFINE_uint64(storage_recovery_thread_count,
|
|||||||
DEFINE_bool(storage_enable_schema_metadata, false,
|
DEFINE_bool(storage_enable_schema_metadata, false,
|
||||||
"Controls whether metadata should be collected about the resident labels and edge types.");
|
"Controls whether metadata should be collected about the resident labels and edge types.");
|
||||||
|
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
DEFINE_bool(storage_enable_automatic_label_index_creation, false,
|
||||||
|
"Controls whether label indexes on vertices should be created automatically.");
|
||||||
|
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
DEFINE_bool(storage_enable_automatic_edge_type_index_creation, false,
|
||||||
|
"Controls whether edge-type indexes on relationships should be created automatically.");
|
||||||
|
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
DEFINE_bool(storage_delta_on_identical_property_update, true,
|
DEFINE_bool(storage_delta_on_identical_property_update, true,
|
||||||
"Controls whether updating a property with the same value should create a delta object.");
|
"Controls whether updating a property with the same value should create a delta object.");
|
||||||
|
@ -85,6 +85,10 @@ DECLARE_uint64(storage_recovery_thread_count);
|
|||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
DECLARE_bool(storage_enable_schema_metadata);
|
DECLARE_bool(storage_enable_schema_metadata);
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
DECLARE_bool(storage_enable_automatic_label_index_creation);
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
DECLARE_bool(storage_enable_automatic_edge_type_index_creation);
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
DECLARE_bool(storage_delta_on_identical_property_update);
|
DECLARE_bool(storage_delta_on_identical_property_update);
|
||||||
|
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
@ -333,8 +333,18 @@ int main(int argc, char **argv) {
|
|||||||
.wal_directory = FLAGS_data_directory + "/rocksdb_wal"},
|
.wal_directory = FLAGS_data_directory + "/rocksdb_wal"},
|
||||||
.salient.items = {.properties_on_edges = FLAGS_storage_properties_on_edges,
|
.salient.items = {.properties_on_edges = FLAGS_storage_properties_on_edges,
|
||||||
.enable_schema_metadata = FLAGS_storage_enable_schema_metadata,
|
.enable_schema_metadata = FLAGS_storage_enable_schema_metadata,
|
||||||
|
.enable_label_index_auto_creation = FLAGS_storage_enable_automatic_label_index_creation,
|
||||||
|
.enable_edge_type_index_auto_creation =
|
||||||
|
FLAGS_storage_properties_on_edges ? FLAGS_storage_enable_automatic_edge_type_index_creation
|
||||||
|
: false,
|
||||||
.delta_on_identical_property_update = FLAGS_storage_delta_on_identical_property_update},
|
.delta_on_identical_property_update = FLAGS_storage_delta_on_identical_property_update},
|
||||||
.salient.storage_mode = memgraph::flags::ParseStorageMode()};
|
.salient.storage_mode = memgraph::flags::ParseStorageMode()};
|
||||||
|
if (db_config.salient.items.enable_edge_type_index_auto_creation && !db_config.salient.items.properties_on_edges) {
|
||||||
|
spdlog::warn(
|
||||||
|
"Automatic index creation on edge-types has been set but properties on edges are disabled. This will "
|
||||||
|
"implicitly disallow automatic edge-type index creation. If you wish to use automatic edge-type index "
|
||||||
|
"creation, enable properties on edges as well.");
|
||||||
|
}
|
||||||
spdlog::info("config recover on startup {}, flags {} {}", db_config.durability.recover_on_startup,
|
spdlog::info("config recover on startup {}, flags {} {}", db_config.durability.recover_on_startup,
|
||||||
FLAGS_storage_recover_on_startup, FLAGS_data_recovery_on_startup);
|
FLAGS_storage_recover_on_startup, FLAGS_data_recovery_on_startup);
|
||||||
memgraph::utils::Scheduler jemalloc_purge_scheduler;
|
memgraph::utils::Scheduler jemalloc_purge_scheduler;
|
||||||
|
@ -37,6 +37,8 @@ struct SalientConfig {
|
|||||||
struct Items {
|
struct Items {
|
||||||
bool properties_on_edges{true};
|
bool properties_on_edges{true};
|
||||||
bool enable_schema_metadata{false};
|
bool enable_schema_metadata{false};
|
||||||
|
bool enable_label_index_auto_creation{false};
|
||||||
|
bool enable_edge_type_index_auto_creation{false};
|
||||||
bool delta_on_identical_property_update{true};
|
bool delta_on_identical_property_update{true};
|
||||||
friend bool operator==(const Items &lrh, const Items &rhs) = default;
|
friend bool operator==(const Items &lrh, const Items &rhs) = default;
|
||||||
} items;
|
} items;
|
||||||
@ -45,13 +47,19 @@ struct SalientConfig {
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline void to_json(nlohmann::json &data, SalientConfig::Items const &items) {
|
inline void to_json(nlohmann::json &data, SalientConfig::Items const &items) {
|
||||||
data = nlohmann::json{{"properties_on_edges", items.properties_on_edges},
|
data = nlohmann::json{
|
||||||
{"enable_schema_metadata", items.enable_schema_metadata}};
|
{"properties_on_edges", items.properties_on_edges},
|
||||||
|
{"enable_schema_metadata", items.enable_schema_metadata},
|
||||||
|
{"enable_label_index_auto_creation", items.enable_label_index_auto_creation},
|
||||||
|
{"enable_edge_type_index_auto_creation", items.enable_edge_type_index_auto_creation},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void from_json(const nlohmann::json &data, SalientConfig::Items &items) {
|
inline void from_json(const nlohmann::json &data, SalientConfig::Items &items) {
|
||||||
data.at("properties_on_edges").get_to(items.properties_on_edges);
|
data.at("properties_on_edges").get_to(items.properties_on_edges);
|
||||||
data.at("enable_schema_metadata").get_to(items.enable_schema_metadata);
|
data.at("enable_schema_metadata").get_to(items.enable_schema_metadata);
|
||||||
|
data.at("enable_label_index_auto_creation").get_to(items.enable_label_index_auto_creation);
|
||||||
|
data.at("enable_edge_type_index_auto_creation").get_to(items.enable_edge_type_index_auto_creation);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void to_json(nlohmann::json &data, SalientConfig const &config) {
|
inline void to_json(nlohmann::json &data, SalientConfig const &config) {
|
||||||
|
Loading…
Reference in New Issue
Block a user