explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Puxv

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 107.932 ↑ 1.0 1 1

Aggregate (cost=41,580.18..41,580.19 rows=1 width=72) (actual time=107.932..107.932 rows=1 loops=1)

2. 0.389 107.928 ↑ 1.0 1 1

Aggregate (cost=41,580.15..41,580.16 rows=1 width=20) (actual time=107.928..107.928 rows=1 loops=1)

3. 0.000 107.539 ↓ 1,632.0 1,632 1

Nested Loop (cost=2,177.77..41,580.14 rows=1 width=10) (actual time=13.978..107.539 rows=1,632 loops=1)

4. 1.755 79.264 ↓ 14,138.0 14,138 1

Hash Join (cost=2,177.35..41,578.97 rows=1 width=8) (actual time=13.842..79.264 rows=14,138 loops=1)

  • Hash Cond: (ip.inventory_id = i.id)
  • Join Filter: ((SubPlan 1) = ip.id)
  • Rows Removed by Join Filter: 52
5. 7.746 8.876 ↑ 1.0 15,095 1

Bitmap Heap Scan on lego_invpart ip (cost=471.58..39,832.01 rows=15,693 width=20) (actual time=1.914..8.876 rows=15,095 loops=1)

  • Recheck Cond: (part_id = 1)
  • Filter: (NOT is_spare)
  • Heap Blocks: exact=6,413
6. 1.130 1.130 ↑ 1.0 15,100 1

Bitmap Index Scan on lego_invpart_part_id_f6e59342_uniq (cost=0.00..467.66 rows=15,693 width=0) (actual time=1.130..1.130 rows=15,100 loops=1)

  • Index Cond: ((part_id = 1) AND (is_spare = false))
7. 5.366 11.873 ↑ 1.0 56,195 1

Hash (cost=1,002.78..1,002.78 rows=56,239 width=8) (actual time=11.873..11.873 rows=56,195 loops=1)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,708kB
8. 6.507 6.507 ↑ 1.0 56,195 1

Seq Scan on lego_inventory i (cost=0.00..1,002.78 rows=56,239 width=8) (actual time=0.004..6.507 rows=56,195 loops=1)

  • Filter: is_active
  • Rows Removed by Filter: 1,557
9.          

SubPlan (for Hash Join)

10. 14.190 56.760 ↑ 1.0 1 14,190

Aggregate (cost=16.78..16.79 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=14,190)

11. 0.000 42.570 ↑ 1.0 1 14,190

Nested Loop (cost=0.72..16.77 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=14,190)

12. 14.190 14.190 ↑ 1.0 1 14,190

Index Scan using lego_inventory_40ace839 on lego_inventory i2 (cost=0.29..8.31 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=14,190)

  • Index Cond: (set_id = i.set_id)
  • Filter: is_active
  • Rows Removed by Filter: 0
13. 28.652 28.652 ↑ 1.0 1 14,326

Index Scan using lego_invpart_part_id_f6e59342_uniq on lego_invpart ip2 (cost=0.43..8.46 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=14,326)

  • Index Cond: ((part_id = ip.part_id) AND (color_id = ip.color_id) AND (is_spare = false) AND (inventory_id = i2.id))
  • Filter: (NOT is_spare)
14. 28.276 28.276 ↓ 0.0 0 14,138

Index Scan using lego_baseset_pkey on lego_baseset s (cost=0.41..1.16 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=14,138)

  • Index Cond: (id = i.set_id)
  • Filter: (is_active AND ((set_type)::text = 'Set'::text))
  • Rows Removed by Filter: 1
Planning time : 0.620 ms
Execution time : 108.000 ms