|
Download README.md from ayushjoshi2012/sql-optimization-diagnostic-traces: direct link, hf CLI and curl.
- Browser
- Download file 4.49 kB
-
https://huggingface.co/datasets/ayushjoshi2012/sql-optimization-diagnostic-traces/resolve/main/README.md
- Command line
-
hf download hf://datasets/ayushjoshi2012/sql-optimization-diagnostic-traces/README.md
-
curl -L -o README.md https://huggingface.co/datasets/ayushjoshi2012/sql-optimization-diagnostic-traces/resolve/main/README.md
4.49 kB
| license: cc-by-nc-4.0 | |
| task_categories: | |
| - text-generation | |
| - question-answering | |
| language: | |
| - en | |
| tags: | |
| - sql | |
| - database | |
| - query-optimization | |
| - explain-analyze | |
| - postgresql | |
| - mysql | |
| - clickhouse | |
| - cockroachdb | |
| - dba | |
| - fine-tuning | |
| pretty_name: "Enterprise Database Query Plan Optimization & Remediation Traces" | |
| size_categories: | |
| - 100<n<1K | |
| # Enterprise Database Query Plan Optimization & Remediation Traces (Community Preview) | |
| <p align="center"> | |
| <img src="dataset_product_cover_1024.png" alt="Dataset Banner" width="700"/> | |
| </p> | |
| ## Overview | |
| High-concurrency database workloads frequently degrade due to optimizer plan misestimations, unindexed correlated joins, merge-sort memory spills, and non-sargable expressions. | |
| 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. | |
| --- | |
| ## Dataset Splits & Commercial Licensing | |
| | Split | Records | Format | Primary Use Case | License | | |
| | :--- | :--- | :--- | :--- | :--- | | |
| | **Community Evaluation** (This Repo) | 250 | Parquet | Benchmarking, zero-shot eval, research | **CC BY-NC 4.0** | | |
| | **Enterprise Commercial Corpus** | 2,500 | Parquet + JSONL | Production fine-tuning (SFT/DPO), commercial DBA agents | **Commercial Enterprise License** | | |
| ### Complete Enterprise Corpus (2,500 Records) | |
| For production model deployment, proprietary agent training, or private RAG pipelines without non-commercial restrictions: | |
| 👉 **[Acquire Enterprise Commercial License & Dataset via Dodo Payments](https://checkout.dodopayments.com/buy/pdt_0NqD7nyGBW7fVDMd1Fm2l)** | |
| --- | |
| ## Data Structure & Schema | |
| ```json | |
| { | |
| "database_engine": "string", | |
| "slow_query": "string", | |
| "execution_plan": "string", | |
| "diagnostic_thought": "string", | |
| "remediation_ddl": "string", | |
| "optimized_query": "string" | |
| } | |
| ``` | |
| ### Field Definitions | |
| | Field | Data Type | Description | | |
| | :--- | :--- | :--- | | |
| | `database_engine` | `string` | Target engine dialect & exact version (e.g., `PostgreSQL 16.2`, `ClickHouse 24.3`). | | |
| | `slow_query` | `string` | Realistic unoptimized SQL query triggering runtime performance degradation. | | |
| | `execution_plan` | `string` | Raw optimizer output (`EXPLAIN (ANALYZE, BUFFERS)` or JSON plan) exposing node bottlenecks. | | |
| | `diagnostic_thought` | `string` | Step-by-step reasoning diagnosing node cost, row estimate deltas, and I/O buffer behavior. | | |
| | `remediation_ddl` | `string` | Executable DDL statements (`CREATE INDEX CONCURRENTLY`, table parameter tuning). | | |
| | `optimized_query` | `string` | Performant rewritten query strictly adhering to engine dialect grammar. | | |
| --- | |
| ## Quickstart (Hugging Face Datasets) | |
| ```python | |
| from datasets import load_dataset | |
| # Load Community Preview | |
| dataset = load_dataset("ayushjoshi2012/sql-optimization-diagnostic-traces", split="train") | |
| # Inspect a single diagnostic trace | |
| sample = dataset[0] | |
| print(f"Engine: {sample['database_engine']}") | |
| print(f"Slow Query:\n{sample['slow_query']}") | |
| print(f"Diagnosis:\n{sample['diagnostic_thought']}") | |
| print(f"Remediation DDL:\n{sample['remediation_ddl']}") | |
| print(f"Rewritten Query:\n{sample['optimized_query']}") | |
| ``` | |
| --- | |
| ## Core Domain Taxonomy | |
| Traces are generated across representative enterprise schema designs: | |
| * **Fintech & Ledger Core:** Double-entry ledger scans, implicit UUID-to-integer type coercion, balance aggregations. | |
| * **IoT & Telematics:** Granule skip-index mismatches, partition decompression stalls, time-bucket groupings. | |
| * **B2B SaaS & Security:** High-offset tenant audit logs, soft-delete booleans, unindexed RBAC joins. | |
| * **Healthcare & EHR:** Unindexed composite foreign keys, leading-wildcard text filters, outdated optimizer statistics. | |
| * **Freight & Global Logistics:** Disk-spilling merge joins on departure timestamps, Cartesian row multiplication. | |
| * **AdTech & Gaming Telemetry:** Unindexed streaming click joins, unbounded window function sorts, leaderboard lock contention. | |
| --- | |
| ## Citation & Contact | |
| For inquiries regarding custom synthetic domain generation, enterprise site licenses, or data additions, please commentinitiate a new discussion. |