Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CS421g34
- Create Unique Index
- UIX_alcohols_name_abv_volume_price
- ON cs421g34.alcohols(name, abv, volume, price)
- #This ensures that every combination of alcohol name, abs, volume, and price is unique saving valuable memory and preventing duplicate items.
- Create Index
- UIX_alcohols_name_ASC
- ON cs421g34.alcohols(name ASC)
- #Index by name reducing scan time when searching for a certain alcohol name. This is sorted alphabetically
- Create Index
- UIX_alcohols_price_DESC
- ON cs421g34.alcohols(price DESC)
- #Index by price reducing scan time when the user is searching for an alcohol by price.
- Create Index
- UIX_payment_pdate_DESC_ptype_DESC
- ON cs421g34.payment(pdate DESC, ptype DESC)
- #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.
- CLUSTER cs421g34.payment USING UIX_payment_pdate_DESC_ptype_DESC
- #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