2 Replies - 339 Views - Last Post: 16 October 2019 - 11:59 PM Rate Topic: -----

#1 4skinLuke   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-October 19

Relational Algebra Query Optimization

Posted 16 October 2019 - 09:03 PM

I have the following relational algebra query and made an attempt to optimize it.

πCustomerID,Name,Date,HNo(σ(CID=CustomerID) Λ (HNo=HotelNo) Λ(RNo=RoomNo) Λ (Price>200) (BOOKING CUSTOMER Hotel))

My optimized query is:
(πCustomerID,Name,Date,HNo (σ(CID=CustomerID(πCustomerID, Name(CUSTOMER))x(σ(HNo=HotelNo) Λ (RNo=RoomNo) ((πHotelNo, RoomNo(HOTEL))x(σPrice>200 (πCID, HNo, RNo, Date, Price(BOOKING)))))))

MY goal was to reduce the intermediate results as much as possible.
I am not really sure if I made the right attempt to optimize the query and if further optimization is possible.

Any feedback is much appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Relational Algebra Query Optimization

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15300
  • View blog
  • Posts: 61,364
  • Joined: 12-June 08

Re: Relational Algebra Query Optimization

Posted 16 October 2019 - 09:38 PM

What database system is this for?
Was This Post Helpful? 0
  • +
  • -

#3 4skinLuke   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-October 19

Re: Relational Algebra Query Optimization

Posted 16 October 2019 - 11:59 PM

View Postmodi123_1, on 16 October 2019 - 09:38 PM, said:

What database system is this for?

PostgreSQL
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1