Input: : Relations participating in the query, : Probability of crossover, |
: Probability of mutation, : Pre-defined number of generations, : Population Size |
Output: Top-n query plans. |
Method: |
Initialize a random parent population of query plans PP |
where chromosome length “len” is the number of relations accessed in the query and the gene at the th position in the |
chromosome represents the site of the th relation. |
WHILE generation ≤ DO |
Step 1. Evaluate each query plan in PP on the following objective functions |
: Minimize , |
: Minimize , |
where is the number of sites accessed by the query plan in ascending order of cardinality per site, is the communication |
cost per byte between sites and , is the local processing cost per byte at site , is the bytes to be communicated from |
site and is the bytes to be processed at site . |
Step 2. Perform Non-Dominated (ND) Sort on PP for “” and “” separately and place each query plan (QP) |
into corresponding ND fronts “” and sort the QPs within each “” |
Step 3. Evaluate Crowding Distance Function for each objective function |
Assign for smallest and highest values in each front “”. |
For the remaining QPs, is calculated as: |
, |
where is the value of th objective function of th query plan in Front and and are the |
maximum and minimum values obtained for the objective function . |
Step 4. Perform Selection from PP using binary tournament selection using crowded comparison operator |
Step 5. Perform random single point crossover on selected chromosomes with crossover probability |
Step 6. Apply mutation on resulting population with mutation probability |
Let the resulting child population be CP |
Step 7. Append CP into PP, and let the resulting intermediate population be IP |
Step 8. Repeat Step 1 and Step 2 for population IP |
Step 9. Form the population PP for the next generation by picking query plans Front-wise from IP till the |
population size = . |
Step 10. Increment Generation by 1 |
END DO |
Return Top- Query Plans from population PP |