explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yjX8

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

Nested Loop (cost=9,578.58..9,609.46 rows=1 width=201) (actual time=9.633..10.488 rows=1 loops=1)

2. 0.002 10.478 ↑ 1.0 1 1

Nested Loop Left Join (cost=9,578.30..9,601.15 rows=1 width=132) (actual time=9.623..10.478 rows=1 loops=1)

3. 0.001 10.475 ↑ 1.0 1 1

Nested Loop Left Join (cost=9,578.01..9,600.32 rows=1 width=120) (actual time=9.621..10.475 rows=1 loops=1)

4. 0.003 10.464 ↑ 1.0 1 1

Nested Loop Left Join (cost=9,577.72..9,597.50 rows=1 width=116) (actual time=9.610..10.464 rows=1 loops=1)

5. 0.346 10.436 ↑ 1.0 1 1

Subquery Scan on d (cost=9,577.30..9,593.36 rows=1 width=104) (actual time=9.583..10.436 rows=1 loops=1)

  • Filter: (((d.nl_label)::text ~~ '%28E0'::text) AND (d.e_et_code = 'PSD'::text))
  • Rows Removed by Filter: 2,266
6. 0.361 10.090 ↓ 11.3 2,267 1

Unique (cost=9,577.30..9,590.36 rows=200 width=104) (actual time=9.564..10.090 rows=2,267 loops=1)

7. 0.843 9.729 ↑ 1.1 2,280 1

Sort (cost=9,577.30..9,583.83 rows=2,613 width=104) (actual time=9.563..9.729 rows=2,280 loops=1)

  • Sort Key: o.mobile_device_id
  • Sort Method: quicksort Memory: 275kB
8. 0.331 8.886 ↑ 1.1 2,280 1

Subquery Scan on o (cost=9,396.33..9,428.99 rows=2,613 width=104) (actual time=8.420..8.886 rows=2,280 loops=1)

9. 0.556 8.555 ↑ 1.1 2,280 1

Sort (cost=9,396.33..9,402.86 rows=2,613 width=108) (actual time=8.420..8.555 rows=2,280 loops=1)

  • Sort Key: (CASE WHEN (u.e_et_code = 'TAG'::text) THEN 1 ELSE NULL::integer END)
  • Sort Method: quicksort Memory: 275kB
10. 0.344 7.999 ↑ 1.1 2,280 1

Subquery Scan on u (cost=9,189.23..9,248.02 rows=2,613 width=108) (actual time=7.178..7.999 rows=2,280 loops=1)

11. 1.351 7.655 ↑ 1.1 2,280 1

