Research Article
Exploiting Sharing Join Opportunities in Big Data Multiquery Optimization with Flink
Algorithm 2
Refine shared multiquery.
| | /∗add each shared group into one subgraph∗/ | | | Input: | | | Output: | | | //Step 1: initialization | | (1) | int = 1//shared subgraph no | | (2) | = new graph( ) | | (3) | foreachin do | | | //Step 2: pick to add it to suitable subgraph | | (4) | foreachkfrom 1 to do | | (5) | Boolean = false | | (6) | While j indo | | (7) | If ([“F”, “P”])then | | (8) | /∗ defined as defined as | | (9) | = | | | /∗ could be initially define in terms of full/partial sharing, F or P. ∗/ | | (10) | | | (11) | | | (12) | = true | | (13) | Removefrom | | (14) | End if | | (15) | End while//end while | | (16) | End for//all subgraph traverse for sharing | | | //Step 3: add to new subgraph. | | (17) | If (!) then | | (18) | = +1 | | (19) | = new graph( ) | | | /∗ is a first query node added whose has not share any node in pervious subgraphs but it is share with the rest query in ∗/ | | (20) | = | | (21) | Removefrom | | (22) | End if | | (23) | End for | | (24) | End |
|