explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XwyE

Settings
# exclusive inclusive rows x rows loops node
1. 12.136 600.437 ↓ 5,449.0 5,449 1

GroupAggregate (cost=28,819.85..28,819.96 rows=1 width=79) (actual time=583.443..600.437 rows=5,449 loops=1)

  • Group Key: l.id, la.value
2. 34.878 588.301 ↓ 97,499.0 97,499 1

Sort (cost=28,819.85..28,819.86 rows=1 width=79) (actual time=583.416..588.301 rows=97,499 loops=1)

  • Sort Key: l.id, la.value
  • Sort Method: quicksort Memory: 16783kB
3. 12.368 553.423 ↓ 97,499.0 97,499 1

Nested Loop (cost=693.62..28,819.84 rows=1 width=79) (actual time=2.392..553.423 rows=97,499 loops=1)

4. 3.489 319.418 ↓ 17,049.0 17,049 1

Nested Loop (cost=693.05..28,766.56 rows=1 width=95) (actual time=2.372..319.418 rows=17,049 loops=1)

  • Join Filter: (sbm.partition_id = pbm.id)
5. 9.993 298.880 ↓ 17,049.0 17,049 1

Nested Loop (cost=693.05..28,764.85 rows=1 width=103) (actual time=2.367..298.880 rows=17,049 loops=1)

6. 3.509 186.593 ↓ 17,049.0 17,049 1

Nested Loop (cost=692.34..28,751.77 rows=1 width=61) (actual time=2.346..186.593 rows=17,049 loops=1)

  • Join Filter: (lsr.locality_id = l.id)
7. 8.860 114.888 ↓ 129.2 17,049 1

Hash Join (cost=691.77..28,207.35 rows=132 width=24) (actual time=2.334..114.888 rows=17,049 loops=1)

  • Hash Cond: (lsbm.subset_id = sbm.id)
8. 24.490 106.003 ↓ 5.2 94,860 1

Nested Loop (cost=679.37..28,142.60 rows=18,248 width=24) (actual time=2.301..106.003 rows=94,860 loops=1)

9. 3.718 19.093 ↓ 6.3 31,210 1

Nested Loop (cost=678.94..14,744.84 rows=4,952 width=8) (actual time=2.291..19.093 rows=31,210 loops=1)

10. 0.001 0.011 ↑ 1.0 1 1

Nested Loop (cost=0.27..6.10 rows=1 width=8) (actual time=0.010..0.011 rows=1 loops=1)

  • Join Filter: (sr.partition_id = pr.id)
11. 0.006 0.006 ↑ 1.0 1 1

Index Scan using pk_subset on subset sr (cost=0.27..4.38 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = 41)
12. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on partition pr (cost=0.00..1.61 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=1)

  • Filter: ((name)::text = 'REGIONS'::text)
  • Rows Removed by Filter: 2
13. 13.646 15.364 ↓ 1.1 31,210 1

Bitmap Heap Scan on locality_subset lsr (cost=678.67..11,767.84 rows=29,709 width=16) (actual time=2.280..15.364 rows=31,210 loops=1)

  • Recheck Cond: (subset_id = 41)
  • Heap Blocks: exact=5262
14. 1.718 1.718 ↓ 1.1 31,299 1

Bitmap Index Scan on idx_locality_subset_subset_id (cost=0.00..671.25 rows=29,709 width=0) (actual time=1.718..1.718 rows=31,299 loops=1)

  • Index Cond: (subset_id = 41)
15. 62.420 62.420 ↑ 1.0 3 31,210

Index Only Scan using locality_subset_pkey on locality_subset lsbm (cost=0.43..2.41 rows=3 width=16) (actual time=0.002..0.002 rows=3 loops=31,210)

  • Index Cond: (locality_id = lsr.locality_id)
  • Heap Fetches: 32553
16. 0.002 0.025 ↑ 1.0 3 1

Hash (cost=12.09..12.09 rows=3 width=16) (actual time=0.025..0.025 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.007 0.023 ↑ 1.0 3 1

Bitmap Heap Scan on subset sbm (cost=6.84..12.09 rows=3 width=16) (actual time=0.021..0.023 rows=3 loops=1)

  • Recheck Cond: ((name)::text = ANY ('{FULL_SERVICE,MKT_DELIVERY,EXPRESS_MARKET}'::text[]))
  • Heap Blocks: exact=2
18. 0.016 0.016 ↑ 1.0 3 1

Bitmap Index Scan on unique_name_ss (cost=0.00..6.84 rows=3 width=0) (actual time=0.016..0.016 rows=3 loops=1)

  • Index Cond: ((name)::text = ANY ('{FULL_SERVICE,MKT_DELIVERY,EXPRESS_MARKET}'::text[]))
19. 68.196 68.196 ↑ 1.0 1 17,049

Index Scan using pk_locality on locality l (cost=0.56..4.02 rows=1 width=37) (actual time=0.004..0.004 rows=1 loops=17,049)

  • Index Cond: (id = lsbm.locality_id)
20. 0.000 102.294 ↑ 4.0 1 17,049

Nested Loop (cost=0.71..12.67 rows=4 width=42) (actual time=0.006..0.006 rows=1 loops=17,049)

21. 34.098 34.098 ↑ 1.0 1 17,049

Index Scan using unique_name_ak on attribute_key ak (cost=0.14..4.25 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=17,049)

  • Index Cond: ((name)::text = 'ORIGIN_EXTERNAL_UUID'::text)
22. 68.196 68.196 ↑ 4.0 1 17,049

Index Scan using locality_attribute_locality_id_attribute_key_id_key on locality_attribute la (cost=0.57..8.02 rows=4 width=50) (actual time=0.004..0.004 rows=1 loops=17,049)

  • Index Cond: ((locality_id = l.id) AND (attribute_key_id = ak.id))
23. 17.049 17.049 ↑ 1.0 1 17,049

Seq Scan on partition pbm (cost=0.00..1.61 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=17,049)

  • Filter: ((name)::text = 'BUSINESS_MODEL'::text)
  • Rows Removed by Filter: 3
24. 221.637 221.637 ↑ 3.0 6 17,049

Index Scan using order_delivery_origin_id_created_date_idx on order_delivery od (cost=0.57..51.48 rows=18 width=16) (actual time=0.004..0.013 rows=6 loops=17,049)

  • Index Cond: ((origin_id = l.id) AND (created_date >= (CURRENT_DATE - 2)))
  • Filter: (NOT is_test)
  • Rows Removed by Filter: 0
Planning time : 4.505 ms
Execution time : 600.741 ms