HashAggregate (cost=9,189.23..9,215.36 rows=2,613 width=104) (actual time=7.177..7.655 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
12. 0.195 6.304 ↑ 1.1 2,280 1

Append (cost=236.40..9,156.56 rows=2,613 width=104) (actual time=1.655..6.304 rows=2,280 loops=1)

13. 0.005 3.465 ↑ 119.3 16 1

Result (cost=236.40..8,800.27 rows=1,909 width=40) (actual time=1.655..3.465 rows=16 loops=1)

  • One-Time Filter: $0
14.          

Initplan (for Result)

15. 0.013 0.013 ↑ 1.0 1 1

Index Scan using serveradmin_pkey on serveradmin (cost=0.14..8.16 rows=1 width=0) (actual time=0.013..0.013 rows=1 loops=1)

  • Index Cond: ((sa_key)::text = 'enableRFID'::text)
  • Filter: ((sa_value)::text = '1'::text)
16. 0.008 3.447 ↑ 119.3 16 1

Nested Loop (cost=228.24..8,792.11 rows=1,909 width=40) (actual time=1.640..3.447 rows=16 loops=1)

17. 0.720 3.347 ↑ 83.0 23 1

Hash Join (cost=223.90..449.78 rows=1,909 width=36) (actual time=1.617..3.347 rows=23 loops=1)

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

Index Only Scan using e_index_et_code on entities (cost=0.29..184.00 rows=6,155 width=7) (actual time=0.025..1.045 rows=6,155 loops=1)

  • Index Cond: (e_et_code = 'TAG'::text)
  • Heap Fetches: 0
19. 0.540 1.582 ↑ 1.0 2,885 1

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

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

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

21. 0.023 0.092 ↑ 1.0 1 23

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

22. 0.023 0.069 ↑ 9.0 1 23

Sort (cost=4.35..4.37 rows=9 width=8) (actual time=0.003..0.003 rows=1 loops=23)

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

Index Only Scan using tagdeviceshistory_pkey on tagdeviceshistory (cost=0.14..4.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
24. 0.370 2.644 ↓ 3.2 2,264 1

Hash Anti Join (cost=113.37..317.10 rows=704 width=40) (actual time=0.808..2.644 rows=2,264 loops=1)

  • Hash Cond: (nodeslogical_1.nl_id = tagdeviceshistory_1.tdh_nl_lamp_id)
  • Join Filter: $2
25.          

Initplan (for Hash Anti Join)

26. 0.006 0.006 ↑ 1.0 1 1

Index Scan using serveradmin_pkey on serveradmin serveradmin_1 (cost=0.14..8.16 rows=1 width=0) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: ((sa_key)::text = 'enableRFID'::text)
  • Filter: ((sa_value)::text = '1'::text)
27. 0.885 2.261 ↓ 3.2 2,268 1

Hash Join (cost=96.97..291.82 rows=704 width=36) (actual time=0.796..2.261 rows=2,268 loops=1)

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

Index Scan using nl_index_isactive on nodeslogical nodeslogical_1 (cost=0.28..187.55 rows=2,885 width=37) (actual time=0.008..0.598 rows=2,885 loops=1)

29. 0.354 0.778 ↑ 1.0 2,271 1

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 122kB
30. 0.424 0.424 ↑ 1.0 2,271 1

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

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

Hash (cost=8.19..8.19 rows=4 width=4) (actual time=0.007..0.007 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
32. 0.006 0.006 ↑ 1.0 4 1

Index Only Scan using tdh_index_active on tagdeviceshistory tagdeviceshistory_1 (cost=0.13..8.19 rows=4 width=4) (actual time=0.005..0.006 rows=4 loops=1)

  • Heap Fetches: 0
33. 0.000 0.025 ↑ 1.0 1 1

Limit (cost=0.42..4.12 rows=1 width=12) (actual time=0.025..0.025 rows=1 loops=1)

34. 0.004 0.025 ↑ 832.0 1 1

Result (cost=0.42..3,077.61 rows=832 width=12) (actual time=0.025..0.025 rows=1 loops=1)

  • One-Time Filter: (d.e_et_code = ANY ('{PSD,VMTR}'::text[]))
35. 0.021 0.021 ↑ 832.0 1 1

Index Scan using tmi_indextrackingmobile on trackingmessagesindexed (cost=0.42..3,077.61 rows=832 width=12) (actual time=0.021..0.021 rows=1 loops=1)

  • Index Cond: (tmi_nl_mobile_id = d.mobile_device_id)
36. 0.001 0.010 ↑ 1.0 1 1

Limit (cost=0.29..2.80 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=1)

37. 0.001 0.009 ↑ 31.0 1 1

Result (cost=0.29..77.88 rows=31 width=8) (actual time=0.009..0.009 rows=1 loops=1)

  • One-Time Filter: (d.e_et_code = 'PSD'::text)
38. 0.008 0.008 ↑ 31.0 1 1

Index Scan Backward using checkpointmessages_pkey on checkpointmessages (cost=0.29..77.88 rows=31 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: ((cm_nl_mobile_id = d.mobile_device_id) AND (cm_date >= COALESCE(trackingmessagesindexed.tmi_disconnect, 0)))
39. 0.001 0.001 ↓ 0.0 0 1

Limit (cost=0.29..0.81 rows=1 width=12) (actual time=0.001..0.001 rows=0 loops=1)

40. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.29..274.15 rows=525 width=12) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: (d.e_et_code = 'TAG'::text)
41. 0.000 0.000 ↓ 0.0 0

Index Scan Backward using tagtrackingmessagesindexed_pkey on tagtrackingmessagesindexed (cost=0.29..274.15 rows=525 width=12) (never executed)

  • Index Cond: ((ttmi_nl_personnel_id = d.mobile_details_id) AND (ttmi_te_code = 'TRACKING'::text))
42. 0.006 0.006 ↑ 1.0 1 1

Index Scan using nodeslogical_pkey on nodeslogical nlf (cost=0.29..8.30 rows=1 width=53) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (nl_id = COALESCE(tagtrackingmessagesindexed.ttmi_nl_fixed_id, checkpointmessages.cm_nl_entry_id, trackingmessagesindexed.tmi_nl_fixed_id))