File size: 1,738 Bytes
86cbcc9
 
 
 
 
 
 
 
 
 
 
 
 
 
fb209c4
 
86cbcc9
fb209c4
 
 
 
 
 
 
 
86cbcc9
fb209c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86cbcc9
fb209c4
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: apache-2.0
language:
- en
task_categories:
- text-generation
tags:
- sql
- postgresql
- sql-optimization
- benchmark
pretty_name: Effi-SQL
---

# Effi-SQL

## Update 2026-06-12

We release **Effi-SQL**, a dataset suite for SQL efficiency optimization.

This collection includes:

- **Effi-SQL Benchmark**: a benchmark for evaluating SQL efficiency optimization methods.
- **Diff-SQL Training Dataset**: training data used by Diff-SQL, including data for the Patch Generator and Constraint Aligner.

## Dataset Fields

### Effi-SQL Benchmark

- **id**: A unique identifier for each benchmark instance.
- **db**: The database name.
- **base_sql**: The original slow SQL query.
- **optimized_sql**: The human-verified optimized SQL query.
- **base_time**: Execution time of the original SQL query.
- **fast_time**: Execution time of the optimized SQL query.
- **base_explain_analyze**: Query execution plan (QEP) output for the original SQL query.
- **optimized_explain_analyze**: Query execution plan (QEP) output for the optimized SQL query.
- **difficulty**: The difficulty label of the benchmark instance.

### Diff-SQL Training Dataset

- **instance_id**: A unique identifier for each training instance.
- **prompt**: The model input prompt, including the slow SQL query, relevant database information, and the query execution plan of the slow SQL query.
- **response**: The target response, including optimization or refinement reasoning and the target patch.
- **db**: The database name of the slow SQL query.
- **base_sql**: The original slow SQL query.
- **optimized_sql**: The optimized SQL query used as the reference target.

## Related Resources

- **Code**: [L-nshpp/Diff-SQL](https://github.com/L-nshpp/Diff-SQL)