Session Settings

Table of Contents

Session settings only apply to the currently connected client session.

Usage

To configure a modifiable session setting, use SET, for example:

SET search_path TO myschema, doc;

To retrieve the current value of a session setting, use SHOW eg:

SHOW search_path;

Besides using SHOW, it is also possible to use the current_setting scalar function.

Supported Session Settings

search_path
Default: pg_catalog, doc
Modifiable: yes

The list of schemas to be searched when a relation is referenced without a schema.

CrateDB will try to resolve an unqualified relation name against the configured search_path by iterating over the configured schemas in the order they were declared. The first matching relation in the search_path is used. CrateDB will report an error if there is no match.

Note

This setting mirrors the PostgreSQL search_path setting.

Some PostgreSQL clients require access to various tables in the pg_catalog schema. Usually, this is to extract information about built-in data types or functions.

CrateDB implements the system pg_catalog schema and it automatically includes it in the search_path before the configured schemas, unless it is already explicitly in the schema configuration.

enable_semijoin
Default: false
Modifiable: yes

An experimental setting which enables CrateDB to consider rewriting a SemiJoin query into a conventional join query, if possible. For instance, a query in the form of: select x from t1 where x in (select y from t2) will be rewritten as: select t1.x from t1 SEMI JOIN (select y from t2) t2 on t1.x = t2.y

Note

It is not always possible to rewrite a SemiJoin as a conventional Join. Having this setting enabled, will only trigger the attempt of a rewrite but not guaranty it.

enable_hashjoin
Default: true
Modifiable: yes

An experimental setting which enables CrateDB to consider whether a Join operation should be evaluated using the HashJoin implementation instead of the Nested-Loops implementation.

Note

It is not always possible or efficient to use the HashJoin implementation. Having this setting enabled, will only add the option of considering it, it will not guaranty it. See also the available join algorithms for more insights on this topic.

max_index_keys
Default: 32
Modifiable: no

Shows the maximum number of index keys.

Note

The session setting has not effect on CrateDB and was added to enhance compatibility with PostgreSQL.

Warning

Experimental session settings might be removed in the future even in minor feature releases.