Generating Custom Learned Cost Model for Query Optimizer of DBMS
摘要
Designers and developers of database management systems (DBMS) build increasingly specialized efficient query optimizer in order to deliver improved performance. This query optimizer uses a database Cost Model (CM) that is embedded inside these DBMSs. Currently, database CMs have to be manually calibrated for each database technology evolution and new requirements which is a costly and error prone process. Moreover, writing CM programs on DBMS distribution code like PostgreSQL and MySQL for specific platforms is hard since this requires the code to be tuned at a low level with architecture of the query optimizer that are fundamentally based on general-purpose programming languages. In this paper, we propose a framework to design and calibrate automatically the cost model of the query optimizer automatically. Our framework provides a code generation that allow user applications to fully generate the cost of database operation of a target DBMS by changing the model specification (e.g. the data primitives of the used data layout, data indexing, and the chosen algorithm of database operations). In addition, to CM code specialization for a specific hardware platform requires a machine learning component that is used as an external tool to automatically calibrate the CM under design. A proof-of-concept prototype is implemented by considering the CM that exists in PostgreSQL optimizer.