# Query Optimization in Distributed Database Based on Improved Artificial Bee Colony Algorithm
## 1 Introduction  
Due to the continuous development of the information age, people's daily production of data and lifetime data volume have resulted in explosive growth, and the traditional centralized database has been unable to meet the massive data storage and computational processing needs [1; 2; 3]; therefore, distributed databases have emerged. Compared with centralized databases, distributed databases have more powerful storage and computation performance. In general, a distributed database cluster includes a coordinated control site and multiple data storage sites, and the stored data are sliced and distributed in different data storage sites through a certain rule [4; 5]. Meanwhile, in order to ensure the high availability of the distributed database cluster, the data shardings usually have several backups that are distributed across different sites [6; 7; 8; 9]. Therefore, a query statement has multiple corresponding query execution plans (QEPs), and the query execution cost of each query plan is different [10; 11]. In order to reduce the execution overhead of retrieving data and to speed up the query response, it is important to choose an appropriate query execution plan. When it comes to high-dimensional join queries, the space of the feasiblequery plans will also be very huge [12], and it is impossible to calculate the query execution cost for each query plan. Therefore, the core goal of distributed database query optimization is to find the one with the lowest execution cost among many query execution plans [13; 14]. As an NP (non-deterministic polynomial) problem, the process of query optimization for distributed databases can be transformed into the problem of exhaustive search [15] and hence can be solved by heuristic-based techniques such as the ant colony optimization algorithm [16; 17; 18], greedy algorithms, particle swarm optimization algorithms [19], the genetic algorithm [20; 21; 22; 23] and random search algorithms [24; 25; 26]. [PERSON] et al. [27] proposed a discrete artificial bee colony (dABCSPARQL) algorithm based on a novel heuristic approach for reordering SPARQL queries. The method first performs syntax tree parsing on the query statements to classify them into chained, star, cyclic, and chain-star queries; converts the statements into pre-ordered vectors based on different types of queries; and then further optimizes them using the discrete artificial bee colony algorithm to obtain a better execution plan. Although this algorithm performs well with the small number of relations, this situation is inverted when the query has more relations and requires excess memory and processor consumption. Moreover, this method increases the runtime. [PERSON] et al. [28] proposed a distributed database query optimization method based on the ant colony algorithm by simulating the process of ants searching for food by iterating the pheromone mechanism left on the pathway that ants search for food to carry out optimal pathway planning. This has a certain optimization effect, but it consumes more computation time when the query involves a larger number of data sites. At the same time, there exists the problem of falling into the local optimal solution. [PERSON] et al. [29] proposed a distributed database query optimization method based on the multi-ant colony genetic algorithm. The method first uses the characteristics of rapid convergence of the genetic algorithm to obtain a set of relatively optimal query execution plans, and then the execution plan is transformed into the initial routing pheromone value of the multi-ant colony algorithm. This improves the overall algorithm's computational efficiency, but the method reduces the computation time due to the two algorithms of the parallel computation greatly increasing the cost of the computer's computation. [PERSON] et al. [30] designed a quantum-inspired ant colony-based algorithm to optimize large join queries and improve the cost of query joins in distributed databases.