# QRLIT: Quantum Reinforcement Learning for Database Index Tuning
## 5 Performance Evaluation
### Impact of Database Sizes  
The purpose of this section is to examine the behavior of the algorithms across a range of database sizes, specifically 10 MB, 20 MB, 30 MB, 40 MB, 70 MB, and 100 MB. The metrics employed in this analysis include the average number of queries processed per hour of the 25 episodes for each database size, the number of Grover iterations, and the temporal difference error of each algorithm.  
The results obtained for each metric in each database size for the two algorithms are shown in Figures 8-12. The average results of each metric over the database sizes of the two algorithms are summarized in Table 3. The analysis for the database sizes also indicates a superiority of the hybrid algorithm. The results in Table 3 and Figure 8 show that on average, the hybrid algorithm yields a higher number of queries processed per hour of 2.49% compared to its classical counterpart and displays a temporal difference error trajectory closer to 0 (Figure 9). This trajectory is more evident in this analysis because the number of episodes is reduced by half, highlighting the importance of a faster convergence.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Metric** & **Classical** & **Quantum-Classical** &
\begin{tabular}{c} **Increase in Quantum–Classical** \\ **over Classical** \\ \end{tabular} \\ \hline Average Number of Queries Processed Per Hour (QphH) & 607,650.60 & 623,136.44 & 2.49\% \\ Average Database Size Test Execution Time (Seconds) & 8449.18 & 8936.49 & 5.45\% \\ Average Temporal Difference Error & \(-603.56\) & 13.78 & N/A \\ Average Number of Grover Iterations & N/A & 6.27 & N/A \\ \hline \hline \end{tabular}
\end{table}
Table 3: Comparison results of the classical algorithm and the quantum–classical algorithm with different database sizes.  
Figure 7: The average execution times to build and run the Grover algorithm for each Grover iteration in 20 executions with the quantum–classical algorithm.  
Figure 8: Impacts of database size on average number of queries processed per hour.  
Figure 10: Impacts of database size on average number of Grover iterations in quantum–classical algorithm.  
Figure 9: Impacts of database size on average temporal difference error.  
Furthermore, it can also be observed that the number of queries processed per hour decreases as the database size increases. This indicates that the size of the database affects the number of QphH generated, in other words, the reward. Consequently, according to Equation (20), which calculates the number of [PERSON]'s iterations, and since the Q-values are directly related to the reward, they will also have smaller values. Thus, the smaller the policy and reward contribution, the smaller the number of iterations (Figure 10), which increases the exploration rate (Figure 11). Excessive exploration causes the agent not to follow the learned policy, resulting in a mostly random configuration of indexes as the database size increases.  
In conclusion, besides the average superiority verified by the quantum-classical algorithm, the results in Figure 10 also demonstrate the need to adjust the parameter k, which regulates the reward and policy contributions to the number of [PERSON]'s iterations. In this case, as the reward value decreases, it is necessary to increase the value of k to reduce the exploration rate.