# A Resilient Large-Scale Trajectory Index for Cloud-Based Moving Object Applications
## 5 Experimental Study
### Performance Evaluation  
We divided the testbed into two major stages to show the performance of RMOI and its prediction models in different scenarios. The first stage tested RMOI on all the query types in scenarios where it only depends on the compulsory model. In the second stage, RMOI used the discrete model on random queries limited by a predetermined frequency. Each stage was designed with two different cluster settings: high resource availability and low resource availability. On the SF and RioBuses datasets, each worker was set to 12 GB and 4 GB of memory with 6 threads and 2 threads. The UK + IE dataset has the same settings except for the memory, which is set to 6 GB instead of 4 GB. Starting with the SF dataset, Figures 3 and 4 show the average running time for all the query types with high resource availability (Memory = 12 GB and Threads = 6, per worker). Figure 2(a),b shows the average running time of 100 random range queries and 100 random interval queries on different selectivity levels. The running times of all methods increase with more selectivity. None of the algorithms show a significant speedup. However, RMOI shows a significant speedup on lookup queries as shown in Figure 2(c), where it outperforms LSpark and DTR by a factor of 3.1\(\times\) on the average. Figure 2(d) shows the running time of the longest query, where RMOI outperforms DTR by a factor of 1.9\(\times\) and LSpark by a factor of 1.3\(\times\). Figure 2(d) also shows the number of sub-trajectories that need to be processed globally. It reveals how different partitioning techniques reflect on the local and global aggregations. For continuous query, we ran 100 random queries with k = 2, 3, 4, 5, and 6 on two selectivity levels: Small Selectivity (SS) and Large Selectivity (LS), as shown in Figure 4. The spatial and temporal selectivities for SS were set to 0.3% and 1%, respectively, while both selectivities were set to 10% for LS. The spatial and the temporal selectivities were combined for spatio-temporal queries in SS or LS. In general, RMOI shows a significant speedup by a factor of 1.8\(\times\) on the average. Figures 5 and 6 show the average running time on low resource availability (4 GB of memory and 2 threads) on the SF dataset. Both RMOI and DTR have better performance than LSpark on RQ and IQ with large selectivity, as shown in Figure 4(a),b. With the lookup query, RMOI shows a speedup by a factor of 4.2\(\times\) on the average, as seen in Figure 4(c). RMOI outperforms DTR and LSpark on the longest query by factors of 1.9\(\times\) and 3.6\(\times\), respectively. With continuous queries, RMOI shows a speedup range from 1.5\(\times\) to 7\(\times\) the speed of competitors, Figure 6.  
the global aggregation is higher in DTR. RMOI predicts \(LP\) to be 3 in the high resource case and 1 (full trajectory preservation) in the low resource case. It is worth mentioning that RMOI used CPModel to predict a reasonable \(LP\) that would be suitable for all the query types and not the absolute best choice for a particular query. Sometimes, it is impossible to find an \(LP\) that would significantly improve the performance for all the queries because some queries prefer opposite directions. In such cases, CPModel considered the majority without causing a significant performance decrease on the minority. This is the main reason why RMOI did not show a significant improvement on RQ or IQ, especially with DTR. However, it kept the performance of those queries at a competitive level and did not sacrifice their performance for the sake of other queries. Figure 4: Average execution time for the SF dataset with high resource availability on (**a**) continuous range query with small selectivity, (**b**) continuous interval query with small selectivity, (**c**) continuous spatio-temporal query with small selectivity, (**d**) continuous range query with large selectivity, (**e**) continuous interval query with large selectivity, and (**f**) continuous spatio-temporal query with large selectivity.