## 4 Performance Tests
### SELECT Operation
#### 4.3.4 Complex Select with Three Inner Joins  
Another complex select operation with three inner joins that returns all hotels on the Asian continent is presented in Table 7. \begin{table}
\begin{tabular}{l} \hline \hline
**RELATIONAL MYSQL: Select with two inner join operation** \\ \hline @Query(value = “select cit.” from continent con inner join country c on con.id=c.continent\_id \\ inner join city city cit on c.id=ctic.country\_id where con.name=:name”, nativeQuery = true) \\ List\textless{City}\textgreater{} getCityByContient (@Param(”name”) String name); \\ List\textless{City}\textgreater{} cities = cityRepository.getCityByContient(“Asia”); \\ \hline \multicolumn{2}{c}{**DOCUMENT-BASED MYSQL: Select with two inner join operation**} \\ \hline DocResult res = collection.find(”name=“Asia’ and country.city.name is not null \\ and (country.city.restaurant.name is null or country.city.hotel.name is null)”).execute(); \\ \hline \multicolumn{2}{c}{**CouchDB FIRST STRUCTURE: Select with two inner join operation**} \\ \hline \multicolumn{2}{c}{_Send a new request to get all documents with the country id obtained above, requestBody:_} \\  “[\textbackslash{}”selector\textbackslash{}\": [\textbackslash{}\"country\_id\textbackslash{}\": + doc + \"]]\" \\ _parse the response using first structure of ResponseDTO and get all the documents_ \\ cities.addAll(responseDTO.getDocs(0)); \\ \hline \multicolumn{2}{c}{**CouchDB SECOND STRUCTURE: Select with two inner join operation**} \\ \hline \multicolumn{2}{c}{_Send a request to get all documents with continent name Asia using requestBody:_} \\  “[\textbackslash{}”selector\textbackslash{}\":[\textbackslash{}\"name\textbackslash{}\": \textbackslash{}\"Asia\textbackslash{}\"]]\" \\ _parse the response using the second structure of ResponseDTO:_} \\ List\textless{City}\textgreater{} cities = responseDTO.getDocs(0).stream().map(doc\textgreater{} doc.getCountry().getCity(0) \\.filter(doc\textgreater{} (doc.getRestaurant)= null \& doc.getHotel(0== null)).collect(tolist(0)); \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Complex select with two inner join operations. Figure 9: Performance Time (ms) for select with two inner joins. Using the CouchDB first structure, first, we have to execute the query passed in point 3 to get the list of cities, and then for each city, we look for the documents that contain this _city_id_. If no other conditions were added, the list of both hotels and restaurants in that city is obtained. Afterward, all the documents with a _number_of_rooms_ greater than 0 were filtered so that only the documents of the hotel type were obtained. Using the second structure, the same request was executed, and at the end, after interpreting the answer, all the hotels were extracted and checked to add it only once to the final list. From Figure 10, it can be seen that again, the first structure used in CouchDB requires the longest response time, due to a large number of requests. Overall, document-based MySQL has the best performance. For a large number of elements being still comparable with CouchDB's second structure. Also, it can be noticed that the relational MySQL approach exhibits good results for a small number of elements.