Judge the query

Q1

Select * from product p
where EXISTS (select * from order_items o
where o.product_id = p.product_id)

Q2

Select * from product p
where product_id IN
(select product_id from order_items
....);

Which of these inferences are valid with respect to the queries given above?

Options
  1. Q1 is more optimized than Q2
  2. Q2 is more optimized than Q1
  3. Q1 performs slowly but is efficient
  4. Q2 performs slowly but is efficient

Related Posts

Close Bitnami banner
Bitnami