Configurations
This section details all PostgreSQL GUC (Grand Unified Configuration) variables that you can control for your pg_mooncake deployment.
Default Bucket​
If this parameter is not set, columnstore tables will be written locally. All columnstore tables will be written to the same bucket. First, set up access to your cloud storage.
ALTER DATABASE <database_name> SET mooncake.default_bucket = 'default';
Memory Allocated to DuckDB (v0.1.1+)​
Control how much memory is allocated to DuckDB for query processing:
ALTER DATABASE <database_name> SET mooncake.maximum_memory = '6GB';
In order for this setting to persist, you have to force reset DuckDB:
CALL mooncake.reset_duckdb();
By default, this is set to 4GB.
Number of Threads for DuckDB (v0.1.1+)​
Configure the number of threads that DuckDB can use for parallel processing:
ALTER DATABASE <database_name> SET mooncake.maximum_threads = -1;
By default (-1), this is set to the number of system threads.
Local Cache for Columnstore Tables​
By default, we cache data on writes. Note: turning this off may result in performance degradation for analytics on recently written and updated data.
ALTER DATABASE <database_name> SET mooncake.enable_local_cache = false;
Memory Cache for Parquet Metadata​
By default, we cache Parquet metadata on reads. Note: turning this off may result in performance degradation, though the impact is minimal.
ALTER DATABASE <database_name> SET mooncake.enable_memory_metadata_cache = false;
Applying Configuration Changes​
Configuration parameters can be set at different levels:
Session Level (temporary)​
SET mooncake.maximum_memory = '8GB';
Database Level (permanent for a database)​
ALTER DATABASE analytics SET mooncake.maximum_memory = '8GB';
User Level (permanent for a user)​
ALTER USER analyst SET mooncake.maximum_memory = '8GB';
System-wide (all databases and users)​
Add to your postgresql.conf
file:
mooncake.maximum_memory = '8GB'
Then reload the configuration:
SELECT pg_reload_conf();