15
Performance Tuning on Hotel Reservations Sanitized consulting story

Performance Tuning on Hotel Reservations

  • Upload
    tamah

  • View
    33

  • Download
    2

Embed Size (px)

DESCRIPTION

Performance Tuning on Hotel Reservations. Sanitized consulting story. Schema 1. Roomdate(hotelid, roomtypeid, date, language, description) Translation(description1, language1, description2, language2) e.g.( “double-room with breakfast”, english, “doppel-zimmer halb pension”, german) - PowerPoint PPT Presentation

Citation preview

Page 1: Performance Tuning on Hotel Reservations

Performance Tuning on HotelReservations

Sanitized consulting story

Page 2: Performance Tuning on Hotel Reservations

Schema 1

• Roomdate(hotelid, roomtypeid, date, language, description)

• Translation(description1, language1, description2, language2) e.g.( “double-room with breakfast”, english, “doppel-zimmer halb pension”, german)

• Any comments so far?

Page 3: Performance Tuning on Hotel Reservations

Procedure 1

• To insert new information about a hotel for a date range, set up a loop in informix over roomtype and then over date that calls a translation subroutine for every roomtype-date combination. Translation looks up information in the translation table.

• Any comments so far?

Page 4: Performance Tuning on Hotel Reservations

Alternative

• Description(descid, language, description)• Roomdate(hotelid, roomtypeid, date,

descid)• Language can be obtained when needed.• Inserting can be done without looping and

without any lookups.• Queries for a particular date roomtype and

hotel require a join with Description.

Page 5: Performance Tuning on Hotel Reservations

New Problem: pricing

• Input: a date range, an occupancy specification (e.g. two adults one child), a hotel, a room type, and other attributes (e.g. half pension, sea view, high speed internet)

• Output: a price per night

• Can write a program for one hotel, but for 100,000?

Page 6: Performance Tuning on Hotel Reservations

Goal• Single framework for all hotels• Table-driven so hotel managers can enter

their specifications without much training or typing.

• Ability to identify inconsistencies and incompleteness.

• Allow sophisticated queries: price shopping, feature shopping.

Page 7: Performance Tuning on Hotel Reservations

Representation

• Represent a room price-distinguishable condition by attribute-value pairs.

• Hotel decides which attributes apply.• Ex: hotel has single and double rooms and

charges more for a cot but only in double rooms.

• (roomtype: single), (roomtype: double), (roomtype: double, cot: yes)

Page 8: Performance Tuning on Hotel Reservations

Processing

• Most specific wins.

• If a customer specifies a single room with a sea view, there is no extra charge for the view since the most specific single room spec has no dependency on view.

• On the other hand double room with cot would get that row’s price.

Page 9: Performance Tuning on Hotel Reservations

Inconsistency

• Get inconsistency if cannot identify a unique most specific.

• Ex: (roomtype: double room; cot: yes)(roomtype: double room; view: sea).

• What happens if one wants a double room with a cot and a sea view?(Disambiguate based on lower price?)

Page 10: Performance Tuning on Hotel Reservations

Detecting Inconsistency

• Advantage of table representation is that detection of inconsistency is hotel independent and requires no analysis of code. Detected at time of spec.

• Ex: (roomtype: double room; cot: yes)(roomtype: double room; view: sea).

• Detection by noticing neither spec is subset of other.

Page 11: Performance Tuning on Hotel Reservations

Detecting Incompleteness

• Hotel specifies mandatory attributes.• For each combination of mandatory

attribute values expect condition for that.• So, all mandatory and no voluntary is

possible.• In our example, if roomtype is the only

mandatory attribute then there should be a row having only double room.

Page 12: Performance Tuning on Hotel Reservations

Dates

• Dates are involved since discounts may require staying entirely within a date range, partly within a date range, over a certain date etc.

• Would be nice to be able to specify these separately and then combine with other attributes as opposed to a big table.

• Still open.

Page 13: Performance Tuning on Hotel Reservations

Queries easily possible

• Customer chooses a city: any double rooms with a sea view under a certain price?

• What is cheapest for this hotel assuming I need a cot?

• What is cheapest for this date range?

Page 14: Performance Tuning on Hotel Reservations

Suggested Implementation

• Boolean vector to indicate included/deleted.

• Indexes on attribute names, on hotels, cluster based on hotel and condition.

• Every selection would return a list of hotel-condition pairs. These should be intersected. Can use either bit vectors or a dynamic hash structure. Dynamic hash usually better.

Page 15: Performance Tuning on Hotel Reservations

Summary and Next Steps

• Table-driven specs can be easier for the user, simpler to implement, and easier to verify.

• How would one make such a thing very efficient?