sqlbenchdag 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlbenchdag-0.1.0/LICENSE +202 -0
- sqlbenchdag-0.1.0/PKG-INFO +221 -0
- sqlbenchdag-0.1.0/README.md +173 -0
- sqlbenchdag-0.1.0/infrastructure/debug_aws.py +40 -0
- sqlbenchdag-0.1.0/pyproject.toml +94 -0
- sqlbenchdag-0.1.0/scripts/dev/backfill_queries.py +44 -0
- sqlbenchdag-0.1.0/scripts/dev/timestamp_capsule.py +49 -0
- sqlbenchdag-0.1.0/scripts/dev/upgrade_capsule.py +63 -0
- sqlbenchdag-0.1.0/scripts/dev/verify_capsule.py +79 -0
- sqlbenchdag-0.1.0/scripts/dev/verify_portability.py +103 -0
- sqlbenchdag-0.1.0/scripts/tools/_plotlib.py +43 -0
- sqlbenchdag-0.1.0/scripts/tools/analyze_scaling.py +39 -0
- sqlbenchdag-0.1.0/scripts/tools/demo_breach_detection.py +61 -0
- sqlbenchdag-0.1.0/scripts/tools/extract_results.py +57 -0
- sqlbenchdag-0.1.0/scripts/tools/find_kink.py +104 -0
- sqlbenchdag-0.1.0/scripts/tools/gen_experiment_catalog.py +103 -0
- sqlbenchdag-0.1.0/scripts/tools/load_parquet_to_local.py +98 -0
- sqlbenchdag-0.1.0/scripts/tools/plot_execution_modes.py +82 -0
- sqlbenchdag-0.1.0/scripts/tools/plot_scaling.py +91 -0
- sqlbenchdag-0.1.0/scripts/tools/plot_selectivity.py +139 -0
- sqlbenchdag-0.1.0/scripts/tools/plot_threads.py +95 -0
- sqlbenchdag-0.1.0/scripts/tools/regenerate_dashboard.py +58 -0
- sqlbenchdag-0.1.0/scripts/tools/verify_doc_claims.py +88 -0
- sqlbenchdag-0.1.0/setup.cfg +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/__init__.py +3 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/app.py +30 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/data/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/data/catalog_reader.py +73 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/data/reader.py +125 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/logic/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/logic/comparator.py +44 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/logic/ranker.py +127 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/models/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/models/catalog.py +22 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/models/experiments.py +20 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/models/recommend.py +11 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/models/results.py +66 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/routers/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/routers/catalog.py +19 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/routers/experiments.py +79 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/routers/recommend.py +22 -0
- sqlbenchdag-0.1.0/sql_benchmarks/api/routers/results.py +51 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/__init__.py +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/benchmark_factory.py +222 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/data_factory.py +54 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/data_quality.py +91 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/ingestion_factory.py +88 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/maintenance.py +63 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/reporting.py +385 -0
- sqlbenchdag-0.1.0/sql_benchmarks/assets/semantic_gate.py +76 -0
- sqlbenchdag-0.1.0/sql_benchmarks/cli.py +69 -0
- sqlbenchdag-0.1.0/sql_benchmarks/config_loader.py +104 -0
- sqlbenchdag-0.1.0/sql_benchmarks/constants.py +60 -0
- sqlbenchdag-0.1.0/sql_benchmarks/coordinator.py +282 -0
- sqlbenchdag-0.1.0/sql_benchmarks/definitions.py +115 -0
- sqlbenchdag-0.1.0/sql_benchmarks/experiments/templates/experiment_template.yaml +99 -0
- sqlbenchdag-0.1.0/sql_benchmarks/harness.py +84 -0
- sqlbenchdag-0.1.0/sql_benchmarks/jobs.py +8 -0
- sqlbenchdag-0.1.0/sql_benchmarks/partitions.py +17 -0
- sqlbenchdag-0.1.0/sql_benchmarks/plugins/data_sources/declarative_gen.py +211 -0
- sqlbenchdag-0.1.0/sql_benchmarks/plugins/data_sources/local_file_loader.py +62 -0
- sqlbenchdag-0.1.0/sql_benchmarks/plugins/data_sources/tpc_h.py +61 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/actian.py +234 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/actian_client.py +231 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/base_engine.py +58 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/base_schema_client.py +104 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/duckdb.py +58 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/duckdb_client.py +157 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/postgres.py +188 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/postgres_client.py +184 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/quack.py +56 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/quack_client.py +169 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/typedb_client.py +370 -0
- sqlbenchdag-0.1.0/sql_benchmarks/resources/typedb_engine.py +303 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/acid_test/duckdb/test.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/acid_test/postgres/test.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/analytical_wall/actian/analytical_wall.sql +15 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/analytical_wall/analytical_wall.sql.template +19 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/analytical_wall/duckdb/analytical_wall.sql +15 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/analytical_wall/postgres/analytical_wall.sql +15 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/group_by/duckdb/groupby_antipattern.sql +11 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/group_by/duckdb/groupby_recommended_cte.sql +19 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/group_by/postgres/groupby_antipattern.sql +13 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/group_by/postgres/groupby_recommended_pk.sql +11 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/hypergraph/duckdb/q_1hop.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/hypergraph/duckdb/q_2hop.sql +6 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/hypergraph/duckdb/q_full.sql +9 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/hypergraph/typedb/q_1hop.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/hypergraph/typedb/q_2hop.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/hypergraph/typedb/q_full.sql +6 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/joins/duckdb/join_antipattern.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/joins/duckdb/join_recommended.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/joins/postgres/join_antipattern.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/joins/postgres/join_recommended.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_logic/duckdb/2VL_identity.sql +14 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_logic/duckdb/3VL_identity.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_logic/postgres/2VL_identity.sql +14 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_logic/postgres/3VL_identity.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_sentinel/duckdb/2VL_identity.sql +14 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_sentinel/duckdb/3VL_identity.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_sentinel/duckdb/sentinel_optimization.sql +16 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_sentinel/postgres/2VL_identity.sql +14 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_sentinel/postgres/3VL_identity.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/null_sentinel/postgres/sentinel_optimization.sql +21 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursion/duckdb/recursive_cte.sql +26 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursion/postgres/recursive_cte.sql +30 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursive_graph/duckdb/q_bounded_3hop.sql +17 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursive_graph/duckdb/q_fixed_2hop.sql +6 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursive_graph/duckdb/q_transitive_closure.sql +17 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursive_graph/typedb/q_bounded_3hop.sql +6 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursive_graph/typedb/q_fixed_2hop.sql +5 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/recursive_graph/typedb/q_transitive_closure.sql +7 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/security/acid_resilience/duckdb/test.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/duckdb/q_0_1_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/duckdb/q_10_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/duckdb/q_1_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/duckdb/q_20_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/duckdb/q_5_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/duckdb/q_filler.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/postgres/q_0_1_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/postgres/q_10_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/postgres/q_1_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/postgres/q_20_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/postgres/q_5_percent.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/postgres/q_filler.sql +1 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/typedb/q_0_1_percent.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/typedb/q_10_percent.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/typedb/q_1_percent.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/typedb/q_20_percent.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/typedb/q_5_percent.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/selectivity/typedb/q_filler.sql +4 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/sort_spill/duckdb/sort_full.sql +25 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/sort_spill/duckdb/sort_wide_rows.sql +25 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/sort_spill/postgres/sort_full.sql +25 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/sort_spill/postgres/sort_wide_rows.sql +26 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/tpch/duckdb/q3_shipping_priority.sql +25 -0
- sqlbenchdag-0.1.0/sql_benchmarks/scripts/sql/tpch/postgres/q3_shipping_priority.sql +25 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/__init__.py +0 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/common.py +260 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/ddl.py +47 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/hasher.py +124 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/integrity_monitor.py +55 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/providers.py +184 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/scaling.py +88 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/schema.py +118 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/semantic_auditor.py +81 -0
- sqlbenchdag-0.1.0/sql_benchmarks/utils/system.py +100 -0
- sqlbenchdag-0.1.0/sql_benchmarks/validator.py +60 -0
- sqlbenchdag-0.1.0/sqlbenchdag.egg-info/PKG-INFO +221 -0
- sqlbenchdag-0.1.0/sqlbenchdag.egg-info/SOURCES.txt +156 -0
- sqlbenchdag-0.1.0/sqlbenchdag.egg-info/dependency_links.txt +1 -0
- sqlbenchdag-0.1.0/sqlbenchdag.egg-info/entry_points.txt +2 -0
- sqlbenchdag-0.1.0/sqlbenchdag.egg-info/requires.txt +26 -0
- sqlbenchdag-0.1.0/sqlbenchdag.egg-info/top_level.txt +12 -0
- sqlbenchdag-0.1.0/venv/bin/activate_this.py +59 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2025-2026 Ramona C. Truta
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sqlbenchdag
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A reproducible, content-addressed SQL engine benchmarking laboratory.
|
|
5
|
+
Author: Ramona C. Truta
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/rctruta/sql-benchmarks-dagster
|
|
8
|
+
Project-URL: Repository, https://github.com/rctruta/sql-benchmarks-dagster
|
|
9
|
+
Keywords: benchmarking,sql,duckdb,postgres,dagster,reproducibility,provenance
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Topic :: Database
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Requires-Python: <3.14,>=3.11
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: dagster
|
|
23
|
+
Requires-Dist: dagster-cloud
|
|
24
|
+
Requires-Dist: dagster-postgres
|
|
25
|
+
Requires-Dist: dagster-duckdb
|
|
26
|
+
Requires-Dist: docker
|
|
27
|
+
Requires-Dist: pandas
|
|
28
|
+
Requires-Dist: plotly
|
|
29
|
+
Requires-Dist: polars
|
|
30
|
+
Requires-Dist: pyarrow
|
|
31
|
+
Requires-Dist: psycopg2-binary
|
|
32
|
+
Requires-Dist: sqlalchemy
|
|
33
|
+
Requires-Dist: psutil
|
|
34
|
+
Requires-Dist: pyyaml
|
|
35
|
+
Requires-Dist: numpy
|
|
36
|
+
Requires-Dist: paramiko<4.0.0
|
|
37
|
+
Requires-Dist: sshtunnel>=0.4.0
|
|
38
|
+
Requires-Dist: scp>=0.14.0
|
|
39
|
+
Requires-Dist: fastapi>=0.111.0
|
|
40
|
+
Requires-Dist: uvicorn[standard]>=0.29.0
|
|
41
|
+
Requires-Dist: fastmcp>=0.1.0
|
|
42
|
+
Requires-Dist: httpx>=0.27.0
|
|
43
|
+
Requires-Dist: typedb-driver
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: dagster-webserver; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest; extra == "dev"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# SQL Benchmarking Laboratory
|
|
50
|
+
|
|
51
|
+
> **A deterministic, orchestrated harness for verifying database performance at scale.**
|
|
52
|
+
> Developed by Ramona C. Truta
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## The Mission: "Ground Truth" as Code
|
|
57
|
+
|
|
58
|
+
This platform is a specialized laboratory for testing SQL performance hypotheses. It transforms query tuning from intuition into a reproducible science.
|
|
59
|
+
|
|
60
|
+
The core of the system is a **Deterministic Orchestration Harness** that guarantees that if the logic or the environment changes, the benchmark result changes. If they do not, the result is addressable and cached.
|
|
61
|
+
|
|
62
|
+
**Scope:** the focus to date is **synthetic and canonical (TPC-H) data**, which
|
|
63
|
+
is the right instrument for *mechanism* experiments — where controlled,
|
|
64
|
+
reproducible data isolates the variable under test. Real-data support exists but
|
|
65
|
+
is experimental; see the [FAQ](FAQ.md) for the synthetic-vs-real rationale, the
|
|
66
|
+
container model, and the roadmap (AI-security testbed, real-data trust chain).
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Key Features & Innovations
|
|
71
|
+
|
|
72
|
+
### 1. Context-Aware Semantic Hashing (The Experiment ID)
|
|
73
|
+
The Heart of the system is the **Experiment ID**, an 8-character hash that governs the entire lifecycle. This hash is a SHA-256 fingerprint generated from:
|
|
74
|
+
* **The Config**: Every dimension in your YAML (rows, skew, parameters).
|
|
75
|
+
* **The SQL Logic**: The actual content of the benchmarked scripts.
|
|
76
|
+
* **The Code**: All measurement-relevant Python — orchestration (`assets/`), engine clients (`resources/`), and data generators (`plugins/`).
|
|
77
|
+
|
|
78
|
+
**Semantic Normalization**: The hashing engine distinguishes between a logic change and a formatting change.
|
|
79
|
+
* **SQL**: Comments, whitespace, and case are normalized before hashing.
|
|
80
|
+
* **Python**: Orchestration scripts are parsed into an **Abstract Syntax Tree (AST)** to strip docstrings and formatting variations, ensuring the Experiment ID only changes when execution logic changes.
|
|
81
|
+
|
|
82
|
+
### 2. Multi-Layer Cold-Cache Isolation
|
|
83
|
+
To ensure IO-bound performance is not masked by memory buffers, we implement a dual-layer cold start mechanism:
|
|
84
|
+
* **Out-of-Process (Postgres)**: Mandatory **Docker Container Restarts** before every query to clear engine-level shared buffers.
|
|
85
|
+
* **Global OS Flush (mmap)**: A specialized `thrash_os_cache` primitive that maps and dirties a file larger than physical RAM. This forces the OS to evict Page Cache entries, ensuring cold read performance for both containerized and in-process (DuckDB) engines.
|
|
86
|
+
|
|
87
|
+
### 3. Agentic AI Integration
|
|
88
|
+
The platform is built for the future of **Autonomous Engineering**. The Experiment ID allows AI agents to treat the laboratory as a **Deterministic Performance API**.
|
|
89
|
+
* See [AGENTS.md](AGENTS.md) for the full Agentic Benchmarking Protocol.
|
|
90
|
+
|
|
91
|
+
### 4. Declarative Matrix Orchestration
|
|
92
|
+
Benchmarks are defined as N-dimensional matrices in YAML. The platform expands these into a Cartesian product of **Independent Dagster Partitions**. This allows for parallel dispatch and granular retries.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Usage & Technical Setup
|
|
97
|
+
|
|
98
|
+
### Prerequisites
|
|
99
|
+
* **[uv](https://astral.sh/uv)**: the project's Python environment & dependency manager (fast, modern). `setup.sh` uses it, and it can install Python 3.11 for you.
|
|
100
|
+
* **Python 3.11+**: core runtime (uv provisions it if missing).
|
|
101
|
+
* **Docker**: for the containerized engines (Postgres, TypeDB), which the harness manages itself — *not* required for the DuckDB-only quickstart.
|
|
102
|
+
|
|
103
|
+
### Installation & Setup
|
|
104
|
+
The laboratory includes a comprehensive setup script that manages virtual environments, dependencies, and directory initialization.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# 1. Automate Setup
|
|
108
|
+
chmod +x setup.sh && ./setup.sh
|
|
109
|
+
|
|
110
|
+
# 2. Activate Laboratory
|
|
111
|
+
source venv/bin/activate
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### The Execution Workflow (CLI)
|
|
115
|
+
While the system is powered by Dagster, the primary interface is the CLI for automated workflows.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# QUICKSTART: DuckDB only, no Docker required — runs in seconds
|
|
119
|
+
./run.sh sql_benchmarks/experiments/queue/quickstart.yaml --auto
|
|
120
|
+
|
|
121
|
+
# FULL BENCHMARK: Run all queued experiments (requires Docker for Postgres)
|
|
122
|
+
./run.sh queue --auto
|
|
123
|
+
|
|
124
|
+
# SINGLE EXPERIMENT: Pass a specific config path
|
|
125
|
+
./run.sh sql_benchmarks/experiments/queue/quack_execution_modes.yaml --auto
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To write your own experiment, start from the annotated template and see the
|
|
129
|
+
catalog of published runs in **[docs/experiments.md](docs/experiments.md)**.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Project Structure
|
|
134
|
+
Managed with a strict separation between Harness and Scenario:
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
/sql_benchmarks
|
|
138
|
+
├── /assets # THE HARNESS: Dagster factories & pipeline logic
|
|
139
|
+
├── /resources # THE INFRASTRUCTURE: DB drivers & Docker management
|
|
140
|
+
├── /scripts/sql # THE SCENARIOS: Raw SQL partitioned by scenario
|
|
141
|
+
├── /plugins # THE DATA: Declarative generators & scenario providers
|
|
142
|
+
├── /utils # THE BRAIN: AST-hashing, common logic, & system primitives
|
|
143
|
+
└── /experiments # THE LABORATORY
|
|
144
|
+
├── active.yaml # Current active partition matrix
|
|
145
|
+
├── /queue # Staging area for new experiment configs
|
|
146
|
+
├── /archive # Library of previously defined experiment templates
|
|
147
|
+
├── /configs # Registry of immutable, hash-addressed experiment capsules
|
|
148
|
+
└── /results # Data capsules: fragments, CSVs, and Dashboards
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Published Experiments — the Quack investigation
|
|
154
|
+
|
|
155
|
+
The first published study with this lab: an independent measurement of DuckDB's
|
|
156
|
+
**Quack** client-server protocol (beta, v1.5.3). Each row links the runnable
|
|
157
|
+
config to its committed, verifiable capsule. Full numbers, scaling exponents,
|
|
158
|
+
and verification steps in [docs/published_capsules.md](docs/published_capsules.md).
|
|
159
|
+
|
|
160
|
+
| Act | Question | Config | Capsule | Finding |
|
|
161
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
162
|
+
| **I** | What does the protocol cost? | [quack_execution_modes.yaml](sql_benchmarks/experiments/queue/quack_execution_modes.yaml) | `b8e2bfaf` | Attach-mode overhead grows with scan size (2.6× → **9.5×** at 10M rows); pushdown stays flat at ~2×. |
|
|
163
|
+
| **II** | Why is pushdown ~2× and not 1×? | [quack_residual_threads.yaml](sql_benchmarks/experiments/queue/quack_residual_threads.yaml) | `25b0e134` | The residual tracks reduced server-side parallelism (~2–4 of 8 threads), not transport. |
|
|
164
|
+
| **III** | Does it generalize to joins? | [tpch_quack_validation.yaml](sql_benchmarks/experiments/queue/tpch_quack_validation.yaml) | `b198363e` | On canonical TPC-H Q3, pushdown holds (~1.9×); attach mode **cannot run the join at all** (DNF). |
|
|
165
|
+
| **IV** | Does it beat the incumbent? | [quack_vs_postgres.yaml](sql_benchmarks/experiments/queue/quack_vs_postgres.yaml) | `902d1277` | DuckDB-over-Quack (pushdown) beats PostgreSQL by up to **13.2×**, and the gap widens with scale. |
|
|
166
|
+
|
|
167
|
+
*Act 0 (`b82b4eae`) is the exploratory scout that started it — see [docs/published_capsules.md](docs/published_capsules.md).*
|
|
168
|
+
|
|
169
|
+
The lab also ships scenario suites for other studies — `selectivity/`,
|
|
170
|
+
`null_logic/`, `null_sentinel/`, `recursion/`, `sort_spill/`, `tpch/`, and more
|
|
171
|
+
under `sql_benchmarks/scripts/sql/` — each runnable across the engine matrix.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Naming & Provenance
|
|
176
|
+
|
|
177
|
+
The lab works at two layers, named two different ways. Keeping them distinct is
|
|
178
|
+
the difference between a number you can trace and a number you have to trust.
|
|
179
|
+
|
|
180
|
+
| Layer | What it is | Named by | Example |
|
|
181
|
+
| :--- | :--- | :--- | :--- |
|
|
182
|
+
| **Capsule** | one experiment's complete results | its **Experiment ID** — an 8-char SHA-256 of the *question* (config + SQL + measurement code), assigned by the machine | `48c92f31` |
|
|
183
|
+
| **Release** | a signed set of capsules backing a publication | a human name: **`sqlbenchdag-<topic>-v<N>-<YYYYMMDD>`** | `sqlbenchdag-quack-v1-20260614` |
|
|
184
|
+
|
|
185
|
+
A release *contains* capsules; a capsule is one experiment. The machine names
|
|
186
|
+
capsules (hashes you can't forge); the author names releases (words that mean
|
|
187
|
+
something). `sqlbenchdag` is the lab's maker's mark — `sql` + `bench` +
|
|
188
|
+
`dag` (Dagster, the orchestration that distinguishes this lab from a bare query
|
|
189
|
+
timer). It is carried on every release this lab produces.
|
|
190
|
+
|
|
191
|
+
**Two hashes, two jobs** (a capsule contains both — they are not the same thing):
|
|
192
|
+
- the **Experiment ID** (8 chars) is an *address* — it *names* the capsule, and
|
|
193
|
+
the same question always produces the same address;
|
|
194
|
+
- the **integrity seal** (64 chars, in `integrity.seal`) is a *checksum* — it
|
|
195
|
+
*verifies* the capsule's contents are untouched. You file by the address; the
|
|
196
|
+
seal is the tamper-evident lid.
|
|
197
|
+
|
|
198
|
+
**Reproducibility is pinned to the release.** Because the Experiment ID hashes
|
|
199
|
+
the measurement code, it is stable only at a fixed code revision — which is
|
|
200
|
+
exactly what the signed release tag freezes. To reproduce a published capsule,
|
|
201
|
+
check out its release tag and re-run its config; the same question yields the
|
|
202
|
+
same ID, or the comparison is refused by construction.
|
|
203
|
+
|
|
204
|
+
> Provenance roadmap: a per-capsule `generator` stamp (`sqlbenchdag@<commit>`)
|
|
205
|
+
> will record the exact build that produced each capsule. It writes through the
|
|
206
|
+
> finalization code, which lives inside the Experiment-ID hash, so it ships with
|
|
207
|
+
> a future release rather than re-numbering capsules already published.
|
|
208
|
+
|
|
209
|
+
See [docs/published_capsules.md](docs/published_capsules.md) for the full trust
|
|
210
|
+
chain (reproducibility, integrity, timestamp, authorship) and how to verify each.
|
|
211
|
+
Reproducibility and integrity are **automatic** on every run; timestamp and
|
|
212
|
+
signature are **optional** steps you add only when publishing — the producer
|
|
213
|
+
workflow is [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## License
|
|
218
|
+
|
|
219
|
+
Copyright 2025-2026 Ramona C. Truta. Licensed under the [Apache License 2.0](LICENSE).
|
|
220
|
+
|
|
221
|
+
Built with **Dagster**, **Polars**, **Docker**, **DuckDB**, and **Postgres**.
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# SQL Benchmarking Laboratory
|
|
2
|
+
|
|
3
|
+
> **A deterministic, orchestrated harness for verifying database performance at scale.**
|
|
4
|
+
> Developed by Ramona C. Truta
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## The Mission: "Ground Truth" as Code
|
|
9
|
+
|
|
10
|
+
This platform is a specialized laboratory for testing SQL performance hypotheses. It transforms query tuning from intuition into a reproducible science.
|
|
11
|
+
|
|
12
|
+
The core of the system is a **Deterministic Orchestration Harness** that guarantees that if the logic or the environment changes, the benchmark result changes. If they do not, the result is addressable and cached.
|
|
13
|
+
|
|
14
|
+
**Scope:** the focus to date is **synthetic and canonical (TPC-H) data**, which
|
|
15
|
+
is the right instrument for *mechanism* experiments — where controlled,
|
|
16
|
+
reproducible data isolates the variable under test. Real-data support exists but
|
|
17
|
+
is experimental; see the [FAQ](FAQ.md) for the synthetic-vs-real rationale, the
|
|
18
|
+
container model, and the roadmap (AI-security testbed, real-data trust chain).
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Key Features & Innovations
|
|
23
|
+
|
|
24
|
+
### 1. Context-Aware Semantic Hashing (The Experiment ID)
|
|
25
|
+
The Heart of the system is the **Experiment ID**, an 8-character hash that governs the entire lifecycle. This hash is a SHA-256 fingerprint generated from:
|
|
26
|
+
* **The Config**: Every dimension in your YAML (rows, skew, parameters).
|
|
27
|
+
* **The SQL Logic**: The actual content of the benchmarked scripts.
|
|
28
|
+
* **The Code**: All measurement-relevant Python — orchestration (`assets/`), engine clients (`resources/`), and data generators (`plugins/`).
|
|
29
|
+
|
|
30
|
+
**Semantic Normalization**: The hashing engine distinguishes between a logic change and a formatting change.
|
|
31
|
+
* **SQL**: Comments, whitespace, and case are normalized before hashing.
|
|
32
|
+
* **Python**: Orchestration scripts are parsed into an **Abstract Syntax Tree (AST)** to strip docstrings and formatting variations, ensuring the Experiment ID only changes when execution logic changes.
|
|
33
|
+
|
|
34
|
+
### 2. Multi-Layer Cold-Cache Isolation
|
|
35
|
+
To ensure IO-bound performance is not masked by memory buffers, we implement a dual-layer cold start mechanism:
|
|
36
|
+
* **Out-of-Process (Postgres)**: Mandatory **Docker Container Restarts** before every query to clear engine-level shared buffers.
|
|
37
|
+
* **Global OS Flush (mmap)**: A specialized `thrash_os_cache` primitive that maps and dirties a file larger than physical RAM. This forces the OS to evict Page Cache entries, ensuring cold read performance for both containerized and in-process (DuckDB) engines.
|
|
38
|
+
|
|
39
|
+
### 3. Agentic AI Integration
|
|
40
|
+
The platform is built for the future of **Autonomous Engineering**. The Experiment ID allows AI agents to treat the laboratory as a **Deterministic Performance API**.
|
|
41
|
+
* See [AGENTS.md](AGENTS.md) for the full Agentic Benchmarking Protocol.
|
|
42
|
+
|
|
43
|
+
### 4. Declarative Matrix Orchestration
|
|
44
|
+
Benchmarks are defined as N-dimensional matrices in YAML. The platform expands these into a Cartesian product of **Independent Dagster Partitions**. This allows for parallel dispatch and granular retries.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Usage & Technical Setup
|
|
49
|
+
|
|
50
|
+
### Prerequisites
|
|
51
|
+
* **[uv](https://astral.sh/uv)**: the project's Python environment & dependency manager (fast, modern). `setup.sh` uses it, and it can install Python 3.11 for you.
|
|
52
|
+
* **Python 3.11+**: core runtime (uv provisions it if missing).
|
|
53
|
+
* **Docker**: for the containerized engines (Postgres, TypeDB), which the harness manages itself — *not* required for the DuckDB-only quickstart.
|
|
54
|
+
|
|
55
|
+
### Installation & Setup
|
|
56
|
+
The laboratory includes a comprehensive setup script that manages virtual environments, dependencies, and directory initialization.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 1. Automate Setup
|
|
60
|
+
chmod +x setup.sh && ./setup.sh
|
|
61
|
+
|
|
62
|
+
# 2. Activate Laboratory
|
|
63
|
+
source venv/bin/activate
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### The Execution Workflow (CLI)
|
|
67
|
+
While the system is powered by Dagster, the primary interface is the CLI for automated workflows.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# QUICKSTART: DuckDB only, no Docker required — runs in seconds
|
|
71
|
+
./run.sh sql_benchmarks/experiments/queue/quickstart.yaml --auto
|
|
72
|
+
|
|
73
|
+
# FULL BENCHMARK: Run all queued experiments (requires Docker for Postgres)
|
|
74
|
+
./run.sh queue --auto
|
|
75
|
+
|
|
76
|
+
# SINGLE EXPERIMENT: Pass a specific config path
|
|
77
|
+
./run.sh sql_benchmarks/experiments/queue/quack_execution_modes.yaml --auto
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
To write your own experiment, start from the annotated template and see the
|
|
81
|
+
catalog of published runs in **[docs/experiments.md](docs/experiments.md)**.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Project Structure
|
|
86
|
+
Managed with a strict separation between Harness and Scenario:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
/sql_benchmarks
|
|
90
|
+
├── /assets # THE HARNESS: Dagster factories & pipeline logic
|
|
91
|
+
├── /resources # THE INFRASTRUCTURE: DB drivers & Docker management
|
|
92
|
+
├── /scripts/sql # THE SCENARIOS: Raw SQL partitioned by scenario
|
|
93
|
+
├── /plugins # THE DATA: Declarative generators & scenario providers
|
|
94
|
+
├── /utils # THE BRAIN: AST-hashing, common logic, & system primitives
|
|
95
|
+
└── /experiments # THE LABORATORY
|
|
96
|
+
├── active.yaml # Current active partition matrix
|
|
97
|
+
├── /queue # Staging area for new experiment configs
|
|
98
|
+
├── /archive # Library of previously defined experiment templates
|
|
99
|
+
├── /configs # Registry of immutable, hash-addressed experiment capsules
|
|
100
|
+
└── /results # Data capsules: fragments, CSVs, and Dashboards
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Published Experiments — the Quack investigation
|
|
106
|
+
|
|
107
|
+
The first published study with this lab: an independent measurement of DuckDB's
|
|
108
|
+
**Quack** client-server protocol (beta, v1.5.3). Each row links the runnable
|
|
109
|
+
config to its committed, verifiable capsule. Full numbers, scaling exponents,
|
|
110
|
+
and verification steps in [docs/published_capsules.md](docs/published_capsules.md).
|
|
111
|
+
|
|
112
|
+
| Act | Question | Config | Capsule | Finding |
|
|
113
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
114
|
+
| **I** | What does the protocol cost? | [quack_execution_modes.yaml](sql_benchmarks/experiments/queue/quack_execution_modes.yaml) | `b8e2bfaf` | Attach-mode overhead grows with scan size (2.6× → **9.5×** at 10M rows); pushdown stays flat at ~2×. |
|
|
115
|
+
| **II** | Why is pushdown ~2× and not 1×? | [quack_residual_threads.yaml](sql_benchmarks/experiments/queue/quack_residual_threads.yaml) | `25b0e134` | The residual tracks reduced server-side parallelism (~2–4 of 8 threads), not transport. |
|
|
116
|
+
| **III** | Does it generalize to joins? | [tpch_quack_validation.yaml](sql_benchmarks/experiments/queue/tpch_quack_validation.yaml) | `b198363e` | On canonical TPC-H Q3, pushdown holds (~1.9×); attach mode **cannot run the join at all** (DNF). |
|
|
117
|
+
| **IV** | Does it beat the incumbent? | [quack_vs_postgres.yaml](sql_benchmarks/experiments/queue/quack_vs_postgres.yaml) | `902d1277` | DuckDB-over-Quack (pushdown) beats PostgreSQL by up to **13.2×**, and the gap widens with scale. |
|
|
118
|
+
|
|
119
|
+
*Act 0 (`b82b4eae`) is the exploratory scout that started it — see [docs/published_capsules.md](docs/published_capsules.md).*
|
|
120
|
+
|
|
121
|
+
The lab also ships scenario suites for other studies — `selectivity/`,
|
|
122
|
+
`null_logic/`, `null_sentinel/`, `recursion/`, `sort_spill/`, `tpch/`, and more
|
|
123
|
+
under `sql_benchmarks/scripts/sql/` — each runnable across the engine matrix.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Naming & Provenance
|
|
128
|
+
|
|
129
|
+
The lab works at two layers, named two different ways. Keeping them distinct is
|
|
130
|
+
the difference between a number you can trace and a number you have to trust.
|
|
131
|
+
|
|
132
|
+
| Layer | What it is | Named by | Example |
|
|
133
|
+
| :--- | :--- | :--- | :--- |
|
|
134
|
+
| **Capsule** | one experiment's complete results | its **Experiment ID** — an 8-char SHA-256 of the *question* (config + SQL + measurement code), assigned by the machine | `48c92f31` |
|
|
135
|
+
| **Release** | a signed set of capsules backing a publication | a human name: **`sqlbenchdag-<topic>-v<N>-<YYYYMMDD>`** | `sqlbenchdag-quack-v1-20260614` |
|
|
136
|
+
|
|
137
|
+
A release *contains* capsules; a capsule is one experiment. The machine names
|
|
138
|
+
capsules (hashes you can't forge); the author names releases (words that mean
|
|
139
|
+
something). `sqlbenchdag` is the lab's maker's mark — `sql` + `bench` +
|
|
140
|
+
`dag` (Dagster, the orchestration that distinguishes this lab from a bare query
|
|
141
|
+
timer). It is carried on every release this lab produces.
|
|
142
|
+
|
|
143
|
+
**Two hashes, two jobs** (a capsule contains both — they are not the same thing):
|
|
144
|
+
- the **Experiment ID** (8 chars) is an *address* — it *names* the capsule, and
|
|
145
|
+
the same question always produces the same address;
|
|
146
|
+
- the **integrity seal** (64 chars, in `integrity.seal`) is a *checksum* — it
|
|
147
|
+
*verifies* the capsule's contents are untouched. You file by the address; the
|
|
148
|
+
seal is the tamper-evident lid.
|
|
149
|
+
|
|
150
|
+
**Reproducibility is pinned to the release.** Because the Experiment ID hashes
|
|
151
|
+
the measurement code, it is stable only at a fixed code revision — which is
|
|
152
|
+
exactly what the signed release tag freezes. To reproduce a published capsule,
|
|
153
|
+
check out its release tag and re-run its config; the same question yields the
|
|
154
|
+
same ID, or the comparison is refused by construction.
|
|
155
|
+
|
|
156
|
+
> Provenance roadmap: a per-capsule `generator` stamp (`sqlbenchdag@<commit>`)
|
|
157
|
+
> will record the exact build that produced each capsule. It writes through the
|
|
158
|
+
> finalization code, which lives inside the Experiment-ID hash, so it ships with
|
|
159
|
+
> a future release rather than re-numbering capsules already published.
|
|
160
|
+
|
|
161
|
+
See [docs/published_capsules.md](docs/published_capsules.md) for the full trust
|
|
162
|
+
chain (reproducibility, integrity, timestamp, authorship) and how to verify each.
|
|
163
|
+
Reproducibility and integrity are **automatic** on every run; timestamp and
|
|
164
|
+
signature are **optional** steps you add only when publishing — the producer
|
|
165
|
+
workflow is [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
Copyright 2025-2026 Ramona C. Truta. Licensed under the [Apache License 2.0](LICENSE).
|
|
172
|
+
|
|
173
|
+
Built with **Dagster**, **Polars**, **Docker**, **DuckDB**, and **Postgres**.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import boto3
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
def check_instance_viability():
|
|
5
|
+
# Setup AWS client
|
|
6
|
+
# This will use the credentials from ~/.aws/credentials which the user already set up
|
|
7
|
+
ec2 = boto3.client('ec2', region_name='us-east-1')
|
|
8
|
+
|
|
9
|
+
print("--- DIAGNOSTIC: Checking t2.micro availability ---")
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
# 1. Describe Offerings to find valid AZs for t2.micro
|
|
13
|
+
response = ec2.describe_instance_type_offerings(
|
|
14
|
+
LocationType='availability-zone',
|
|
15
|
+
Filters=[{'Name': 'instance-type', 'Values': ['t2.micro']}]
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
valid_azs = [o['Location'] for o in response['InstanceTypeOfferings']]
|
|
19
|
+
print(f"Valid AZs for t2.micro: {valid_azs}")
|
|
20
|
+
|
|
21
|
+
if not valid_azs:
|
|
22
|
+
print("CRITICAL: t2.micro is NOT available in this region/account.")
|
|
23
|
+
return False
|
|
24
|
+
|
|
25
|
+
# 2. Check current default subnets
|
|
26
|
+
subnets = ec2.describe_subnets(Filters=[{'Name': 'default-for-az', 'Values': ['true']}])
|
|
27
|
+
print(f"Default Subnets Found: {len(subnets['Subnets'])}")
|
|
28
|
+
|
|
29
|
+
for s in subnets['Subnets']:
|
|
30
|
+
print(f" - Subnet {s['SubnetId']} in {s['AvailabilityZone']}")
|
|
31
|
+
|
|
32
|
+
print("--------------------------------------------------")
|
|
33
|
+
return True
|
|
34
|
+
|
|
35
|
+
except Exception as e:
|
|
36
|
+
print(f"AWS Error: {e}")
|
|
37
|
+
return False
|
|
38
|
+
|
|
39
|
+
if __name__ == "__main__":
|
|
40
|
+
check_instance_viability()
|