# Query Optimization in Distributed Database Based on Improved Artificial Bee Colony Algorithm
## 3 Experiment Results and Analysis
### Results and Discussion  
Figure 9 shows the Top-1 optimal query plan execution cost obtained by this method and other comparative methods in the cases involving S = 100, 150, 200 data sites and DS = 55, 85 data shardings. From the figure, it can be seen that, as the number of sites and the number of data shardings involved in the query increase, the query execution cost also increases. In contrast, the increase in the number of data shardings has more impact on the query execution cost. According to the results, the optimal query plan generated by the DYABC-GO algorithm and ABC-GO have a smaller query cost compared to the other comparative algorithms. The optimal query plans produced by these two algorithms are very close in cost for join queries with low dimensionality. However, when faced with higher dimensional join queries, DYABC-GO produces a more significant reduction in the cost of the query execution plan. Therefore, the DYABC-GO algorithm is able to produce a better quality Top-1 query execution plan than other algorithms. Figures 10 and 11 show the average execution cost of the final Top-10 and Top-20 query plans involving S = 100, 150, 200 data sites and DS = 55, 85 data shardings. As can be seen from the figures, the average execution cost of the Top-10 and Top-20 query plans generated by DYABC-GO is still better than that of other algorithms. In the DSM matrices of 85 \(\times\) 200, 50 \(\times\) 200, 85 \(\times\) 150, and 50 \(\times\) 150, the average execution cost of Top-1, Top-10, and Top-20 generated by DYABC-GO are the same, which indicates that the proposed method has almost completely converged within the number of iterations, further proving that the proposed method in this paper is able to generate better quality query plans and improve the query efficiency. Figures 12-17 show the comparison of the iterative convergence efficiency of the algorithms in cases involving different numbers of sites and data shardings. As shown in the figures, GA and ABC always plateau early in the iteration and have difficulty converging further in subsequent iterations. Since GA and ABC use traditional search strategies, and since the query optimization problem addressed in this paper is to find the execution plan with the highest concentration of sites, this leads to a very poor optimization performance of these two methods in the face of the spaceless conceptual problem, equivalent to blindly evolving randomly at each iteration instead of evolving in a better direction. According to the results, the model convergence speeds of DYABC-GO and ABC-GO are much faster than the other methods, which proves the effectiveness of the optimization search strategy of the new artificial bee colony algorithm proposed in this paper. DYABC has a better convergence speed than GA and ABC and has a certain probability of jumping out of the local optimum in subsequent iterations. However, it is difficult to maintain the diversity of the population, which means that the final convergence of the algorithm is not ideal. DYABC is the method that uses a dynamic perturbation operator without incorporating genetic operators. Thus, it can be found that this method is very prone to premature maturation, although it can evolve populations in a more optimal direction. DYABC-GO and ABC-GO are two methods that combined with selection, crossover, and mutation operations of the genetic algorithm. According to the results, these two approaches end up generating query plans with a lower execution cost, which proves that the combination of selection, crossover, and mutation operations of the genetic algorithm  
Figure 11: The average execution cost of the final Top-20 query plans. Figure 10: The average execution cost of the final Top-10 query plans. can increase the diversity of the population and improve the global search capability of the overall algorithm, preventing the algorithm from falling into the local optimum.