explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tnFx : nacho3

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=25,855.87..25,856.00 rows=1 width=298) (actual rows= loops=)

  • Group Key: (to_char(timezone((sb.timezone)::text, o.actual_delivery_time), 'yyyymmdd'::text)), c.id, o.uuid, sb.name, sb.store_id, s.name, p.id, b.name
2. 0.000 0.000 ↓ 0.0

Sort (cost=25,855.87..25,855.88 rows=1 width=211) (actual rows= loops=)

  • Sort Key: (to_char(timezone((sb.timezone)::text, o.actual_delivery_time), 'yyyymmdd'::text)), o.uuid, sb.name, sb.store_id, s.name, p.id, b.name
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=20,310.60..25,855.86 rows=1 width=211) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=20,310.31..25,854.05 rows=1 width=204) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Index Only Scan using promotions_campaign_pkey on promotions_campaign c (cost=0.28..1.80 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = 5,506)
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=20,310.18..25,853.05 rows=1 width=208) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Index Only Scan using geo_city_pkey on geo_city gc (cost=0.14..0.90 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = sb.city_id)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=20,309.90..25,850.51 rows=1 width=194) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using catalog_store_pkey on catalog_store s (cost=0.28..2.54 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (id = sb.store_id)
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=20,309.61..25,847.84 rows=1 width=188) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using catalog_brand_pkey on catalog_brand b (cost=0.29..2.67 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (id = p.brand_id)
12. 0.000 0.000 ↓ 0.0

Index Scan using catalog_product_pkey on catalog_product p (cost=0.42..2.81 rows=1 width=76) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Gather (cost=20,309.19..25,845.03 rows=1 width=120) (actual rows= loops=)

  • Workers Planned: 2
  • Index Cond: (id = op.product_id)
14. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,309.19..24,844.93 rows=1 width=120) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=19,308.91..24,842.30 rows=1 width=87) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan using catalog_storebranch_pkey on catalog_storebranch sb (cost=0.28..2.63 rows=1 width=45) (actual rows= loops=)

  • Index Cond: (id = pb.branch_id)
17. 0.000 0.000 ↓ 0.0

Merge Join (cost=19,308.34..19,346.22 rows=1,809 width=55) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Index Scan using orders_orde_order_i_b7e52c_idx on orders_orderproduct op (cost=0.57..3.03 rows=1 width=40) (actual rows= loops=)

  • Merge Cond: (pb.branch_id = o.shopper_store_branch_id)
  • Index Cond: ((order_id = o.id) AND (product_id = pb.product_id))
  • Filter: (((created_by)::text = 'CUSTOMER'::text) OR ((created_by)::text = 'SHOPPER'::text))
19. 0.000 0.000 ↓ 0.0

Sort (cost=15,227.71..15,233.31 rows=2,239 width=12) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Sort (cost=4,080.63..4,082.63 rows=802 width=47) (actual rows= loops=)

  • Sort Key: pb.branch_id
  • Sort Key: o.shopper_store_branch_id
21. 0.000 0.000 ↓ 0.0

Nested Loop (cost=74.14..15,103.12 rows=2,239 width=12) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.86..4,041.94 rows=802 width=47) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Parallel Bitmap Heap Scan on promotions_productbranchpromotion pbp (cost=73.70..7,508.02 rows=2,239 width=8) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Index Scan using promotions_ordercampaign_f14acec3 on promotions_ordercampaign oc (cost=0.43..989.36 rows=887 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Index Scan using orders_order_pkey on orders_order o (cost=0.43..3.44 rows=1 width=39) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using catalog_productstore_pkey on catalog_productbranch pb (cost=0.44..3.39 rows=1 width=12) (actual rows= loops=)

  • Recheck Cond: (campaign_id = 5,506)
  • Index Cond: (id = pbp.product_branch_id)
  • Index Cond: (id = oc.order_id)
  • Index Cond: (campaign_id = 5,506)
  • Filter: (((status)::text = 'DELIVERED'::text) AND ((order_kind)::text = 'NORMAL'::text))
27. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on promotions_productbranchpromotion_f14acec3 (cost=0.00..72.36 rows=5,373 width=0) (actual rows= loops=)

  • Index Cond: (campaign_id = 5,506)