rustcmdpev_core/
constants.rs1use phf::phf_map;
2
3pub const UNDER_LABEL: &str = "Under";
4pub const OVER_LABEL: &str = "Over";
5pub const CTE_SCAN_NODE: &str = "CTE Scan";
6
7pub const DELTA_ERROR_THRESHOLD: f64 = 0.001;
8pub const BAD_ESTIMATE_FACTOR_THRESHOLD: f64 = 100.0;
9pub const MAX_PLAN_DEPTH: usize = 32;
10pub const MAX_PLAN_NODES: usize = 10_000;
11
12pub const TREE_VERTICAL: &str = "│";
13pub const TREE_ELBOW: &str = "└";
14pub const TREE_BRANCH: &str = "├";
15pub const TREE_NODE_CONNECTOR: &str = "─⌠";
16pub const TREE_ROOT_MARKER: &str = "┬";
17pub const TREE_OUTPUT_CHILD: &str = "⌡► ";
18pub const TREE_OUTPUT_BRANCH: &str = "├► ";
19pub const TREE_OUTPUT_CONTINUATION: &str = "│ ";
20pub const TREE_OUTPUT_PADDING: &str = " ";
21
22pub const TAG_SLOWEST: &str = " slowest ";
23pub const TAG_COSTLIEST: &str = " costliest ";
24pub const TAG_LARGEST: &str = " largest ";
25pub const TAG_BAD_ESTIMATE: &str = " bad estimate ";
26
27pub static DESCRIPTIONS: phf::Map<&'static str, &'static str> = phf_map! {
28 "Append" => "Used in a UNION to merge multiple record sets by appending them together.",
29 "Limit" => "Returns a specified number of rows from a record set.",
30 "Sort" => "Sorts a record set based on the specified sort key.",
31 "Nested Loop" => "Merges two record sets by looping through every record in the first set and trying to find a match in the second set. All matching records are returned.",
32 "Merge Join" => "Merges two record sets by first sorting them on a join key.",
33 "Hash" => "Generates a hash table from the records in the input recordset. Hash is used by Hash Join.",
34 "Hash Join" => "Joins to record sets by hashing one of them (using a Hash Scan).",
35 "Aggregate" => "Groups records together based on a GROUP BY or aggregate function (e.g. sum()).",
36 "Hashaggregate" => "Groups records together based on a GROUP BY or aggregate function (e.g. sum()). Hash Aggregate uses a hash to first organize the records by a key.",
37 "Seq Scan" => "Finds relevant records by sequentially scanning the input record set. When reading from a table, Seq Scans (unlike Index Scans) perform a single read operation (only the table is read).",
38 "Index Scan" => "Finds relevant records based on an Index. Index Scans perform 2 read operations: one to read the index and another to read the actual value from the table.",
39 "Index Only Scan" => "Finds relevant records based on an Index. Index Only Scans perform a single read operation from the index and do not read from the corresponding table.",
40 "Bitmap Heap Scan" => "Searches through the pages returned by the Bitmap Index Scan for relevant rows.",
41 "Bitmap Index Scan" => "Uses a Bitmap Index (index which uses 1 bit per page) to find all relevant pages. Results of this node are fed to the Bitmap Heap Scan.",
42 "CTE Scan" => "Performs a sequential scan of Common Table Expression (CTE) query results. Note that results of a CTE are materialized (calculated and temporarily stored).",
43 "" => "",
44};