Query planner: planner

planner uses statistics and saved plans to choose query plans. It requires database, and saves plans in the database storage. Without planner, queries use the built-in planner.

SettingPurposeDefaultRange
queriesMaximum query identities tracked for learning.256 queries1–65,536 queries
query-bytesMemory reserved for query learning state.4 MiB64 KiB–1 GiB
stored-plansMaximum number of saved plans.1,024 plans0–1,048,576 plans
stored-bytesMaximum combined size of saved plan keys and values.1 MiB0–256 MiB

Byte settings take integer counts of bytes in the configuration. Set stored-plans or stored-bytes to zero to disable loading and saving plans. Pending plan trials can use one third of query-bytes. With the default 4 MiB, 17 trials can wait at a time; at least one trial can always wait.

Dependencies

Configuration

Select this plugin explicitly when opening the database:

edn83 B
{:plugins {:database {:path "app.db"}
           :planner  {:query-bytes 4194304}}}

Usage

Select planner and database with a path when opening the database. Query execution can then use recorded statistics and saved plans. Use the explain request to inspect a query plan.