Advertisement
Guest User

CS421G34 Question 3

a guest
Mar 23rd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Create Unique Index
  3. UIX_alcohols_name_abv_volume_price
  4. ON cs421g34.alcohols(name, abv, volume, price)
  5.  
  6.     This ensures that every combination of alcohol name, abs, volume, and price is unique saving valuable memory and preventing duplicate items.
  7.  
  8. Create Index
  9. UIX_alcohols_name_ASC
  10. ON cs421g34.alcohols(name ASC)
  11.  
  12.     Index by name reducing scan time when searching for a certain alcohol name. This is sorted alphabetically
  13.  
  14. Create Index
  15. UIX_alcohols_price_DESC
  16. ON cs421g34.alcohols(price DESC)
  17.  
  18.     Index by price reducing scan time when the user is searching for an alcohol by price.
  19.  
  20. Create Index
  21. UIX_payment_pdate_DESC_ptype_DESC
  22. ON cs421g34.payment(pdate DESC, ptype DESC)
  23.  
  24.     Index by payment date, then payment type this reduces the scan time when looking for a certain transaction by the date or a certain payment type.
  25.  
  26. CLUSTER cs421g34.payment USING UIX_payment_pdate_DESC_ptype_DESC
  27.  
  28.     Cluster payments by the index payment date descending and payment type descending. This reduces the scan time by allowing page searches for payment date and type. If a user wants to search for a users payment made on a certain date, searching for that single or multiple transactions made on that date will be much faster.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement