diff --git a/pages/database-management/configuration.mdx b/pages/database-management/configuration.mdx index 69343c0a..a72704e0 100644 --- a/pages/database-management/configuration.mdx +++ b/pages/database-management/configuration.mdx @@ -462,6 +462,8 @@ in Memgraph. | --storage-enable-edges-metadata=false | Utilizes additional memory to store metadata related to edges. This metadata is used to speed up id based lookups on edges. | `[bool]` | | --storage-automatic-label-index-creation-enabled=false | Enables automatic creation of indices on labels. Only usable in IN_MEMORY_TRANSACTIONAL mode. | `[bool]` | | --storage-automatic-edge-type-index-creation-enabled=false | Enables automatic creation of indices on edge types. Only usable in IN_MEMORY_TRANSACTIONAL mode. | `[bool]` | +| --storage-property-store-compression-enabled=false | Controls whether the properties should be compressed in the storage. | `[bool]` | +| --storage-property-store-compression-level=mid | Controls property store compression level. Allowed values: low, mid, high | `[string]` | ### Streams diff --git a/pages/fundamentals/storage-memory-usage.mdx b/pages/fundamentals/storage-memory-usage.mdx index 3095f461..38c9795c 100644 --- a/pages/fundamentals/storage-memory-usage.mdx +++ b/pages/fundamentals/storage-memory-usage.mdx @@ -773,6 +773,23 @@ Here are several tips how you can reduce memory usage and increase scalability: 4. [Inspect query plans](/querying/best-practices#profiling-queries) and optimize them +#### Property compression + +Another way to reduce memory usage is through property compression. This feature compresses the entire `PropertyStore` object, meaning it compresses all compressible properties in the database. +When property store compression is enabled, it checks if the `PropertyStore` of a vertex can be compressed, and if it can, it compresses it using the well-known compression library `zlib`. + +To enable compression, set the `--storage-property-store-compression-enabled` flag to `true`. The default value of this flag is `false`. + +Additionally, users can control the compression level with the `--storage-property-store-compression-level` flag. The default value is mid, but two other values, low and high, are also available. +The low setting compresses properties minimally, reducing memory usage slightly, while the high setting compresses properties the most, trying to maximize memory savings. However, there’s a tradeoff to consider: +higher compression levels can reduce performance. Therefore, users focused on maintaining optimal performance may prefer not to set it to `high`. + + + +Keep in mind that even though it can reduce memory usage, compression can impact query performance. + + + ### Deallocating memory Memgraph has a garbage collector that deallocates unused objects, thus freeing