Abstract
Machine learning has become a prominent approach for many database optimization problems, including cost estimation, cardinality estimation, and query optimization. However, the task of feature selection and encoding for machine learning in database tasks presents significant challenges. Recently, some representation methods have been proposed that utilize physical plan or SQL query as feature. However, these methods have two limitations. Firstly, they often rely on the selection of workloads using either the physical plan or the SQL query alone, which is not comprehensive enough to fully represent the characteristics of the database. Secondly, early feature extraction and encoding methods are not applicable to the database workload.
To tackle these limitations, we propose PQSEncoder, a feature representation model designed to address various database optimization challenges. In this approach, we integrate the physical plan, SQL query, and database schema to construct the workload of the database. Feature extraction and encoding are performed for each type, followed by feature fusion to compose the workload’s features, which can then be used for machine learning tasks in database optimization. We incorporate PQSEncoder into two machine learning models for database optimization tasks, and experimental results show that PQSEncoder substantially improves the performance of these models.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Bogin, B., Berant, J., Gardner, M.: Representing schema structure with graph neural networks for text-to-SQL parsing. In: Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4560–4565 (2019)
Ding, B., Das, S., Marcus, R., Wu, W., Chaudhuri, S., Narasayya, V.R.: AI meets AI: leveraging query executions to improve index recommendations. In: Proceedings of the 2019 International Conference on Management of Data, pp. 1241–1258 (2019)
Juszczak, P., Tax, D., Duin, R.P.: Feature scaling in support vector data description. In: Proceedings of the ASCI, pp. 95–102. Citeseer (2002)
Kenton, J.D.M.W.C., Toutanova, L.K.: BERT: Pre-training of deep bidirectional transformers for language understanding. In: Proceedings of naacL-HLT, vol. 1, p. 2 (2019)
Kipf, A., Kipf, T., Radke, B., Leis, V., Boncz, P., Kemper, A.: Learned cardinalities: Estimating correlated joins with deep learning. In: 9th Biennial Conference on Innovative Data Systems Research (CIDR 2019) (2019)
Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907 (2016)
Kipf, T.N., Welling, M.: Variational graph auto-encoders. arXiv preprint arXiv:1611.07308 (2016)
Krizhevsky, A., Sutskever, I., Hinton, G.E.: ImageNet classification with deep convolutional neural networks. In: NIPS, vol. 25 (2012)
Leis, V., Gubichev, A., Mirchev, A., Boncz, P., Kemper, A., Neumann, T.: How good are query optimizers, really? Proc. VLDB Endow. 9(3), 204–215 (2015)
Li, G., Zhou, X., Li, S., Gao, B.: QTune: a query-aware database tuning system with deep reinforcement learning. Proc. VLDB Endow. 12(12), 2118–2130 (2019)
Marcus, R., Negi, P., Mao, H., Tatbul, N., Alizadeh, M., Kraska, T.: Bao: making learned query optimization practical. In: Proceedings of the 2021 International Conference on Management of Data, pp. 1275–1288 (2021)
Marcus, R., et al.: Neo: a learned query optimizer. Proc. VLDB Endow. 12(11), 1705–1718 (2019)
Mou, L., Li, G., Zhang, L., Wang, T., Jin, Z.: Convolutional neural networks over tree structures for programming language processing. In: Proceedings of the AAAI Conference on Artificial Intelligence, vol. 30 (2016)
Rifai, S., Vincent, P., Muller, X., Glorot, X., Bengio, Y.: Contractive auto-encoders: explicit invariance during feature extraction. In: Proceedings of the 28th International Conference on International Conference on Machine Learning, pp. 833–840 (2011)
Seger, C.: An investigation of categorical variable encoding techniques in machine learning: binary versus one-hot and feature hashing (2018)
Siddiqui, T., Jindal, A., Qiao, S., Patel, H., Le, W.: Cost models for big data query processing: learning, retrofitting, and our findings. In: Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, pp. 99–113 (2020)
Sun, J., Li, G.: An end-to-end learning-based cost estimator. Proc. VLDB Endow. 13(3)
Tai, K.S., Socher, R., Manning, C.D.: Improved semantic representations from tree-structured long short-term memory networks. In: Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1556–1566 (2015)
Tang, X., Wu, S., Song, M., Ying, S., Li, F., Chen, G.: PreQR: pre-training representation for SQL understanding. In: Proceedings of the 2022 International Conference on Management of Data, pp. 204–216 (2022)
Woo, S., Park, J., Lee, J.Y., Kweon, I.S.: CBAM: convolutional block attention module. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 3–19 (2018)
Wu, Y., et al.: Google’s neural machine translation system: bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144 (2016)
Yu, X., Li, G., Chai, C., Tang, N.: Reinforcement learning with tree-LSTM for join order selection. In: 2020 IEEE 36th International Conference on Data Engineering (ICDE), pp. 1297–1308. IEEE (2020)
Yuan, H., Li, G., Feng, L., Sun, J., Han, Y.: Automatic view generation with deep learning and reinforcement learning. In: 2020 IEEE 36th International Conference on Data Engineering (ICDE), pp. 1501–1512. IEEE (2020)
Zhang, J., et al.: An end-to-end automatic cloud database tuning system using deep reinforcement learning. In: Proceedings of the 2019 International Conference on Management of Data, pp. 415–432 (2019)
Zhao, Y., Cong, G., Shi, J., Miao, C.: QueryFormer: a tree transformer model for query plan representation. Proc. VLDB Endow. 15(8), 1658–1670 (2022)
Acknowledgements
This work is supported by the Key R&D Program of Shandong Province under Grant 2021CXGC010104, and the National Key R&D Program of China under Grant 2022YFF0503900. Author Jin Yan would like to thank the ANSO Scholarship for Young Talents for sponsorship during prusuphding her PhD degree.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Yang, J., Zhang, Q., Yan, J., Ding, Z., Zhu, M., Lv, X. (2024). QPSEncoder: A Database Workload Encoder with Deep Learning. In: Strauss, C., Amagasa, T., Manco, G., Kotsis, G., Tjoa, A.M., Khalil, I. (eds) Database and Expert Systems Applications. DEXA 2024. Lecture Notes in Computer Science, vol 14910. Springer, Cham. https://doi.org/10.1007/978-3-031-68309-1_9
Download citation
DOI: https://doi.org/10.1007/978-3-031-68309-1_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-68308-4
Online ISBN: 978-3-031-68309-1
eBook Packages: Computer ScienceComputer Science (R0)