explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dJVu

Settings
# exclusive inclusive rows x rows loops node
1. 1.260 33.064 ↑ 1.4 1,877 1

Hash Join (cost=3,492.29..10,876.24 rows=2,613 width=201) (actual time=11.562..33.064 rows=1,877 loops=1)

  • Hash Cond: (COALESCE(tagtrackingmessagesindexed.ttmi_nl_fixed_id, checkpointmessages.cm_nl_entry_id, trackingmessagesindexed.tmi_nl_fixed_id) = nlf.nl_id)
2. 1.706 27.736 ↑ 1.1 2,280 1

Nested Loop Left Join (cost=3,189.32..10,533.74 rows=2,613 width=132) (actual time=7.429..27.736 rows=2,280 loops=1)

3. 0.000 26.030 ↑ 1.1 2,280 1

Nested Loop Left Join (cost=3,189.04..9,346.71 rows=2,613 width=120) (actual time=7.427..26.030 rows=2,280 loops=1)

4. 2.099 19.266 ↑ 1.1 2,280 1

Nested Loop Left Join (cost=3,188.74..6,856.00 rows=2,613 width=116) (actual time=7.407..19.266 rows=2,280 loops=1)

5. 1.749 8.047 ↑ 1.1 2,280 1

HashAggregate (cost=3,188.32..3,214.45 rows=2,613 width=104) (actual time=7.378..8.047 rows=2,280 loops=1)

  • Group Key: nodeslogical.nl_id, tagdeviceshistory.tdh_nl_lamp_id, nodeslogical.nl_label, nodeslogical.nl_details, entities.e_et_code
6. 0.190 6.298 ↑ 1.1 2,280 1

Append (cost=137.57..3,155.66 rows=2,613 width=104) (actual time=1.532..6.298 rows=2,280 loops=1)

7. 0.005 3.336 ↑ 119.3 16 1

Result (cost=137.57..2,920.44 rows=1,909 width=40) (actual time=1.532..3.336 rows=16 loops=1)

  • One-Time Filter: $0
8.          

Initplan (forResult)

9. 0.013 0.013 ↑ 1.0 1 1

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

  • Filter: (((sa_key)::text = 'enableRFID'::text) AND ((sa_value)::text = '1'::text))
  • Rows Removed by Filter: 20
10. 0.011 3.318 ↑ 119.3 16 1

Nested Loop (cost=136.10..2,918.97 rows=1,909 width=40) (actual time=1.517..3.318 rows=16 loops=1)

11. 0.707 3.215 ↑ 83.0 23 1

Hash Join (cost=134.76..303.64 rows=1,909 width=36) (actual time=1.493..3.215 rows=23 loops=1)

  • Hash Cond: (entities.e_id = nodeslogical.nl_e_id)
12. 1.071 1.071 ↑ 1.0 6,155 1

Index Only Scan using e_index_et_code on entities (cost=0.29..127.00 rows=6,155 width=7) (actual time=0.031..1.071 rows=6,155 loops=1)

  • Index Cond: (e_et_code = 'TAG'::text)
  • Heap Fetches: 0
13. 0.554 1.437 ↑ 1.0 2,885 1

