Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CS421g34
  2.  
  3. Create Unique Index
  4. UIX_alcohols_name_abv_volume_price
  5. ON cs421g34.alcohols(name, abv, volume, price)
  6.  
  7. #This ensures that every combination of alcohol name, abs, volume, and price is unique saving valuable memory and preventing duplicate items.
  8.  
  9. Create Index
  10. UIX_alcohols_name_ASC
  11. ON cs421g34.alcohols(name ASC)
  12.  
  13. #Index by name reducing scan time when searching for a certain alcohol name. This is sorted alphabetically
  14.  
  15. Create Index
  16. UIX_alcohols_price_DESC
  17. ON cs421g34.alcohols(price DESC)
  18.  
  19. #Index by price reducing scan time when the user is searching for an alcohol by price.
  20.  
  21. Create Index
  22. UIX_payment_pdate_DESC_ptype_DESC
  23. ON cs421g34.payment(pdate DESC, ptype DESC)
  24.  
  25. #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.
  26.  
  27. CLUSTER cs421g34.payment USING UIX_payment_pdate_DESC_ptype_DESC
  28.  
  29. #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