DOI: https://doi.org/10.1145/3786699
تاريخ النشر: 2026-04-02
المؤلف: Jiale Lao وآخرون
الموضوع الرئيسي: أنظمة قواعد البيانات المتقدمة والاستعلامات
نظرة عامة
يقدم القسم SQLBarber، وهو نظام جديد يستفيد من نماذج اللغة الكبيرة (LLMs) لتوليد أحمال عمل SQL مخصصة وواقعية لأغراض القياس. تواجه الطرق التقليدية لتوليد استعلامات SQL تحديات مثل مخاوف الخصوصية وخيارات التخصيص المحدودة. يعالج SQLBarber هذه القضايا من خلال السماح للمستخدمين بتحديد القيود بلغة طبيعية، مما ينتج بكفاءة كميات كبيرة من الاستعلامات التي تتوافق مع توزيعات التكلفة المحددة من قبل المستخدم، مثل الكاردينالية وتكاليف خطة التنفيذ. يتميز النظام بواجهة إعلانية، وخط أنابيب مدعوم من LLM مع وحدة تصحيح ذاتي لتحسين قوالب SQL، ومحسن بايزي لاستكشاف قيم الشروط لتلبية توزيعات التكلفة المستهدفة.
تظهر التجارب الواسعة أن SQLBarber يقلل بشكل كبير من وقت توليد الاستعلامات بمقدار من مرتبتين إلى ثلاث مراتب ويعزز التوافق مع توزيعات التكلفة المستهدفة مقارنة بالطرق الحالية. تتضمن الأبحاث دراسة إلغاء لتقييم مساهمات المكونات الفردية وتحليل تكلفة لتقييم فعالية تكلفة SQLBarber. يتم اقتراح عمل مستقبلي لتوسيع قدرات SQLBarber لتشمل أحمال معالجة المعاملات عبر الإنترنت (OLTP)، ودمج ميزات سحابية، وتمكين توليد استعلامات دلالية لمعالجة البيانات متعددة الأنماط. تشير النتائج أيضًا إلى أن خصائص الاستعلامات المولدة تتأثر بأنواع وأحجام قواعد البيانات، مما يشير إلى إمكانية النمذجة المشتركة لقواعد البيانات والاستعلامات. بالإضافة إلى ذلك، تم تحديد استكشاف توسيع النظام مع مقاييس التكلفة التي تتطلب تنفيذ SQL الفعلي كاتجاه واعد للبحث المستقبلي.
مقدمة
تقدم مقدمة الورقة SQLBarber، وهو نظام جديد مصمم لتوليد أحمال عمل SQL مخصصة وواقعية باستخدام نماذج اللغة الكبيرة (LLMs). يعالج التحدي المتمثل في إنشاء معايير من إحصائيات أحمال العمل عالية المستوى التي تصدرها شركات مثل أمازون وسنوفليك، والتي تكون محدودة بسبب قيود الخصوصية. تركز الطرق الحالية لتوليد استعلامات SQL، مثل SQLSmith وSQLancer، بشكل أساسي على التنوع والاختبار ولكن تفتقر إلى القدرة على تخصيص قوالب SQL أو الالتزام بتوزيعات التكلفة الواقعية. بالمقابل، يسمح SQLBarber للمستخدمين بتحديد قيود بلغة طبيعية لتوليد قوالب SQL، مما يضمن أن تعكس أحمال العمل المنتجة البيئات الواقعية من خلال الاستفادة من إحصائيات التنفيذ من قواعد البيانات الصناعية.
يستخدم SQLBarber نهجًا مزدوجًا: مولد قوالب SQL موثوق يتضمن آلية تصحيح ذاتي لتحسين القوالب المولدة بناءً على مواصفات المستخدم وتعليقات نظام إدارة قواعد البيانات، ومولد استعلامات مدرك للتكلفة ينتج بكفاءة استعلامات تتماشى مع توزيعات التكلفة المحددة من قبل المستخدم. يستخدم النظام تحسين بايزي لاستكشاف فضاء قيم الشروط وتوليد عدد كبير من الاستعلامات التي تلبي معايير التكلفة المحددة. تدعي الورقة أن SQLBarber يتفوق بشكل كبير على الطرق الحالية من حيث وقت توليد الاستعلامات والتوافق مع توزيعات التكلفة المستهدفة، وتقدم عشرة معايير واقعية لتوليد أحمال عمل SQL بناءً على إحصائيات العالم الحقيقي. يؤكد المؤلفون أن SQLBarber هو أول نظام يجمع بين هذه القدرات بشكل فعال، مما يجعله أداة قيمة للباحثين والممارسين في هذا المجال.
طرق
في قسم “الطرق”، يوضح المؤلفون التقييم التجريبي الذي تم إجراؤه لتقييم النهج المقترح. يتم وصف الإعداد التجريبي بدقة، موضحًا الظروف المحددة التي تم إجراء التجارب فيها، بما في ذلك اختيار المواد والمعدات والعوامل البيئية. هذا الإعداد ضروري لضمان قابلية تكرار النتائج وللتحقق من فعالية المنهجية المستخدمة.
كما يحدد المؤلفون المقاييس المستخدمة للتقييم، والتي قد تشمل مؤشرات الأداء ذات الصلة بأهداف الدراسة. من خلال إنشاء إطار عمل واضح لظروف التجربة ومعايير التقييم، يهدف المؤلفون إلى توفير أساس قوي لتفسير النتائج واستخلاص الاستنتاجات حول فعالية نهجهم.
نقاش
يناقش القسم SQLBarber، وهو نظام مصمم لتوليد أحمال عمل SQL مخصصة وواقعية من خلال الاستفادة من الأفكار المستمدة من الأبحاث السابقة حول توليد الاستعلامات المتنوعة وصياغة استعلامات SQL المقيدة بالتكلفة. يتميز SQLBarber من خلال دمج القيود على قوالب SQL وتكاليف الاستعلام، مما يحول معلومات أحمال العمل عالية المستوى إلى معايير قابلة للتنفيذ. يعتمد على الطرق الحالية مثل SQLSmith وSQLancer وSQLStorm، التي تركز على توليد استعلامات متنوعة دون مثل هذه القيود، ويعززها من خلال استخدام إحصائيات أحمال العمل من العالم الحقيقي لتوجيه عملية التوليد.
يتضمن نهج SQLBarber مكونين رئيسيين: مولد قوالب SQL مخصص ومولد استعلامات مدرك للتكلفة. يستخدم مولد القوالب نماذج اللغة الكبيرة (LLMs) لإنشاء قوالب SQL بناءً على مواصفات المستخدم، مما يضمن أن القوالب المولدة قابلة للتنفيذ ومتوافقة مع القيود المحددة من قبل المستخدم. ثم يقوم مولد الاستعلامات المدرك للتكلفة بتقييم هذه القوالب لتقدير قدرتها على إنتاج استعلامات عبر مستويات تكلفة مختلفة، ويقوم بتحسينها حسب الحاجة لضمان تغطية توزيع التكلفة المطلوب. لا تعزز هذه العملية ذات المرحلتين فقط تنوع وواقعية استعلامات SQL المولدة، بل تعالج أيضًا قيود الطرق الحالية التي تعيد استخدام أو تأخذ عينات من القوالب الموجودة. من خلال التركيز على كل من توليد القوالب وتوزيع التكلفة، يهدف SQLBarber إلى تقديم حل أكثر مرونة وفعالية لتوليد أحمال عمل SQL في سياقات الاختبار والقياس.
DOI: https://doi.org/10.1145/3786699
Publication Date: 2026-04-02
Author(s): Jiale Lao et al.
Primary Topic: Advanced Database Systems and Queries
Overview
The section presents SQLBarber, a novel system leveraging Large Language Models (LLMs) to generate customized and realistic SQL workloads for benchmarking purposes. Traditional methods for SQL query generation face challenges such as privacy concerns and limited customization options. SQLBarber addresses these issues by allowing users to specify constraints in natural language, efficiently generating large volumes of queries that adhere to user-defined cost distributions, such as cardinality and execution plan costs. The system features a declarative interface, an LLM-powered pipeline with a self-correction module for refining SQL templates, and a Bayesian Optimizer for exploring predicate values to meet target cost distributions.
Extensive experiments demonstrate that SQLBarber significantly reduces query generation time by one to two orders of magnitude and enhances alignment with target cost distributions compared to existing methods. The research includes an ablation study to evaluate the contributions of individual components and a cost analysis to assess SQLBarber’s cost-effectiveness. Future work is proposed to extend SQLBarber’s capabilities to Online Transaction Processing (OLTP) workloads, incorporate cloud-native features, and enable the generation of semantic queries for multi-modal data processing. The findings also indicate that the characteristics of generated queries are influenced by database types and sizes, suggesting potential for joint modeling of databases and queries. Additionally, the exploration of scaling the system with cost metrics requiring actual SQL execution is identified as a promising direction for future research.
Introduction
The introduction of the paper presents SQLBarber, a novel system designed to generate customized and realistic SQL workloads using Large Language Models (LLMs). It addresses the challenge of creating benchmarks from high-level workload statistics released by companies like Amazon and Snowflake, which are limited due to privacy constraints. Existing methods for SQL query generation, such as SQLSmith and SQLancer, primarily focus on diversity and testing but lack the ability to customize SQL templates or adhere to realistic cost distributions. In contrast, SQLBarber allows users to specify natural language constraints for SQL template generation, ensuring that the produced workloads reflect real-world environments by leveraging execution statistics from industry databases.
SQLBarber employs a two-pronged approach: a reliable SQL template generator that incorporates a self-correction mechanism to refine generated templates based on user specifications and DBMS feedback, and a cost-aware query generator that efficiently produces queries aligned with user-defined cost distributions. The system utilizes Bayesian Optimization to explore the predicate value space and generate a large number of queries that meet specified cost criteria. The paper claims that SQLBarber significantly outperforms existing methods in terms of query generation time and alignment with target cost distributions, and it introduces ten realistic benchmarks for SQL workload generation based on real-world statistics. The authors assert that SQLBarber is the first system to effectively combine these capabilities, making it a valuable tool for researchers and practitioners in the field.
Methods
In the “Methods” section, the authors detail the experimental evaluation conducted to assess the proposed approach. The experimental setup is meticulously described, outlining the specific conditions under which the experiments were performed, including the selection of materials, equipment, and environmental factors. This setup is crucial for ensuring the reproducibility of the results and for validating the effectiveness of the methodology employed.
The authors also specify the metrics used for evaluation, which may include performance indicators relevant to the study’s objectives. By establishing a clear framework for the experimental conditions and evaluation criteria, the authors aim to provide a robust basis for interpreting the findings and drawing conclusions about the efficacy of their approach.
Discussion
The section discusses SQLBarber, a system designed for generating customized and realistic SQL workloads by leveraging insights from prior research on diverse query generation and cost-constrained SQL query formulation. SQLBarber distinguishes itself by integrating constraints on SQL templates and query costs, transforming high-level workload information into executable benchmarks. It builds on existing methods like SQLSmith, SQLancer, and SQLStorm, which focus on generating diverse queries without such constraints, and enhances them by employing real-world workload statistics to guide the generation process.
SQLBarber’s approach involves two main components: a customized SQL template generator and a cost-aware query generator. The template generator utilizes large language models (LLMs) to create SQL templates based on user specifications, ensuring that the generated templates are executable and compliant with user-defined constraints. The cost-aware query generator then profiles these templates to estimate their ability to produce queries across different cost levels, refining them as necessary to ensure coverage of the desired cost distribution. This dual-phase process not only enhances the diversity and realism of the generated SQL queries but also addresses the limitations of existing methods that primarily reuse or sample from existing templates. By focusing on both template generation and cost distribution, SQLBarber aims to provide a more flexible and effective solution for SQL workload generation in testing and benchmarking contexts.
