Implementation of the Isolation Forest Algorithm for Mysql Query Performance Anomaly Detection Based on Data Performance Schema

Authors

  • Tengku Didi Ferdillah Tengku STMIK Kaputama
  • Relita Buaton STMIK Kaputama
  • Siswan Syahputra STMIK Kaputama

DOI:

https://doi.org/10.59934/jaiea.v5i1.1362

Keywords:

Anomaly Detection, Isolation Forest, Query Performance, Machine Learning

Abstract

Monitoring query performance in database systems is often a manual and reactive process, proving inefficient for the early detection of issues that can impact application stability. This research aims to design and implement a system for automated and proactive query performance anomaly detection. This system utilizes data from MySQL's Performance Schema and applies an unsupervised machine learning algorithm, namely Isolation Forest, to identify queries with unusual behavior based on eight researcher-selected performance metrics. The detection process is implemented to run periodically in the background and send early notifications via email. Experiments were conducted by varying the contamination parameter, with the model's performance evaluated using Precision, Recall, and F1-Score metrics. The experimental results indicate that the configuration with contamination=0.1 yielded the most optimal performance, achieving an F1-Score of 0.39 and a Recall of 100% for the anomaly class. The developed system successfully demonstrated its ability to detect various types of anomalies, including the N+1 query problem, and offers an efficient solution to proactively improve database system performance.

Downloads

Download data is not yet available.

References

K. E. Permana, K. Sophan, A. Muntasa, and A. B. Rahmat, “Perbandingan Kinerja Query Sql Join Tables Dengan Menggunakan Index Performance Comparison of Query Sql Join Tables Using Index,” J. SimanteC, vol. 11, no. 2, pp. 241–248, 2023, [Online]. Available: https://github.com/datacharmer/test_db.

G. Yudhy Kusuma and U. Y. Oktiawati, “Perancangan Sistem Monitoring Performa Aplikasi Menggunakan Opentelemetry dan Grafana Stack,” J. Internet Softw. Eng., vol. 3, no. 1, pp. 26–35, 2022, [Online]. Available: http://34.128.121.13:5000/v1/campaigns

R. Pamungkas, “Optimalisasi Query Dalam Basis Data My Sql Menggunakan Index,” Res. Comput. Inf. Syst. Technol. Manag., vol. 1, no. 1, p. 27, 2018, doi: 10.25273/research.v1i1.2453.

Wijoyo A, Saputra A, Ristanti S, Sya’ban S, Amalia M, and Febriansyah R, “Pembelajaran Machine Learning,” OKTAL (Jurnal Ilmu Komput. dan Sci., vol. 3, no. 2, pp. 375–380, 2024, [Online]. Available: https://journal.mediapublikasi.id/index.php/oktal/article/view/2305

A. Roihan, P. A. Sunarya, and A. S. Rafika, “Pemanfaatan Machine Learning dalam Berbagai Bidang: Review paper,” IJCIT (Indonesian J. Comput. Inf. Technol., vol. 5, no. 1, pp. 75–82, 2020, doi: 10.31294/ijcit.v5i1.7951.

Z. Fang et al., “Towards a Unified Framework of Clustering-based Anomaly Detection,” 2024, [Online]. Available: http://arxiv.org/abs/2406.00452

F. T. Liu, K. M. Ting, and Z. H. Zhou, “Isolation forest,” Proc. - IEEE Int. Conf. Data Mining, ICDM, pp. 413–422, 2008, doi: 10.1109/ICDM.2008.17.

K. Syahputri, M. Irwan, and P. Nasution, “Peran Database Dalam Sistem Informasi Manajemen,” J. Akunt. Keuang. dan Bisnis, vol. 1, no. 2, pp. 54–58, 2023, [Online]. Available: https://jurnal.ittc.web.id/index.php/jakbs/article/view/36

U. Kalsum Siregar, T. Arbaim Sitakar, S. Haramain, Z. Nur Salamah Lubis, U. Nadhirah, and F. Sains dan Teknologi, “Pengembangan database Management system menggunakan My SQL,” SAINTEK J. Sains, Teknol. Komput., vol. 1, no. 1, pp. 8–12, 2024.

W. Andriyani and P. Pujianto, “Maintaining Query Performance through Table Rebuilding & Archiving,” IJCCS (Indonesian J. Comput. Cybern. Syst., vol. 18, no. 1, p. 73, 2024, doi: 10.22146/ijccs.90062.

dev.mysql.com, “Chapter 29 MySQL Performance Schema,” dev.mysql.com. Accessed: Feb. 01, 2025. [Online]. Available: https://dev.mysql.com/doc/refman/8.4/en/performance-schema.html

M. R. Mufid, A. Basofi, M. U. H. Al Rasyid, I. F. Rochimansyah, and A. rokhim, “Design an MVC Model using Python for Flask Framework Development,” in 2019 International Electronics Symposium (IES), 2019, pp. 214–219. doi: 10.1109/ELECSYM.2019.8901656.

Downloads

Published

2025-10-15

How to Cite

Tengku, T. D. F., Relita Buaton, & Siswan Syahputra. (2025). Implementation of the Isolation Forest Algorithm for Mysql Query Performance Anomaly Detection Based on Data Performance Schema. Journal of Artificial Intelligence and Engineering Applications (JAIEA), 5(1), 592–597. https://doi.org/10.59934/jaiea.v5i1.1362