PostgreSQL Configuration Variables
Bao can be configured through a number of session level PostgreSQL configuration variables. These variables are set to their default values every time you open a session (e.g., psql
session or a connection from an application).
Variable | Default | Description |
---|---|---|
pg_bao.enable_bao |
OFF | Top-level switch for all Bao functions. When disabled, Bao operates purely in advisor mode. |
pg_bao.enable_bao_rewards |
ON | If this and enable_bao are on, Bao will report and record rewards from queries executed in this session. |
pg_bao.enable_bao_selection |
ON | If this and enable_bao are on, Bao will use its value model to select query plans at optimization time. |
pg_bao.bao_host |
localhost | Host where the Bao server is running. Can be changed to put the Bao server on a different machine than PostgreSQL. |
pg_bao.bao_port |
9381 | Port to access the Bao server. If you change this, you may also need to change the port the Bao server listens on. |
pg_bao.bao_num_arms |
5 | The number of arms Bao should examine during query optimization. Lower values decrease optimization time, higher values may lead to better query plans. |
pg_bao.bao_include_json_in_explain |
OFF | Includes the JSON of the Bao plan in the output of EXPLAIN. Used internally. |
More information about each variable can be found in the pg_settings
internal table:
SELECT name, extra_desc FROM pg_settings WHERE name LIKE '%bao%';