explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ehu0 : Optimization for: plan #8hrF

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.981 59.326 ↑ 1.1 2,288 1

Nested Loop Anti Join (cost=223.90..38,700.66 rows=2,612 width=103) (actual time=2.383..59.326 rows=2,288 loops=1)

  • Join Filter: (tagdeviceshistory.tdh_nl_personnel_id = nlm.nl_id)
  • Rows Removed by Join Filter: 9,157
2. 1.882 56.345 ↑ 1.1 2,291 1

Nested Loop Left Join (cost=223.90..38,526.60 rows=2,613 width=65) (actual time=2.347..56.345 rows=2,291 loops=1)

3. 1.799 6.352 ↑ 1.1 2,291 1

Hash Join (cost=223.61..460.27 rows=2,613 width=36) (actual time=2.307..6.352 rows=2,291 loops=1)

  • Hash Cond: (entities.e_id = nlm.nl_e_id)
4. 2.321 2.321 ↑ 1.0 8,426 1

Seq Scan on entities (cost=0.00..178.93 rows=8,426 width=7) (actual time=0.011..2.321 rows=8,426 loops=1)

  • Filter: (e_et_code = ANY ('{VMTR,TAG,PSD}'::text[]))
  • Rows Removed by Filter: 878
5. 0.741 2.232 ↑ 1.0 2,885 1

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 180kB
6. 1.491 1.491 ↑ 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.050..1.491 rows=2,885 loops=1)

7. 0.000 48.111 ↓ 0.0 0 2,291

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

8. 0.000 48.111 ↓ 0.0 0 2,291

Nested Loop (cost=0.29..14.55 rows=1 width=29) (actual time=0.021..0.021 rows=0 loops=2,291)

9. 4.518 48.111 ↓ 0.0 0 2,291

Nested Loop (cost=0.29..13.07 rows=1 width=29) (actual time=0.021..0.021 rows=0 loops=2,291)

10. 43.529 43.529 ↓ 0.0 0 2,291

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

  • Filter: ((tdh_date_end IS NULL) AND (tdh_nl_lamp_id = nlm.nl_id))
  • Rows Removed by Filter: 221
11. 0.064 0.064 ↑ 1.0 1 4

Index Scan using nodeslogical_pkey on nodeslogical nlr (cost=0.29..8.30 rows=1 width=33) (actual time=0.016..0.016 rows=1 loops=4)

  • Index Cond: (nl_id = tagdeviceshistory_1.tdh_nl_personnel_id)
  • Filter: (nl_isactive = 1)
  • Rows Removed by Filter: 0
12. 0.012 0.012 ↑ 1.0 1 3

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

  • Filter: (((sa_key)::text = 'enableRFID'::text) AND ((sa_value)::text = '1'::text))
  • Rows Removed by Filter: 4
13. 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)

14. 0.026 0.026 ↑ 1.0 4 1

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

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