Genetic Algorithm for Relational Database Optimization in Reducing Query Execution Time

Kukuh Triyuliarno Hidayat, Riza Arifudin, Alamsyah Alamsyah


The relational database is defined as the database by connecting between tables. Each table has a collection of information. The information is processed in the database by using queries, such as data retrieval, data storage, and data conversion. If the information in the table or data has a large size, then the query process to process the database becomes slow. In this paper, Genetic Algorithm is used to process queries in order to optimize and reduce query execution time. The results obtained are query execution with genetic algorithm optimization to show the best execution time. The genetic algorithm processes the query by changing the structure of the relation and rearranging it. The fitness value generated from the genetic algorithm becomes the best solution. The fitness used is the highest fitness of each experiment results. In this experiment, the database used is  MySQL sample database which is named as employees. The database has a total of over 3,000,000 rows in 6 tables. Queries are designed by using 5 relations in the form of a left deep tree. The execution time of the query is 8.14247 seconds and the execution time after the optimization of the genetic algorithm is 6.08535 seconds with the fitness value of 0.90509. The time generated after optimization of the genetic algorithm is reduced by 25.3%. It shows that genetic algorithm can reduce query execution time by optimizing query in the part of relation. Therefore, query optimization with genetic algorithm can be an alternative solution and can be used to maximize query performance.


Relational Database, Query, Genetic Algorithm, Fitness, Execution Time

Full Text:



Bajaj, P L. (2015). A Survey on Query Perfomance Optimization by Index Recomendation. International Journal of Computer Appplication. 113, 36-40.

Bennett, K., Ferris, M. C., & Ioannidis, Y. E. (1991). A genetic algorithm for database query optimization (pp. 400-407). Computer Sciences Department, University of Wisconsin, Center for Parallel Optimization.

Ahmed, I., Beg, M. R., Gupta, K. K., & Mansoori, M. I. (2012). A Novel approach of query optimization for genetic population. International Journal of Computer Science Issues (IJCSI), 9(2), 85-91.

Sharma, R. V, Pushpneel. E, & Chaundhary, E. S. (2015). Query Optimization Concepts in Distributed Database. International Journal of engineering Technology Science and Research 2: 60-65.

Butey, P. K., Meshram, S., & Sonolikar, R. L. (2012). Query Optimization by Genetic Algorithm. Journal of Information Technology and Engineering, 3(1), 44-51.

Garg, A. & Juneja, D. (2012). A Comparison and Analysis of Various Extended Techniques of Query Optimization. International Journal of Advantages in Technology, 3(3), 184-194.

Arebi, P., & Gonbadipoor, N. (2011, March). A Genetic Algorithm for Query Optimization in Database Grid by Dynamic Cost Estimation. In Computer Modelling and Simulation (UKSim), 2011 UkSim 13th International Conference on (pp. 81-86). IEEE.

Widodo, A. W, & Mahmudy, W. F. (2010). Penerapan Algoritma Genetika Pada Sistem Rekomendasi Wisata Kuliner. Jurnal Ilmiah Kursor 5(4): 205-211.

Ashari, I. A, Muslim, M. A., & Alamsyah. (2016). Comparison Perfomance of Genetic Algorithm and Ant Colony Optimization in Course Scheduling Optimizing. Scientific Journal of Informatics, 3(2), 149-158.

Indra, Zulfahmi & Subanar. 2014. Optimasi Biaya Distribusi Rantai Pasok Tiga Tingkat dengan Menggunakan Algoritma Genetika. IJCCS 8(2): 189-200.

Indroprasto & Suryani, E. (2012). Analisis Pengendalian Persedian Produk dengan Metode EOQ Menggunakan Algoritma Genetika untuk Mengefisiensi Biaya Persediaan. Jurnal Teknik ITS, 1(1), 305-309.

Muzid, S. (2014). Dinamisasi Parameter Algoritma Genetika Menggunakan Population Resizing On Fitness Improvement Fuzzy Evolutionary Algorithm (PROFIFEA). Prosiding SNATIF, 471-478.

Haupt, Randy L. & Haupt, Ellen Sue. (2004). Practical Genetic Algorithms. 2nd. New Jersey: A John Wiley & Sons, Inc.

Bayir, M. A., Toroslu, Ismail H., & Cosar, Ahmet. (2007). Genetic Algorithm for the Multiple-Query Optimization Problem. IEEE Transaction On System. Man. and Cybernetics-Part C: Application and Reviews 37(1), 147-153.

Potgieter, A. & Engelbrencht, A.P. (2007). Genetic Algorithms for The Structural Optimsation of Learned Polynomial Expression. Applied Mathematics and Computation 186: 1441-1466.

Petkovic, D. (2010, April). Comparison of different solutions for solving the optimization problem of large join queries. In Advances in Databases Knowledge and Data Applications (DBKDA), 2010 Second International Conference on (pp. 51-55). IEEE.

Li, H., & Luo, B. (2008, September). A Tree-based genetic algorithm for distributed database. In Automation and Logistics, 2008. ICAL 2008. IEEE International Conference on (pp. 2614-2618). IEEE.

Fitriana, E. N, & Sugiharti, E. (2015). Implementasi Algoritma Genetika dengan Teknik Kendali Logika Fuzzy untuk Mengatasi Traveling Salesman Problem Menggunakan Matlab. UNNES Journal of Mathematics, 4(2): 114-121.

Mahmudy, W. F., & Rahman, M. A. (2011). Optimasi Fungsi Multi-Obyektif Berkendala Menggunakan Algoritma Genetika Adaptif dengan Pengkodean Real. Jurnal Ilmiah Kursor, 6(1): 19-26.

Hoseini, P., & Shayetsteh, M. G. (2013). Efficient Contrast Enhancement of Images using Hibrid Ant Colony Optimization, Genetic Algorithm, and Simulated Annealing. Digital Signal Processing, 23(3): 879-893.

Arifudin, R. (2012). Optimasi Penjadwalan Proyek dengan Penyeimbangan Biaya Menggunakan Kombinasi CPM dan Algoritma Genetika. Jurnal Masyarakat Informatika, 2(4): 1-14.

Sofwan, Aghus, Handoyo, Eko, & WD, Ramadhony. (2008). Algoritma Genetika Dalam Pemilihan Spesifikasi Komputer. Seminar Nasional Aplikasi Teknologi Informasi. Yogyakarta. 1-6.

Purwana, N., Esmeralda Djamal, C., & Renaldi, F. (2016). Optimalisasi Penempatan Dosen Pembimbing Dan Penjadwalan Seminar Tugas Akhir Menggunakan Algoritma Genetika. In Seminar Nasional Teknologi Informasi dan Komunikasi, Maret.

Sari, F. A., Sugiharti, E., & Dwijanto. 2013. Implementasi Algoritma Genetika untuk Menyelesaikan Traveling Salesman Problem. UNNES Journal of Mathematics 2(2): 117-120.



  • There are currently no refbacks.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.