explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zGMp

Settings
# exclusive inclusive rows x rows loops node
1. 2.773 419.049 ↓ 1,822.0 1,822 1

Sort (cost=530.59..530.60 rows=1 width=687) (actual time=418.866..419.049 rows=1,822 loops=1)

  • Sort Key: iri.number
  • Sort Method: quicksort Memory: 950kB
2. 8.406 416.276 ↓ 1,822.0 1,822 1

Nested Loop Semi Join (cost=5.40..530.58 rows=1 width=687) (actual time=13.737..416.276 rows=1,822 loops=1)

3. 2.308 387.828 ↓ 1,822.0 1,822 1

Nested Loop (cost=5.40..528.54 rows=1 width=208) (actual time=13.695..387.828 rows=1,822 loops=1)

4. 16.628 381.876 ↓ 1,822.0 1,822 1

Nested Loop (cost=4.97..520.27 rows=1 width=204) (actual time=13.685..381.876 rows=1,822 loops=1)

  • Join Filter: ((firp.inventoryregisterid)::integer = (fir.inventoryregisterid)::integer)
  • Rows Removed by Join Filter: 109320
5. 14.386 354.316 ↓ 1,822.0 1,822 1

Nested Loop (cost=4.97..517.90 rows=1 width=197) (actual time=13.654..354.316 rows=1,822 loops=1)

6. 61.614 246.484 ↓ 46,723.0 46,723 1

Nested Loop (cost=4.69..517.59 rows=1 width=185) (actual time=0.207..246.484 rows=46,723 loops=1)

7. 21.649 91.424 ↓ 23,361.5 46,723 1

Merge Join (cost=4.27..501.05 rows=2 width=102) (actual time=0.193..91.424 rows=46,723 loops=1)

  • Merge Cond: ((irp.inventoryregisterid)::integer = (ir.inventoryregisterid)::integer)
8. 23.816 69.690 ↓ 23,361.5 46,723 1

Nested Loop (cost=0.85..993.76 rows=2 width=93) (actual time=0.092..69.690 rows=46,723 loops=1)

9. 0.547 1.357 ↓ 11.4 2,343 1

Nested Loop (cost=0.43..30.29 rows=205 width=12) (actual time=0.073..1.357 rows=2,343 loops=1)

10. 0.050 0.050 ↑ 1.0 1 1

Index Scan using inventoryregisters_pkey on inventoryregisters (cost=0.14..13.21 rows=1 width=4) (actual time=0.047..0.050 rows=1 loops=1)

  • Filter: ((maininventoryregisterid)::integer = 189)
  • Rows Removed by Filter: 64
11. 0.760 0.760 ↓ 11.7 2,343 1

Index Scan using i_inventoryregisterparts_inventoryregisterid on inventoryregisterparts irp (cost=0.29..15.07 rows=201 width=8) (actual time=0.022..0.760 rows=2,343 loops=1)

  • Index Cond: ((inventoryregisterid)::integer = (inventoryregisters.inventoryregisterid)::integer)
12. 44.517 44.517 ↓ 20.0 20 2,343

Index Scan using i_inventoryregisteritems_inventoryregisterpartid on inventoryregisteritems iri (cost=0.42..4.69 rows=1 width=89) (actual time=0.005..0.019 rows=20 loops=2,343)

  • Index Cond: ((inventoryregisterpartid)::integer = (irp.inventoryregisterpartid)::integer)
  • Filter: ((NOT iscommitedfinal) AND ((inventoryregisterid)::integer = 189) AND ((maininventoryregisteritemid)::integer = (inventoryregisteritemid)::integer))
  • Rows Removed by Filter: 2
13. 0.045 0.085 ↓ 1.0 64 1

Sort (cost=3.42..3.57 rows=61 width=17) (actual time=0.078..0.085 rows=64 loops=1)

  • Sort Key: ir.inventoryregisterid
  • Sort Method: quicksort Memory: 29kB
14. 0.040 0.040 ↓ 1.1 65 1

Seq Scan on inventoryregisters ir (cost=0.00..1.61 rows=61 width=17) (actual time=0.010..0.040 rows=65 loops=1)

15. 93.446 93.446 ↑ 1.0 1 46,723

Index Scan using inventoryregisteritems_pkey on inventoryregisteritems firi (cost=0.42..8.27 rows=1 width=87) (actual time=0.002..0.002 rows=1 loops=46,723)

  • Index Cond: ((inventoryregisteritemid)::integer = (iri.finalinventoryregisteritemid)::integer)
  • Filter: ((inventoryregisterid)::integer = 189)
16. 93.446 93.446 ↓ 0.0 0 46,723

Index Scan using inventoryregisterparts_pkey on inventoryregisterparts firp (cost=0.29..0.31 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=46,723)

  • Index Cond: ((inventoryregisterpartid)::integer = (firi.inventoryregisterpartid)::integer)
  • Filter: (checkuserid IS NOT NULL)
  • Rows Removed by Filter: 1
17. 10.932 10.932 ↑ 1.0 61 1,822

Seq Scan on inventoryregisters fir (cost=0.00..1.61 rows=61 width=15) (actual time=0.002..0.006 rows=61 loops=1,822)

18. 3.644 3.644 ↑ 1.0 1 1,822

Index Scan using inventoryregisteritems_pkey on inventoryregisteritems miri (cost=0.42..8.27 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,822)

  • Index Cond: ((inventoryregisteritemid)::integer = (iri.maininventoryregisteritemid)::integer)
19. 20.042 20.042 ↑ 1.0 1 1,822

Seq Scan on inventoryregisters inventoryregisters_1 (cost=0.00..1.92 rows=1 width=4) (actual time=0.011..0.011 rows=1 loops=1,822)

  • Filter: (((maininventoryregisterid)::integer = 189) AND ((inventoryregisterid)::integer = 189))
  • Rows Removed by Filter: 60
Planning time : 10.487 ms
Execution time : 419.400 ms