explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I68k : nacho2

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

GroupAggregate (cost=7,248,607.48..7,248,607.60 rows=1 width=284) (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, p.id, b.name
2. 0.000 0.000 ↓ 0.0

Sort (cost=7,248,607.48..7,248,607.48 rows=1 width=197) (actual rows= loops=)

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

Nested Loop (cost=1,190,988.73..7,248,607.47 rows=1 width=197) (actual rows= loops=)

  • -> Index Only Scan using promotions_campaign_pkey on promotions_campaign c (cost=0.28..1.80 rows=1 width=4)" Index Cond: (id = 5,506)
4. 0.000 0.000 ↓ 0.0

Gather (cost=1,190,988.45..7,248,605.65 rows=1 width=190) (actual rows= loops=)

  • Workers Planned: 2
5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,189,988.45..7,247,605.55 rows=1 width=190) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,189,987.89..7,247,160.76 rows=34 width=194) (actual rows= loops=)

  • Hash Cond: (o.id = oc.order_id)
7. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,188,987.44..7,244,190.15 rows=262,644 width=194) (actual rows= loops=)

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

Hash Join (cost=1,188,986.08..7,243,316.73 rows=262,644 width=198) (actual rows= loops=)

  • Hash Cond: (p.brand_id = b.id)
9. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,187,243.62..7,240,884.78 rows=262,644 width=192) (actual rows= loops=)

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

Parallel Hash Join (cost=1,187,085.24..7,240,032.54 rows=263,342 width=192) (actual rows= loops=)

  • Hash Cond: (op.product_id = p.id)
11. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,106,389.03..7,156,923.66 rows=919,107 width=124) (actual rows= loops=)

  • Hash Cond: (o.shopper_store_branch_id = sb.id)
12. 0.000 0.000 ↓ 0.0

Parallel Hash Join (cost=1,106,168.48..7,148,071.08 rows=3,284,505 width=91) (actual rows= loops=)

  • Hash Cond: ((op.product_id = pb.product_id) AND (o.shopper_store_branch_id = pb.branch_id))
13. 0.000 0.000 ↓ 0.0

Parallel Hash Join (cost=516,150.88..5,079,516.51 rows=46,907,422 width=79) (actual rows= loops=)

  • Hash Cond: (op.order_id = o.id)
14. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on orders_orderproduct op (cost=0.00..4,427,004.32 rows=51,947,140 width=40) (actual rows= loops=)

  • Filter: (((created_by)::text = 'CUSTOMER'::text) OR ((created_by)::text = 'SHOPPER'::text))
15. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=483,532.91..483,532.91 rows=2,609,437 width=39) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on orders_order o (cost=0.00..483,532.91 rows=2,609,437 width=39) (actual rows= loops=)

  • Filter: (((status)::text = 'DELIVERED'::text) AND ((order_kind)::text = 'NORMAL'::text))
17. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=421,997.64..421,997.64 rows=8,450,464 width=12) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on catalog_productbranch pb (cost=0.00..421,997.64 rows=8,450,464 width=12) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=175.80..175.80 rows=3,580 width=45) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Seq Scan on catalog_storebranch sb (cost=0.00..175.80 rows=3,580 width=45) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Parallel Hash (cost=75,440.54..75,440.54 rows=420,454 width=76) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on catalog_product p (cost=0.00..75,440.54 rows=420,454 width=76) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Hash (cost=144.28..144.28 rows=1,128 width=4) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Seq Scan on catalog_store s (cost=0.00..144.28 rows=1,128 width=4) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Hash (cost=1,067.76..1,067.76 rows=53,976 width=14) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Seq Scan on catalog_brand b (cost=0.00..1,067.76 rows=53,976 width=14) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

Hash (cost=1.16..1.16 rows=16 width=4) (actual rows= loops=)

28. 0.000 0.000 ↓ 0.0

Seq Scan on geo_city gc (cost=0.00..1.16 rows=16 width=4) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash (cost=989.36..989.36 rows=887 width=8) (actual rows= loops=)

30. 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=)

  • Index Cond: (campaign_id = 5,506)
31. 0.000 0.000 ↓ 0.0

Index Scan using promotions_productbranchpromotion_f89b815e on promotions_productbranchpromotion pbp (cost=0.56..13.07 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (product_branch_id = pb.id)
  • Filter: (campaign_id = 5,506)