1 / 5

Cost Analysis Rule-of-Thumb Guidelines

Cost Analysis Rule-of-Thumb Guidelines. As a guide, consider denormalizing if: redundancy is minimal and update anomalies are not expected (e.g., StreetNr City State  Zip) replicated objects are large (e.g., images in View)

fathia
Download Presentation

Cost Analysis Rule-of-Thumb Guidelines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cost AnalysisRule-of-Thumb Guidelines • As a guide, consider denormalizing if: • redundancy is minimal and update anomalies are not expected (e.g., StreetNr City State  Zip) • replicated objects are large (e.g., images in View) • join frequencies are very high when compared to updates (e.g., approximate cost in Canadian dollars) • Using actual application characteristics, estimate space and time requirements for various possibilities and compare costs.

  2. Cost Estimation (Space) Assume: 5 rooms, 100 reservations, and 80 guests. 54 = 20 804 = 320 1004 = 400 740 54 = 20 1007 = 700 720 804 = 320 1007 = 700 1020 10010 = 1000 Case 1: Room(RoomNr, RoomName, NrBeds, Cost) Guest(GuestNr, GuestName, StreetNr, City) Reservation(GuestNr, RoomNr, ArrivalDate, NrDays) vs. Case 2: Room(RoomNr, RoomName, NrBeds, Cost) Reservation(GuestNr, GuestName, StreetNr, City, RoomNr, ArrivalDate, NrDays) vs. Case 3: Guest(GuestNr, GuestName, StreetNr, City) Reservation(GuestNr, RoomNr, ArrivalDate, NrDays, RoomName, NrBeds, Cost) vs. Case 4: Reservation(GuestNr, GuestName, StreetNr, City, RoomNr, ArrivalDate, NrDays, RoomName, NrBeds, Cost)

  3. Cost Estimation (Time) Case 1: Room(RoomNr, RoomName, NrBeds, Cost) Guest(GuestNr, GuestName, StreetNr, City) Reservation(GuestNr, RoomNr, ArrivalDate, NrDays) vs. Case 2: Room(RoomNr, RoomName, NrBeds, Cost) Reservation(GuestNr, GuestName, StreetNr, City, RoomNr, ArrivalDate, NrDays) Most important queries/updates: 1. (40%) What rooms are available? 2. (30%) Make a reservation. 3. (10%) Change a reservation. 4. (10%) Cancel a reservation. 5. (the rest) Miscellaneous. Assume indexed on primary keys. 1. Case 1 & 2: Using the Reservation table, retrieve reservations that could overlap the requested date and determine room availability. (Case 1 insignificantly betterthe only difference is that Case 1 transfers fewer values in its records.) …

  4. Semantic Change? Case 1: Room(RoomNr, RoomName, NrBeds, Cost) Guest(GuestNr, GuestName, StreetNr, City) Reservation(GuestNr, RoomNr, ArrivalDate, NrDays) vs. Case 2: Room(RoomNr, RoomName, NrBeds, Cost) Reservation(GuestNr, GuestName, StreetNr, City, RoomNr, ArrivalDate, NrDays) Most important queries/updates: ... 2. (30%) Make a reservation. ... Assume indexed on primary keys. 2. Case 1: Insert tuple in Reservation (1 read & 1 write) and insert tuple in Guest, if necessary, (1 read and (usually) 1 write). Case 2: Insert tuple in Reservation (1 read & 1 write); check duplicate guest information (read file, or add secondary index). (Developer) Do we really need to check duplicate guest information? (Proprietor) Hmmm, maybe not; it doesn’t matter if it is different. (Developer) Does a guest always need the same guest number? (Proprietor) Not really; there are no guest numbers in our manual system. (Developer) Aha! Great, this really lets us savewatch this.

  5. Unique GuestNr in Reservation Observe that we have a new set of keys: { {GuestNr}, {RoomNr, ArrivalDate} } And thus a new generated database scheme: Reservation(GuestNr, GuestName, City, Street, RoomNr, ArrivalDate, NrDays) Room(RoomNr, RoomName, NrBeds, Cost)

More Related