Update README.md
Browse files
README.md
CHANGED
|
@@ -1,22 +1,25 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: cc-by-nc-4.0
|
| 3 |
-
task_categories:
|
| 4 |
-
- text-generation
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Enterprise Database Query Plan Optimization & Remediation Traces (Community Preview)
|
| 22 |
|
|
@@ -24,62 +27,83 @@ size_categories:
|
|
| 24 |
<img src="dataset_product_cover_1024.png" alt="Dataset Banner" width="700"/>
|
| 25 |
</p>
|
| 26 |
|
| 27 |
-
##
|
| 28 |
-
|
| 29 |
|
| 30 |
-
This
|
| 31 |
|
| 32 |
---
|
| 33 |
|
| 34 |
-
##
|
| 35 |
-
|
| 36 |
-
> **Evaluation Notice:** This Hugging Face edition is a **Community Preview (250 verified traces)** licensed strictly under **CC BY-NC 4.0** for non-commercial research and evaluation.
|
| 37 |
-
|
| 38 |
-
To acquire the **Full Commercial Training Corpus (2,500 Records in JSONL + Parquet)** with an unrestricted commercial license for fine-tuning private models, agent tool-use, or RAG pipelines:
|
| 39 |
-
|
| 40 |
-
👉 **[Purchase Enterprise Commercial License via Dodo Payments](https://checkout.dodopayments.com/buy/pdt_sql_2500_xxxx)**
|
| 41 |
-
|
| 42 |
-
### Enterprise Distribution Splits
|
| 43 |
|
| 44 |
| Split | Records | Format | Primary Use Case | License |
|
| 45 |
| :--- | :--- | :--- | :--- | :--- |
|
| 46 |
-
| **Community Evaluation** | 250 | Parquet | Benchmarking, zero-shot
|
| 47 |
-
| **Enterprise Commercial** | 2,500 | Parquet + JSONL |
|
| 48 |
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
### Field Definitions
|
| 63 |
|
| 64 |
| Field | Data Type | Description |
|
| 65 |
| :--- | :--- | :--- |
|
| 66 |
-
| `database_engine` | `string` | Target engine
|
| 67 |
| `slow_query` | `string` | Realistic unoptimized SQL query triggering runtime performance degradation. |
|
| 68 |
| `execution_plan` | `string` | Raw optimizer output (`EXPLAIN (ANALYZE, BUFFERS)` or JSON plan) exposing node bottlenecks. |
|
| 69 |
| `diagnostic_thought` | `string` | Step-by-step reasoning diagnosing node cost, row estimate deltas, and I/O buffer behavior. |
|
| 70 |
-
| `remediation_ddl` | `string` |
|
| 71 |
| `optimized_query` | `string` | Performant rewritten query strictly adhering to engine dialect grammar. |
|
| 72 |
|
| 73 |
---
|
| 74 |
|
| 75 |
-
##
|
| 76 |
|
| 77 |
-
```
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
|
|
|
| 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_sql_2500_xxxx)**
|
| 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.
|