QuestionQuestion

Transcribed TextTranscribed Text

Assignment3 Vertical Partitioning Identify the circumstances under which vertical partitioning will optimize query responses Demonstrate how to vertically partition database given user query patterns. Chapter Principles of Distributed Database Systems, Ozsu and Valduriez, 2011. 1. problesse, assume Cuntomer table existh state Perform vertical fragmentation on the Customer table above in accordance with the queries and access frequencies. a) Create the attribute usage matrix. b) Create the attribute affinity matrix. c) Calculate the Clustered Affinity Matrix according to the Bond Energy Algorithm. d) Determine the best partitioning (remember to shift the matrix). e) Prove that your vertical fragmentation is correct. 2. Assume a database contains the STUDENT table below: STUDENT universi sid name state gpa ty 1 Jones UMD MD 3.7 2 Harris UMD MD 2.5 3 Chu NYU NY 3.9 4 Kim Cornell NY 3.8 Sudars 5 RPI NY 2.8 en Columbi 6 Katz NY 3.1 a 7 Miller Goucher MD 2.9 8 Penn NYU NY 3.6 vertically fragment STUDENT The primary key of ISTUDENT is sid following queries will the STUDENT table SELECT FROM STUDENT WHERE SELECT name, university, STUDENT WHERE STUDENT STUDENT WHERE state= 'MD the same issued access frequencies are listed below site l site? acc(q1)=10 acc (a3) = 0 acc(q4)=5 acc(q4)= a) Write down the Attribute Usage Matrix b) Calculate the Attribute Affinity Matrix c) Write the Clustered Affinity Matrix (You do not have to use the bond energy algorithm you can make good estimate and justify it.) d) Estimate calculate) the line p partition and show the vertically fragmented table 2. Prove bring the following Applying horizontal fragmentation to a table and then applying vertical fragmentation orizontal fragments is equivalent applying fragmentation table and then applying horizontal fragmentation othe vertical fragments

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.ArrayList;
import java.util.Collections;

/**
*
* @author
*/
public class BEA_Algorithm {

    public static void main(String[] args) {
       int[][] customer = {
            {80, 15, 50, 65, 65},
            {15, 60, 0, 45, 60},
            {50, 0, 50, 50, 10},
            {65, 45, 50, 95, 55},
            {65, 60, 10, 55, 70}
       };

       int[][] student = {
            {0, 0, 0, 0, 0},
            {0, 20, 5, 5, 5},
            {0, 5, 35, 35, 5},
            {0, 5, 35, 35, 5},
            {0, 5, 5, 5, 20}
       };
      
       int[][] ca = bea(customer);

       printTable(ca);
      
       System.out.println("----------------------");
       ca = bea(student);

       printTable(ca);

    }

    private static void printTable(int[][] ca) {
       for (int i = 0; i < ca.length; i++) {
            int[] is = ca[i];
            for (int j = 0; j < is.length; j++) {
                int k = is[j];
                System.out.print(k + " ");
            }
            System.out.println("");
       }
    }

    private static int[][] bea(int[][] aa) {
       int[][] ca = new int[aa.length][aa.length];

       //       {initialize; remember that AA is an n × n matrix }
       //CA(• , 1) ← AA(• , 1) ;
       //CA(• , 2) ← AA(• , 2) ;
       copyColumn(aa, ca, 0, 0);
       copyColumn(aa, ca, 1, 1);

       //index ← 3 ;
       int index = 2;

       while (index < aa.length) { // {choose the “best” location for attribute AAindex}
            // for i from 1 to index− 1 by 1 do calculate cont(Ai−1 , Aindex, Ai) ;

            ArrayList<Cont> conts = new ArrayList<>();
            for (int i = 0; i < index - 1; i++) {
                conts.add(cont(aa, i - 1, index, i));
            }
            conts.add(cont(aa, index - 1, index, index + 1));

            Collections.sort(conts);...

By purchasing this solution you'll be able to access the following files:
Solution1.zip and Solution2.docx.

50% discount

Hours
Minutes
Seconds
$80.00 $40.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Database Development Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats