2018-04-25

Apr 25 In-Class Exercise Thread.

Post your solutions to the Apr 25 In-Class Exercise to this thread.
Best, Chris
Post your solutions to the Apr 25 In-Class Exercise to this thread. Best, Chris

-- Apr 25 In-Class Exercise Thread
 Each machine computes sum(π_salary(EMPLOYEE)) for the tuples that live on that machine
 Each machine outputs the result to a common server
 The common server then adds up all the outputs to calculate the final output
Each machine computes sum(π_salary(EMPLOYEE)) for the tuples that live on that machine Each machine outputs the result to a common server The common server then adds up all the outputs to calculate the final output

-- Apr 25 In-Class Exercise Thread
- assuming all tuples of EMPLOYEE are equally distributed among N machines.
- Each machine compute sum(salaries) on its tuples and output its result on a common server
- The sum of salaries is the sum of the results output by the machine
(Edited: 2018-04-25)
- assuming all tuples of EMPLOYEE are equally distributed among N machines.<br> - Each machine compute sum(salaries) on its tuples and output its result on a common server<br> - The sum of salaries is the sum of the results output by the machine<br>

-- Apr 25 In-Class Exercise Thread
Using the intra-query parallelism, calculate the sum of the salaries of all the employees. Since the tuples are equally distributed across N machines, break up the different portions and compute the output. After the sums are complete, send the sums from each machine to one machine and add them up.
-Casey
(Edited: 2018-04-25)
Using the intra-query parallelism, calculate the sum of the salaries of all the employees. Since the tuples are equally distributed across N machines, break up the different portions and compute the output. After the sums are complete, send the sums from each machine to one machine and add them up. -Casey

-- Apr 25 In-Class Exercise Thread
  1. Tell each machine with part of the EMPLOYEE table to compute the sum of the salaries in its portion of the table.
  2. The machines return their sums to the machine that requested the sum. This may be a machine with part of the table, in which case it doesn’t have to send data to itself.
  3. The requesting machine adds those sums together.
(Edited: 2018-04-25)
# Tell each machine with part of the EMPLOYEE table to compute the sum of the salaries in its portion of the table. # The machines return their sums to the machine that requested the sum. This may be a machine with part of the table, in which case it doesn’t have to send data to itself. # The requesting machine adds those sums together.

-- Apr 25 In-Class Exercise Thread
 - Each of the n machines compute SELECT sum(salary) FROM EMPLOYEE on it's tuples and send it's answer to a common server.
 - The server machine takes all of these individual sums and adds them all together to come to a final sum.
- Each of the n machines compute SELECT sum(salary) FROM EMPLOYEE on it's tuples and send it's answer to a common server. - The server machine takes all of these individual sums and adds them all together to come to a final sum.

-- Apr 25 In-Class Exercise Thread
All machines will compute the Sum(salaries) on their part of the Employee table. These results are copied to a common server/output. The common server will then add all of the results together to get the sum.
All machines will compute the Sum(salaries) on their part of the Employee table. These results are copied to a common server/output. The common server will then add all of the results together to get the sum.

User Icon
-- Apr 25 In-Class Exercise Thread
In our situation, we assume that each of the N machines have an equal amount of tuples. For each machine, we can compute the sum for their portion of the database, and when they are finished, send their sum to a master machine, which is probably the machine that is running the sum in the first place. The master adds up all the different sums that it received, and that value becomes the total sum of all salaries in the EMPLOYEE table.
In our situation, we assume that each of the N machines have an equal amount of tuples. For each machine, we can compute the sum for their portion of the database, and when they are finished, send their sum to a master machine, which is probably the machine that is running the sum in the first place. The master adds up all the different sums that it received, and that value becomes the total sum of all salaries in the EMPLOYEE table.

-- Apr 25 In-Class Exercise Thread
Assuming there exists another server all machines can access: Initialize sum_of_sums = 0 (This variable is on such server)

For each machine in N different machines running in parallel:
sum_of_sums += Compute sum of πsalary σ(EMPLOYEE in machine )
return sum_of_sums as the output
(Edited: 2018-04-25)
Assuming there exists another server all machines can access: Initialize sum_of_sums = 0 (This variable is on such server)<br /><br /> For each ''machine'' in N different machines running in parallel:<br /> sum_of_sums += Compute sum of π<sub>salary</sub> σ(EMPLOYEE in ''machine'')<br /> return sum_of_sums as the output

-- Apr 25 In-Class Exercise Thread
Each machine gets the sum of all salaries and sends it to a shared network. In the network, all sums from each machine will be added up together and output.
Each machine gets the sum of all salaries and sends it to a shared network. In the network, all sums from each machine will be added up together and output.
[ Next ]
X