explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 68kx : Optimization for: plan #8hrF

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.030 8.709 ↓ 1.6 2,288 1

Nested Loop Anti Join (cost=225.36..19,211.46 rows=1,424 width=103) (actual time=1.611..8.709 rows=2,288 loops=1)

  • Join Filter: (tagdeviceshistory.tdh_nl_personnel_id = nlm.nl_id)
  • Rows Removed by Join Filter: 9,157
2.          

Initplan (for Nested Loop Anti Join)

3. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on serveradmin (cost=0.00..1.46 rows=1 width=0) (actual time=0.007..0.007 rows=1 loops=1)

  • Filter: (((sa_key)::text = 'enableRFID'::text) AND ((sa_value)::text = '1'::text))
  • Rows Removed by Filter: 4
4. 1.669 6.672 ↓ 1.6 2,291 1

Nested Loop Left Join (cost=223.90..19,113.16 rows=1,425 width=65) (actual time=1.576..6.672 rows=2,291 loops=1)

5. 1.352 5.003 ↓ 1.6 2,291 1

Hash Join (cost=223.61..445.66 rows=1,425 width=36) (actual time=1.572..5.003 rows=2,291 loops=1)

  • Hash Cond: (entities.e_id = nlm.nl_e_id)
6. 2.103 2.103 ↓ 1.8 8,426 1

Seq Scan on entities (cost=0.00..190.56 rows=4,597 width=7) (actual time=0.014..2.103 rows=8,426 loops=1)

  • Filter: ((e_et_code = ANY ('{VMTR,PSD}'::text[])) OR ((e_et_code = 'TAG'::text) AND $0))
  • Rows Removed by Filter: 878
7. 0.561 1.548 ↑ 1.0 2,885 1

Hash (cost=187.55..187.55 rows=2,885 width=37) (actual time=1.548..1.548 rows=2,885 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 180kB
8. 0.987 0.987 ↑ 1.0 2,885 1

Index Scan using nl_index_isactive on nodeslogical nlm (cost=0.28..187.55 rows=2,885 width=37) (actual time=0.012..0.987 rows=2,885 loops=1)

9. 0.000 0.000 ↓ 0.0 0 2,291

Limit (cost=0.29..13.08 rows=1 width=29) (actual time=0.000..0.000 rows=0 loops=2,291)

10. 0.000 0.000 ↓ 0.0 0 2,291

Result (cost=0.29..13.08 rows=1 width=29) (actual time=0.000..0.000 rows=0 loops=2,291)

  • One-Time Filter: (entities.e_et_code = 'TAG'::text)
11. 0.046 0.483 ↓ 0.0 0 23

Nested Loop (cost=0.29..13.08 rows=1 width=29) (actual time=0.021..0.021 rows=0 loops=23)

12. 0.437 0.437 ↓ 0.0 0 23

Seq Scan on tagdeviceshistory tagdeviceshistory_1 (cost=0.00..4.76 rows=1 width=4) (actual time=0.019..0.019 rows=0 loops=23)

  • Filter: ((tdh_date_end IS NULL) AND (tdh_nl_lamp_id = nlm.nl_id))
  • Rows Removed by Filter: 221
13. 0.000 0.000 ↓ 0.0 0

Index Scan using nodeslogical_pkey on nodeslogical nlr (cost=0.29..8.30 rows=1 width=33) (never executed)

  • Index Cond: (nl_id = tagdeviceshistory_1.tdh_nl_personnel_id)
  • Filter: (nl_isactive = 1)
14. 0.000 0.000 ↑ 1.0 4 2,291

Materialize (cost=0.00..4.23 rows=4 width=4) (actual time=0.000..0.000 rows=4 loops=2,291)

15. 0.029 0.029 ↑ 1.0 4 1

Seq Scan on tagdeviceshistory (cost=0.00..4.21 rows=4 width=4) (actual time=0.017..0.029 rows=4 loops=1)

  • Filter: (tdh_date_end IS NULL)
  • Rows Removed by Filter: 217