Hash (cost=98.41..98.41 rows=2,885 width=37) (actual time=1.436..1.437 rows=2,885 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 180kB
14. 0.883 0.883 ↑ 1.0 2,885 1

Index Scan using nl_index_isactive on nodeslogical (cost=0.28..98.41 rows=2,885 width=37) (actual time=0.022..0.883 rows=2,885 loops=1)

15. 0.000 0.092 ↑ 1.0 1 23

Limit (cost=1.35..1.35 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=23)

16. 0.046 0.092 ↑ 9.0 1 23

Sort (cost=1.35..1.37 rows=9 width=8) (actual time=0.003..0.004 rows=1 loops=23)

  • Sort Key: tagdeviceshistory.tdh_date_start DESC
  • Sort Method: top-N heapsort Memory: 25kB
17. 0.046 0.046 ↑ 2.2 4 23

Index Only Scan using tagdeviceshistory_pkey on tagdeviceshistory (cost=0.14..1.30 rows=9 width=8) (actual time=0.001..0.002 rows=4 loops=23)

  • Index Cond: (tdh_nl_personnel_id = nodeslogical.nl_id)
  • Heap Fetches: 0
18. 0.392 2.772 ↓ 3.2 2,264 1

Hash Anti Join (cost=79.68..196.03 rows=704 width=40) (actual time=0.825..2.772 rows=2,264 loops=1)

  • Hash Cond: (nodeslogical_1.nl_id = tagdeviceshistory_1.tdh_nl_lamp_id)
  • Join Filter: ($2 AND (entities_1.e_et_code = 'PSD'::text))
19.          

Initplan (forHash Anti Join)

20. 0.009 0.009 ↑ 1.0 1 1

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

  • Filter: (((sa_key)::text = 'enableRFID'::text) AND ((sa_value)::text = '1'::text))
  • Rows Removed by Filter: 20
21. 0.944 2.357 ↓ 3.2 2,268 1

Hash Join (cost=75.97..181.67 rows=704 width=36) (actual time=0.798..2.357 rows=2,268 loops=1)

  • Hash Cond: (nodeslogical_1.nl_e_id = entities_1.e_id)
22. 0.634 0.634 ↑ 1.0 2,885 1

Index Scan using nl_index_isactive on nodeslogical nodeslogical_1 (cost=0.28..98.41 rows=2,885 width=37) (actual time=0.009..0.634 rows=2,885 loops=1)

23. 0.353 0.779 ↑ 1.0 2,271 1

Hash (cost=47.30..47.30 rows=2,271 width=7) (actual time=0.779..0.779 rows=2,271 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 122kB
24. 0.426 0.426 ↑ 1.0 2,271 1

Index Only Scan using e_index_et_code on entities entities_1 (cost=0.29..47.30 rows=2,271 width=7) (actual time=0.024..0.426 rows=2,271 loops=1)

  • Index Cond: (e_et_code = ANY ('{PSD,VMTR}'::text[]))
  • Heap Fetches: 0
25. 0.006 0.014 ↑ 1.0 4 1

Hash (cost=2.19..2.19 rows=4 width=4) (actual time=0.014..0.014 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.008 0.008 ↑ 1.0 4 1

Index Only Scan using tdh_index_active on tagdeviceshistory tagdeviceshistory_1 (cost=0.13..2.19 rows=4 width=4) (actual time=0.007..0.008 rows=4 loops=1)

  • Heap Fetches: 0
27. 0.000 9.120 ↑ 1.0 1 2,280

Limit (cost=0.42..1.36 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=2,280)

28. 0.064 9.120 ↑ 847.0 1 2,280

Result (cost=0.42..795.44 rows=847 width=12) (actual time=0.004..0.004 rows=1 loops=2,280)

  • One-Time Filter: (entities.e_et_code = ANY ('{PSD,VMTR}'::text[]))
29. 9.056 9.056 ↑ 847.0 1 2,264

Index Scan using tmi_indextrackingmobile on trackingmessagesindexed (cost=0.42..795.44 rows=847 width=12) (actual time=0.004..0.004 rows=1 loops=2,264)

  • Index Cond: (tmi_nl_mobile_id = tagdeviceshistory.tdh_nl_lamp_id)
30. 2.280 6.840 ↓ 0.0 0 2,280

Limit (cost=0.29..0.93 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=2,280)

31. 0.246 4.560 ↓ 0.0 0 2,280

Result (cost=0.29..20.15 rows=31 width=8) (actual time=0.002..0.002 rows=0 loops=2,280)

  • One-Time Filter: (entities.e_et_code = 'PSD'::text)
32. 4.314 4.314 ↓ 0.0 0 2,157

Index Scan Backward using checkpointmessages_pkey on checkpointmessages (cost=0.29..20.15 rows=31 width=8) (actual time=0.002..0.002 rows=0 loops=2,157)

  • Index Cond: ((cm_nl_mobile_id = tagdeviceshistory.tdh_nl_lamp_id) AND (cm_date >= COALESCE(trackingmessagesindexed.tmi_disconnect, 0)))
33. 0.000 0.000 ↓ 0.0 0 2,280

Limit (cost=0.29..0.43 rows=1 width=12) (actual time=0.000..0.000 rows=0 loops=2,280)

34. 0.000 0.000 ↓ 0.0 0 2,280

Result (cost=0.29..78.66 rows=525 width=12) (actual time=0.000..0.000 rows=0 loops=2,280)

  • One-Time Filter: (entities.e_et_code = 'TAG'::text)
35. 0.144 0.144 ↑ 525.0 1 16

Index Scan Backward using tagtrackingmessagesindexed_pkey on tagtrackingmessagesindexed (cost=0.29..78.66 rows=525 width=12) (actual time=0.009..0.009 rows=1 loops=16)

  • Index Cond: ((ttmi_nl_personnel_id = nodeslogical.nl_id) AND (ttmi_te_code = 'TRACKING'::text))
36. 1.779 4.068 ↑ 1.0 9,021 1

Hash (cost=190.21..190.21 rows=9,021 width=53) (actual time=4.068..4.068 rows=9,021 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 570kB
37. 2.289 2.289 ↑ 1.0 9,021 1

Seq Scan on nodeslogical nlf (cost=0.00..190.21 rows=9,021 width=53) (actual time=0.012..2.289 rows=9,021 loops=1)

Planning time : 1.420 ms