DACE: A Database-Agnostic Cost Estimator

Published: 01 Jan 2024, Last Modified: 25 Feb 2025ICDE 2024EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: Cost estimation is of great importance in query optimization. However, traditional optimizers compute the cost based on heuristics, sacrificing accuracy for efficiency. In recent years, learning-based cost estimation models have achieved high accuracy. However, their poor robustness and inefficiency lead to their failure to meet the needs of practical scenarios. We propose a lightweight and Database-Agnostic Cost Estimation model (DACE) to address the above limitations. To further improve the effectiveness of DACE, we design a tree-structure-based loss adjustment strategy to learn sub-plan information and solve the information redundancy problem. As a pretrained estimator, DACE can efficiently make accurate predictions on unseen databases. For more complex scenarios, we fine-tune DACE with LoRA. The excellent efficiency allows DACE to adapt to challenging scenarios with minimal effort. As a pretrained encoder, DACE can improve the accuracy and robustness of other cost estimation models through knowledge integration and solve the notorious cold start problem. Extensive experiments have shown that DACE's accuracy, efficiency, and robustness are much better than existing methods.
Loading