Nothing Special   »   [go: up one dir, main page]

Skip to main content

QPSEncoder: A Database Workload Encoder with Deep Learning

  • Conference paper
  • First Online:
Database and Expert Systems Applications (DEXA 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14910))

Included in the following conference series:

  • 260 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 149.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. 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)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. Juszczak, P., Tax, D., Duin, R.P.: Feature scaling in support vector data description. In: Proceedings of the ASCI, pp. 95–102. Citeseer (2002)

    Google Scholar 

  4. 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)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. Kipf, T.N., Welling, M.: Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907 (2016)

  7. Kipf, T.N., Welling, M.: Variational graph auto-encoders. arXiv preprint arXiv:1611.07308 (2016)

  8. Krizhevsky, A., Sutskever, I., Hinton, G.E.: ImageNet classification with deep convolutional neural networks. In: NIPS, vol. 25 (2012)

    Google Scholar 

  9. 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)

    Article  Google Scholar 

  10. 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)

    Article  Google Scholar 

  11. 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)

    Google Scholar 

  12. Marcus, R., et al.: Neo: a learned query optimizer. Proc. VLDB Endow. 12(11), 1705–1718 (2019)

    Article  Google Scholar 

  13. 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)

    Google Scholar 

  14. 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)

    Google Scholar 

  15. Seger, C.: An investigation of categorical variable encoding techniques in machine learning: binary versus one-hot and feature hashing (2018)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. Sun, J., Li, G.: An end-to-end learning-based cost estimator. Proc. VLDB Endow. 13(3)

    Google Scholar 

  18. 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)

    Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Google Scholar 

  21. Wu, Y., et al.: Google’s neural machine translation system: bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144 (2016)

  22. 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)

    Google Scholar 

  23. 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)

    Google Scholar 

  24. 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)

    Google Scholar 

  25. 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)

    Article  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Jin Yan .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics