# Decision-Tree-Based Horizontal Fragmentation Method for Data Warehouses
## 4 Results and Discussion
### Application of FTree in the Tourist Data Warehouse
\[ITC(q_{i})=\sum_{k=1}^{m}(card(f_{k})-\sum_{p_{j}|PUM(q_{i},p_{j})=1\wedge p_{j} \in f_{k}}(sel_{j}-rt_{j}))*f_{i} \tag{3}\]  
The amount of relevant data located in other fragments is obtained by Equation (4), where the number of relevant tuples located in other fragments is multiplied by the frequency of the query squared and by the number of fragments (\(nf_{i}\)) required to answer the query. \[RTC(q_{i})=\sum_{p_{j}|PUM(q_{i},\ p_{j})=1\wedge r_{i}>0}^{n}rt_{j}*f_{i}^{2}* nf_{i} \tag{4}\]  
Table 15 shows the cost of the queries in both fragmentation schemes, the one selected by FTree with J48 and the multilayer perceptron, and the scheme chosen by naive [PERSON]. In the case of the first scheme, the cardinalities of the fragments are \(card(f_{1})=15\),744, \(card(f_{2})=17\),220, and \(card(f_{3})=2460\). The third fragment is the complement. The \(\var ITC\) of \(q_{3}\) is calculated as follows:  
\[ITC(q_{3})=(card(fr_{2})-(sel_{3}-rt_{3}))*f_{3}=(17,220-(8856-2952))*2=22,632\]  
The RTC of the same query is obtained as shown below:  
\[RTC(q_{3})=rt_{3}*f_{3}^{2}*nf_{3}=2952*2^{2}*2=23,616.\]  
For the scheme chosen by naive [PERSON], the cardinalities of the fragments are \(card(f_{1})=15\),744, \(card(f_{2})=11\),808, \(card(f_{3})=5412\), and \(card(f_{4})=2460\). The fourth fragment is the complement. Therefore, the costs of the third query in this scheme are:  
\[ITC(q_{3})=(card(fr_{2})-(sel_{3}-rt_{3}))*f_{3}=(11,808-(8856-2952))*2=11,808.\]  
\[RTC(q_{3})=rt_{3}*f_{3}^{2}*nf_{3}=2952*2^{2}*2=23,616.\]  
Table 15 shows that the HFS selected by FTree with J48 and the multilayer perceptron is better in most cases. In only two queries, the HFS chosen by naive [PERSON] obtained a lower query execution cost. Additionally, the decision tree generated by J48 is easier to interpret than the model of the multilayer perceptron. Therefore, the model obtained by J48 outperformed those of naive Bayes and the multilayer perceptron. Additionally, to evaluate FTree, it was compared with [14]; for this, the predicate use matrix of Table 16 taken from [14] was used. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Query** & \multicolumn{3}{c}{**HFS of \(data\_set_{2}\)**} & \multicolumn{3}{c}{**HFS of \(data\_set_{3}\)**} \\  & **ITC** & **RTC** & **Cost** & **ITC** & **RTC** & **Cost** \\ \hline \(q_{1}\) & 38,376 & 0 & 38,376 & 38,376 & 0 & 38,376 \\ \(q_{2}\) & 51,168 & 0 & 51,168 & 51,168 & 0 & 51,168 \\ \(q_{3}\) & 22,632 & 23,616 & 46,248 & 11,808 & 23,616 & **35,424** \\ \(q_{4}\) & 73,800 & 24,600 & **98,400** & 22,140 & 147,600 & 169,740 \\ \(q_{5}\) & 25,584 & 0 & 25,584 & 25,584 & 0 & 25,584 \\ \(q_{6}\) & 33,948 & 53,136 & 87,084 & 17,712 & 53,136 & **70,848** \\ \(q_{7}\) & 51,168 & 0 & 51,168 & 51,168 & 0 & 51,168 \\ \(q_{8}\) & 89,544 & 0 & 89,544 & 89,544 & 0 & 89,544 \\ \(q_{9}\) & 59,040 & 15,744 & **74,784** & 17,712 & 94,464 & 112,176 \\ \(q_{10}\) & 127,920 & 0 & 127,920 & 127,920 & 0 & 127,920 \\ \(q_{11}\) & 44,280 & 8856 & **53,136** & 13,284 & 53,136 & 66,420 \\ \(q_{12}\) & 43,296 & 173,184 & **216,480** & 1968 & 330,624 & 332,592 \\ \hline \hline \end{tabular}
\end{table} 
Table 15: Query cost comparison of the fragmentation schemes. The best fragmentation scheme according to [14] is that of the three fragments \(f_{1}=\{p_{1},p_{2},p_{3},p_{4},p_{5}\},f_{72}=\{p_{6}\}\), and \(f_{73}=\{p_{7}\}\). With FTree, in this case, the maximum number of fragments allowed by the data warehouse manager (\(W\)) is four. Using the PUM, the partition tree generated by FTree was obtained. Figure 12 shows the comparison between data_set\({}_{2}\) with the fragments \(f_{71}=\{p_{1},p_{2},p_{4},p_{6}\},f_{72}=\{p_{3},p_{5},p_{7}\}\), and \(data\_set_{3}\) with the fragments \(f_{71}=\{p_{1},p_{2},p_{4}\},f_{72}=\{p_{3},p_{5},p_{7}\},f_{73}=\{p_{6}\}\). We used 8-fold cross-validation. The best scheme is \(data\_set_{2}\). The decision tree obtained with FTree is visualized in Figure 13.  
Table 17 shows the cost of the queries in two fragmentation schemes, that obtained by [14] and that of FTree.