ayushjoshi2012 commited on
Commit
d9db267
·
verified ·
1 Parent(s): d9f1a6f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +108 -108
README.md CHANGED
@@ -1,109 +1,109 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- task_categories:
4
- - text-generation
5
- - question-answering
6
- language:
7
- - en
8
- tags:
9
- - sql
10
- - database
11
- - query-optimization
12
- - explain-analyze
13
- - postgresql
14
- - mysql
15
- - clickhouse
16
- - cockroachdb
17
- - dba
18
- - fine-tuning
19
- pretty_name: Enterprise Database Query Plan Optimization & Remediation Traces
20
- size_categories:
21
- - 1K<n<10K
22
- ---
23
-
24
- # Enterprise Database Query Plan Optimization & Remediation Traces (Community Preview)
25
-
26
- <p align="center">
27
- <img src="dataset_product_cover_1024.png" alt="Dataset Banner" width="700"/>
28
- </p>
29
-
30
- ## Overview
31
- High-concurrency database workloads frequently degrade due to optimizer plan misestimations, unindexed correlated joins, merge-sort memory spills, and non-sargable expressions.
32
-
33
- This repository hosts the **Community Preview (250 verified traces)** of an architectural fine-tuning dataset spanning **PostgreSQL 16, MySQL 8.0, ClickHouse 24, CockroachDB, MariaDB, and SQLite**. Each record pairs an authentic production query regression and raw execution plan (`EXPLAIN ANALYZE`) with chain-of-thought architectural diagnosis, actionable remediation DDL, and dialect-compliant optimized queries.
34
-
35
- ---
36
-
37
- ## Dataset Splits & Commercial Licensing
38
-
39
- | Split | Records | Format | Primary Use Case | License |
40
- | :--- | :--- | :--- | :--- | :--- |
41
- | **Community Evaluation** (This Repo) | 250 | Parquet | Benchmarking, zero-shot eval, research | **CC BY-NC 4.0** |
42
- | **Enterprise Commercial Corpus** | 2,500 | Parquet + JSONL | Production fine-tuning (SFT/DPO), commercial DBA agents | **Commercial Enterprise License** |
43
-
44
- ### Complete Enterprise Corpus (2,500 Records)
45
- For production model deployment, proprietary agent training, or private RAG pipelines without non-commercial restrictions:
46
-
47
- 👉 **[Acquire Enterprise Commercial License & Dataset via Dodo Payments](https://checkout.dodopayments.com/buy/pdt_0NqD7nyGBW7fVDMd1Fm2l)**
48
-
49
- ---
50
-
51
- ## Data Structure & Schema
52
-
53
- ```json
54
- {
55
- "database_engine": "string",
56
- "slow_query": "string",
57
- "execution_plan": "string",
58
- "diagnostic_thought": "string",
59
- "remediation_ddl": "string",
60
- "optimized_query": "string"
61
- }
62
- ```
63
-
64
- ### Field Definitions
65
-
66
- | Field | Data Type | Description |
67
- | :--- | :--- | :--- |
68
- | `database_engine` | `string` | Target engine dialect & exact version (e.g., `PostgreSQL 16.2`, `ClickHouse 24.3`). |
69
- | `slow_query` | `string` | Realistic unoptimized SQL query triggering runtime performance degradation. |
70
- | `execution_plan` | `string` | Raw optimizer output (`EXPLAIN (ANALYZE, BUFFERS)` or JSON plan) exposing node bottlenecks. |
71
- | `diagnostic_thought` | `string` | Step-by-step reasoning diagnosing node cost, row estimate deltas, and I/O buffer behavior. |
72
- | `remediation_ddl` | `string` | Executable DDL statements (`CREATE INDEX CONCURRENTLY`, table parameter tuning). |
73
- | `optimized_query` | `string` | Performant rewritten query strictly adhering to engine dialect grammar. |
74
-
75
- ---
76
-
77
- ## Quickstart (Hugging Face Datasets)
78
-
79
- ```python
80
- from datasets import load_dataset
81
-
82
- # Load Community Preview
83
- dataset = load_dataset("ayushjoshi2012/sql-optimization-diagnostic-traces", split="train")
84
-
85
- # Inspect a single diagnostic trace
86
- sample = dataset[0]
87
- print(f"Engine: {sample['database_engine']}")
88
- print(f"Slow Query:\n{sample['slow_query']}")
89
- print(f"Diagnosis:\n{sample['diagnostic_thought']}")
90
- print(f"Remediation DDL:\n{sample['remediation_ddl']}")
91
- print(f"Rewritten Query:\n{sample['optimized_query']}")
92
- ```
93
-
94
- ---
95
-
96
- ## Core Domain Taxonomy
97
-
98
- Traces are generated across representative enterprise schema designs:
99
- * **Fintech & Ledger Core:** Double-entry ledger scans, implicit UUID-to-integer type coercion, balance aggregations.
100
- * **IoT & Telematics:** Granule skip-index mismatches, partition decompression stalls, time-bucket groupings.
101
- * **B2B SaaS & Security:** High-offset tenant audit logs, soft-delete booleans, unindexed RBAC joins.
102
- * **Healthcare & EHR:** Unindexed composite foreign keys, leading-wildcard text filters, outdated optimizer statistics.
103
- * **Freight & Global Logistics:** Disk-spilling merge joins on departure timestamps, Cartesian row multiplication.
104
- * **AdTech & Gaming Telemetry:** Unindexed streaming click joins, unbounded window function sorts, leaderboard lock contention.
105
-
106
- ---
107
-
108
- ## Citation & Contact
109
  For inquiries regarding custom synthetic domain generation, enterprise site licenses, or data additions, please commentinitiate a new discussion.
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ task_categories:
4
+ - text-generation
5
+ - question-answering
6
+ language:
7
+ - en
8
+ tags:
9
+ - sql
10
+ - database
11
+ - query-optimization
12
+ - explain-analyze
13
+ - postgresql
14
+ - mysql
15
+ - clickhouse
16
+ - cockroachdb
17
+ - dba
18
+ - fine-tuning
19
+ pretty_name: "Enterprise Database Query Plan Optimization & Remediation Traces"
20
+ size_categories:
21
+ - 100<n<1K
22
+ ---
23
+
24
+ # Enterprise Database Query Plan Optimization & Remediation Traces (Community Preview)
25
+
26
+ <p align="center">
27
+ <img src="dataset_product_cover_1024.png" alt="Dataset Banner" width="700"/>
28
+ </p>
29
+
30
+ ## Overview
31
+ High-concurrency database workloads frequently degrade due to optimizer plan misestimations, unindexed correlated joins, merge-sort memory spills, and non-sargable expressions.
32
+
33
+ This repository hosts the **Community Preview (250 verified traces)** of an architectural fine-tuning dataset spanning **PostgreSQL 16, MySQL 8.0, ClickHouse 24, CockroachDB, MariaDB, and SQLite**. Each record pairs an authentic production query regression and raw execution plan (`EXPLAIN ANALYZE`) with chain-of-thought architectural diagnosis, actionable remediation DDL, and dialect-compliant optimized queries.
34
+
35
+ ---
36
+
37
+ ## Dataset Splits & Commercial Licensing
38
+
39
+ | Split | Records | Format | Primary Use Case | License |
40
+ | :--- | :--- | :--- | :--- | :--- |
41
+ | **Community Evaluation** (This Repo) | 250 | Parquet | Benchmarking, zero-shot eval, research | **CC BY-NC 4.0** |
42
+ | **Enterprise Commercial Corpus** | 2,500 | Parquet + JSONL | Production fine-tuning (SFT/DPO), commercial DBA agents | **Commercial Enterprise License** |
43
+
44
+ ### Complete Enterprise Corpus (2,500 Records)
45
+ For production model deployment, proprietary agent training, or private RAG pipelines without non-commercial restrictions:
46
+
47
+ 👉 **[Acquire Enterprise Commercial License & Dataset via Dodo Payments](https://checkout.dodopayments.com/buy/pdt_0NqD7nyGBW7fVDMd1Fm2l)**
48
+
49
+ ---
50
+
51
+ ## Data Structure & Schema
52
+
53
+ ```json
54
+ {
55
+ "database_engine": "string",
56
+ "slow_query": "string",
57
+ "execution_plan": "string",
58
+ "diagnostic_thought": "string",
59
+ "remediation_ddl": "string",
60
+ "optimized_query": "string"
61
+ }
62
+ ```
63
+
64
+ ### Field Definitions
65
+
66
+ | Field | Data Type | Description |
67
+ | :--- | :--- | :--- |
68
+ | `database_engine` | `string` | Target engine dialect & exact version (e.g., `PostgreSQL 16.2`, `ClickHouse 24.3`). |
69
+ | `slow_query` | `string` | Realistic unoptimized SQL query triggering runtime performance degradation. |
70
+ | `execution_plan` | `string` | Raw optimizer output (`EXPLAIN (ANALYZE, BUFFERS)` or JSON plan) exposing node bottlenecks. |
71
+ | `diagnostic_thought` | `string` | Step-by-step reasoning diagnosing node cost, row estimate deltas, and I/O buffer behavior. |
72
+ | `remediation_ddl` | `string` | Executable DDL statements (`CREATE INDEX CONCURRENTLY`, table parameter tuning). |
73
+ | `optimized_query` | `string` | Performant rewritten query strictly adhering to engine dialect grammar. |
74
+
75
+ ---
76
+
77
+ ## Quickstart (Hugging Face Datasets)
78
+
79
+ ```python
80
+ from datasets import load_dataset
81
+
82
+ # Load Community Preview
83
+ dataset = load_dataset("ayushjoshi2012/sql-optimization-diagnostic-traces", split="train")
84
+
85
+ # Inspect a single diagnostic trace
86
+ sample = dataset[0]
87
+ print(f"Engine: {sample['database_engine']}")
88
+ print(f"Slow Query:\n{sample['slow_query']}")
89
+ print(f"Diagnosis:\n{sample['diagnostic_thought']}")
90
+ print(f"Remediation DDL:\n{sample['remediation_ddl']}")
91
+ print(f"Rewritten Query:\n{sample['optimized_query']}")
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Core Domain Taxonomy
97
+
98
+ Traces are generated across representative enterprise schema designs:
99
+ * **Fintech & Ledger Core:** Double-entry ledger scans, implicit UUID-to-integer type coercion, balance aggregations.
100
+ * **IoT & Telematics:** Granule skip-index mismatches, partition decompression stalls, time-bucket groupings.
101
+ * **B2B SaaS & Security:** High-offset tenant audit logs, soft-delete booleans, unindexed RBAC joins.
102
+ * **Healthcare & EHR:** Unindexed composite foreign keys, leading-wildcard text filters, outdated optimizer statistics.
103
+ * **Freight & Global Logistics:** Disk-spilling merge joins on departure timestamps, Cartesian row multiplication.
104
+ * **AdTech & Gaming Telemetry:** Unindexed streaming click joins, unbounded window function sorts, leaderboard lock contention.
105
+
106
+ ---
107
+
108
+ ## Citation & Contact
109
  For inquiries regarding custom synthetic domain generation, enterprise site licenses, or data additions, please commentinitiate a new discussion.