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:

TRON134 B
Offset (hex)Bytes (hex)Meaning
0054 52 4F 4Emagic TRON
044C 70617468txt "path"
096C 6170702E6462txt "app.db"
100F 0A 04000000 0900 0000map leaf, size 10: @4 → @9
1ABC 71756572792D62 79746573txt "query-bytes"
2602 00004000000000 00i64 4194304
2F0F 0A 1A000000 2600 0000map leaf, size 10: @1A → @26
397C 706C616E6E6572txt "planner"
410F 0A 39000000 2F00 0000map leaf, size 10: @39 → @2F
4B8C 64617461626173 65txt "database"
540F 0A 4B000000 1000 0000map leaf, size 10: @4B → @10
5E07 0E 04100000 4100 0000 54000000map branch, size 14, depth 0 (root), slots 2, 12: @41 → @54
6C7C 706C7567696E73txt "plugins"
740F 0A 6C000000 5E00 0000map leaf, size 10: @6C → @5E

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.