Compare Query Plans

Comparing the query plans of two tpcc benchmarks: A and B.

  • A benchmarked commit f085f12 using the V3 query planner.
  • B benchmarked commit f085f12 using the Gen4Fallback query planner.

Queries are ordered from the slowest to the fastest. The 50 slowest queries are shown.

select o_id, o_d_id, o_w_id from orders1 where o_id > :vtg1 and o_w_id = :vtg2
A fastest
select no_o_id from new_orders1 where no_d_id = :vtg1 and no_w_id = :vtg2 order by no_o_id asc limit :vtg1 for update
select COUNT(distinct s.s_i_id) from stock1 as s join order_line1 as ol on ol.ol_w_id = s.s_w_id and ol.ol_i_id = s.s_i_id where ol.ol_w_id = :vtg1 and ol.ol_d_id = :vtg1 and ol.ol_o_id < :vtg2 and ol.ol_o_id >= :vtg3 and s.s_w_id = :vtg1 and s.s_quantity < :vtg1
B fastest
select c_balance, c_first, c_middle, c_last from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg2
B fastest
select no_o_id from new_orders1 where no_d_id = :vtg1 and no_w_id = :vtg1 order by no_o_id asc limit :vtg1 for update
A fastest
select COUNT(distinct s.s_i_id) from stock1 as s join order_line1 as ol on ol.ol_w_id = s.s_w_id and ol.ol_i_id = s.s_i_id where ol.ol_w_id = :vtg1 and ol.ol_d_id = :vtg1 and ol.ol_o_id < :vtg2 and ol.ol_o_id >= :vtg3 and s.s_w_id = :vtg1 and s.s_quantity < :vtg4
B fastest
select COUNT(distinct s.s_i_id) from stock1 as s join order_line1 as ol on ol.ol_w_id = s.s_w_id and ol.ol_i_id = s.s_i_id where ol.ol_w_id = :vtg1 and ol.ol_d_id = :vtg2 and ol.ol_o_id < :vtg3 and ol.ol_o_id >= :vtg4 and s.s_w_id = :vtg1 and s.s_quantity < :vtg1
B fastest
select d_next_o_id, d_tax from district1 where d_w_id = :vtg1 and d_id = :vtg1 for update
select d_next_o_id, d_tax from district1 where d_w_id = :vtg1 and d_id = :vtg2 for update
select COUNT(distinct s.s_i_id) from stock1 as s join order_line1 as ol on ol.ol_w_id = s.s_w_id and ol.ol_i_id = s.s_i_id where ol.ol_w_id = :vtg1 and ol.ol_d_id = :vtg2 and ol.ol_o_id < :vtg3 and ol.ol_o_id >= :vtg4 and s.s_w_id = :vtg1 and s.s_quantity < :vtg2
select COUNT(distinct s.s_i_id) from stock1 as s join order_line1 as ol on ol.ol_w_id = s.s_w_id and ol.ol_i_id = s.s_i_id where ol.ol_w_id = :vtg1 and ol.ol_d_id = :vtg2 and ol.ol_o_id < :vtg3 and ol.ol_o_id >= :vtg4 and s.s_w_id = :vtg1 and s.s_quantity < :vtg5
select s_quantity, s_data, s_dist_03 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
B fastest
select c_balance, c_first, c_middle, c_last from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg1
A fastest
select c_balance, c_first, c_middle, c_last from customer1 where c_w_id = :vtg1 and c_d_id = :vtg1 and c_id = :vtg2
A fastest
select d_next_o_id from district1 where d_id = :vtg1 and d_w_id = :vtg1
B fastest
select s_quantity, s_data, s_dist_08 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
B fastest
select s_quantity, s_data, s_dist_09 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
B fastest
select c_discount, c_last, c_credit, w_tax from customer1 as c join warehouse1 as w on c_w_id = w_id where w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg2
B fastest
select c_discount, c_last, c_credit, w_tax from customer1 as c join warehouse1 as w on c_w_id = w_id where w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg1
select c_discount, c_last, c_credit, w_tax from customer1 as c join warehouse1 as w on c_w_id = w_id where w_id = :vtg1 and c_d_id = :vtg1 and c_id = :vtg2
B fastest
select s_quantity, s_data, s_dist_06 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
B fastest
select c_discount, c_last, c_credit, w_tax from customer1 as c join warehouse1 as w on c_w_id = w_id where w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg3
select o_id, o_carrier_id, o_entry_d from orders1 where o_w_id = :vtg1 and o_d_id = :vtg2 and o_c_id = :vtg1 order by o_id desc
B fastest
select c_balance, c_first, c_middle, c_last from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg3
select o_id, o_carrier_id, o_entry_d from orders1 where o_w_id = :vtg1 and o_d_id = :vtg2 and o_c_id = :vtg2 order by o_id desc
B fastest
select d_next_o_id from district1 where d_id = :vtg1 and d_w_id = :vtg2
select s_quantity, s_data, s_dist_10 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
select c_data from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg1
B fastest
select c_balance, c_first, c_middle, c_id from customer1 where c_w_id = :vtg1 and c_d_id = :vtg1 and c_last = :vtg2 order by c_first asc
select o_id, o_carrier_id, o_entry_d from orders1 where o_w_id = :vtg1 and o_d_id = :vtg1 and o_c_id = :vtg2 order by o_id desc
select s_quantity, s_data, s_dist_04 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
A fastest
select s_quantity, s_data, s_dist_01 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
B fastest
select s_quantity, s_data, s_dist_02 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
select s_quantity, s_data, s_dist_05 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
select ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_delivery_d from order_line1 where ol_w_id = :vtg1 and ol_d_id = :vtg1 and ol_o_id = :vtg1
A fastest
select s_quantity, s_data, s_dist_07 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg1 for update
A fastest
select c_data from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg2
A fastest
select c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_zip, c_phone, c_credit, c_credit_lim, c_discount, c_balance, c_ytd_payment, c_since from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg1 for update
select c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_zip, c_phone, c_credit, c_credit_lim, c_discount, c_balance, c_ytd_payment, c_since from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg2 for update
select count(c_id) as namecnt from customer1 where c_w_id = :vtg1 and c_d_id = :vtg1 and c_last = :vtg2
select c_balance, c_first, c_middle, c_id from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_last = :vtg3 order by c_first asc
select c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_zip, c_phone, c_credit, c_credit_lim, c_discount, c_balance, c_ytd_payment, c_since from customer1 where c_w_id = :vtg1 and c_d_id = :vtg1 and c_id = :vtg2 for update
select no_o_id from new_orders1 where no_d_id = :vtg1 and no_w_id = :vtg2 order by no_o_id asc limit :vtg3 for update
select o_id, o_carrier_id, o_entry_d from orders1 where o_w_id = :vtg1 and o_d_id = :vtg2 and o_c_id = :vtg3 order by o_id desc
select ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_delivery_d from order_line1 where ol_w_id = :vtg1 and ol_d_id = :vtg2 and ol_o_id = :vtg2
select count(c_id) as namecnt from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_last = :vtg3
select c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_zip, c_phone, c_credit, c_credit_lim, c_discount, c_balance, c_ytd_payment, c_since from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg3 for update
select c_id from customer1 where c_w_id = :vtg1 and c_d_id = :vtg1 and c_last = :vtg2 order by c_first asc
select i_price, i_name, i_data from item1 where i_id = :vtg1
select c_data from customer1 where c_w_id = :vtg1 and c_d_id = :vtg1 and c_id = :vtg2
A fastest
select c_id from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_last = :vtg3 order by c_first asc
select w_street_1, w_street_2, w_city, w_state, w_zip, w_name from warehouse1 where w_id = :vtg1
select d_street_1, d_street_2, d_city, d_state, d_zip, d_name from district1 where d_w_id = :vtg1 and d_id = :vtg1
select SUM(ol_amount) as sm from order_line1 where ol_o_id = :vtg1 and ol_d_id = :vtg2 and ol_w_id = :vtg3
select no_o_id from new_orders1 where no_d_id = :vtg1 and no_w_id = :vtg2 order by no_o_id asc limit :vtg2 for update
select SUM(ol_amount) as sm from order_line1 where ol_o_id = :vtg1 and ol_d_id = :vtg2 and ol_w_id = :vtg2
select no_o_id from new_orders1 where no_d_id = :vtg1 and no_w_id = :vtg1 order by no_o_id asc limit :vtg2 for update
select s_quantity, s_data, s_dist_07 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_03 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_06 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_05 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_09 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_01 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_04 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_08 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_02 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select s_quantity, s_data, s_dist_10 as s_dist from stock1 where s_i_id = :vtg1 and s_w_id = :vtg2 for update
select d_street_1, d_street_2, d_city, d_state, d_zip, d_name from district1 where d_w_id = :vtg1 and d_id = :vtg2
select o_c_id from orders1 where o_id = :vtg1 and o_d_id = :vtg2 and o_w_id = :vtg2
B fastest
select c_data from customer1 where c_w_id = :vtg1 and c_d_id = :vtg2 and c_id = :vtg3
select o_c_id from orders1 where o_id = :vtg1 and o_d_id = :vtg2 and o_w_id = :vtg3
select count(w_id) from warehouse1 where w_id = :vtg1
Only B