Skip to content

Plan-dumper: Add Umbra, CedarDB, MariaDB, and Trino - #164

Open
vogelsgesang wants to merge 10 commits into
mainfrom
plan-dumper-more-dbs
Open

Plan-dumper: Add Umbra, CedarDB, MariaDB, and Trino#164
vogelsgesang wants to merge 10 commits into
mainfrom
plan-dumper-more-dbs

Conversation

@vogelsgesang

Copy link
Copy Markdown
Collaborator

I am planning to add support for additional database engines. In preparation for that, this commit adds plan dumps for Umbra, CedarDB, MariaDB, and Trino.

To do so, the plan-dumper is extended to support those new databsaes.

I am planning to add support for additional database engines.
In preparation for that, this commit adds plan dumps for Umbra, CedarDB,
MariaDB, and Trino.

To do so, the plan-dumper is extended to support those new databsaes.
Comment thread plan-dumper/queries/tpch/tpch-q15.sql
Comment thread plan-dumper/queries/cte-recursive.sql Outdated
Comment thread plan-dumper/queries/insert.sql
Comment thread plan-dumper/queries/metadata-describe-table.sql Outdated
Comment thread plan-dumper/queries/tablefunction.sql
Comment thread plan-dumper/requirements.txt
Comment thread plan-dumper/README.md Outdated
Comment thread plan-dumper/README.md Outdated
Comment thread plan-dumper/README.md Outdated
Comment thread plan-dumper/README.md Outdated
Preserve fixtures that the active engine build cannot regenerate, collect
stable MariaDB statistics, and filter engine-specific memory, scheduler,
and identifier fields alongside timing measurements.
Document engine-specific limitations, align all server connections behind
explicit CLI arguments, and shorten the recursive CTE so Trino can produce
an analyzed fixture.
Generate each engine into an empty staging directory so stale outputs cannot
survive a run, and fail atomically when a requested mode is unavailable.
Keep the sole legacy fixture as an explicit manual input and drop the obsolete
TDE example.
Drop the obsolete camel-case Hyper example and keep every staged engine
folder derived solely from its requested SQL plans. Remove the unused mode
mapping hook left behind by Trino's former analyze fallback.
Comment thread plan-dumper/filter-timing-diff.py Outdated
Comment on lines +5 to +7
fields change on every run even when the plan itself didn't. A hunk is dropped if every
removed line matches its added counterpart once those volatile fields are masked out;
if a line differs for any other reason, the whole line is kept as-is.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fields change on every run even when the plan itself didn't. A hunk is dropped if every
removed line matches its added counterpart once those volatile fields are masked out;
if a line differs for any other reason, the whole line is kept as-is.
fields change on every run even when the plan itself didn't. Hunk which only differ on
those volatile fields are dropped. If a hunk differs for any other reason, the whole line is kept as-is.

Comment thread plan-dumper/filter-timing-diff.py Outdated
Comment on lines +25 to +28
# Postgres uses keys such as "Actual Total Time"; Hyper uses "cpu-cycles";
# DuckDB uses "cpu_time", "operator_timing", and "latency"; MariaDB uses
# "r_total_time_ms"/"r_table_time_ms"; Umbra uses "durationUs"; and Trino uses
# "*Time", "*Cpu", and "*Wall" keys.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use bullet point list:

Suggested change
# Postgres uses keys such as "Actual Total Time"; Hyper uses "cpu-cycles";
# DuckDB uses "cpu_time", "operator_timing", and "latency"; MariaDB uses
# "r_total_time_ms"/"r_table_time_ms"; Umbra uses "durationUs"; and Trino uses
# "*Time", "*Cpu", and "*Wall" keys.
# Volatile fields:
# * Hyper: `cpu-cycles`;
# * Umbra uses `durationUs`;
# * Postgres: `Actual Total Time`
# * DuckDB: `cpu_time`, `operator_timing`, and `latency`
# * Trino: `*Time`, `*Cpu`, and `*Wall` keys
# * MariaDB: `r_total_time_ms`/`r_table_time_ms`

Comment thread plan-dumper/dump-plans.py Outdated
Comment on lines +19 to +32
try:
import psycopg2
except ImportError:
psycopg2 = None
import argparse
import re
import shutil
import os
import json
from pathlib import Path

setupFile = Path("./setup.sql")
queriesDir = Path("./queries")
targetDir = Path("../standalone-app/examples/")
hyper_params = {
"log_config": ""
}
try:
import pymysql
except ImportError:
pymysql = None

try:
import trino
except ImportError:
trino = None

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to try-import; just assume that the requirements.txt got installed

Describe the hunk-level behavior directly and list each engine's volatile
runtime fields in a scan-friendly format.
Comment thread plan-dumper/dump-plans.py Outdated
Import the declared dependencies directly so incomplete installations fail
immediately instead of silently skipping configured databases.
Use uppercase snake case for module-level constants and regular expressions so
the dumper follows standard Python naming conventions throughout.
Keep dialect differences in dedicated SQL files so the dumper executes setup
statements verbatim instead of parsing and rewriting their DDL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant