Skip to main content

SET / RESET

The SET statement modifies the provided SereneDB configuration option at the specified scope.

Examples

Update the memory_limit configuration value:

Query
SET memory_limit = '10GB';

Configure the system to use 1 thread:

Query
SET threads = 1;

Or use the TO keyword:

Query
SET threads TO 1;

Change configuration option to default value:

Query
RESET threads;

Retrieve configuration value:

Query
SELECT current_setting('threads');
Result
 current_setting----------------- (varies)

Set the default collation for the session:

Query
SET SESSION default_collation = 'nocase';

Set a Global Variable

Set the default sort order globally:

Query
SET GLOBAL default_order = 'desc';

Set the default threads globally:

Query
SET GLOBAL threads = 4;

GLOBAL settings persist across the whole instance and outlive the session that set them, so reset them with RESET GLOBAL once the override is no longer needed:

Query
RESET GLOBAL default_order;
Query
RESET GLOBAL threads;

Syntax

SET updates a SereneDB configuration option to the provided value.

RESET

The RESET statement changes the given SereneDB configuration option to the default value.

Scopes

Configuration options can have different scopes:

  • GLOBAL: Configuration value is used (or reset) across the entire SereneDB instance.
  • SESSION: Configuration value is used (or reset) only for the current session attached to a SereneDB instance.
  • LOCAL: Not yet implemented.

When not specified, the default scope for the configuration option is used. For most options this is GLOBAL.

Configuration

See the Configuration page for the full list of configuration options.