explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qaOl

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

Nested Loop (cost=9,643.52..9,674.39 rows=1 width=201) (actual time=11.817..12.663 rows=1 loops=1)

2. 0.001 12.653 ↑ 1.0 1 1

Nested Loop Left Join (cost=9,643.23..9,666.07 rows=1 width=132) (actual time=11.807..12.653 rows=1 loops=1)

3. 0.002 12.651 ↑ 1.0 1 1

Nested Loop Left Join (cost=9,642.95..9,665.25 rows=1 width=120) (actual time=11.806..12.651 rows=1 loops=1)

4. 0.003 12.639 ↑ 1.0 1 1

Nested Loop Left Join (cost=9,642.65..9,662.44 rows=1 width=116) (actual time=11.794..12.639 rows=1 loops=1)

5. 0.344 12.611 ↑ 1.0 1 1

Subquery Scan on d (cost=9,642.23..9,658.29 rows=1 width=104) (actual time=11.767..12.611 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.386 12.267 ↓ 11.3 2,267 1

Unique (cost=9,642.23..9,655.29 rows=200 width=104) (actual time=11.729..12.267 rows=2,267 loops=1)

7. 0.832 11.881 ↑ 1.1 2,280 1

Sort (cost=9,642.23..9,648.76 rows=2,613 width=104) (actual time=11.728..11.881 rows=2,280 loops=1)

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

Subquery Scan on o (cost=9,461.26..9,493.92 rows=2,613 width=104) (actual time=10.586..11.049 rows=2,280 loops=1)

9. 0.568 10.719 ↑ 1.1 2,280 1

Sort (cost=9,461.26..9,467.79 rows=2,613 width=108) (actual time=10.585..10.719 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.325 10.151 ↑ 1.1 2,280 1

Subquery Scan on u (cost=9,254.16..9,312.95 rows=2,613 width=108) (actual time=9.332..10.151 rows=2,280 loops=1)

11. 1.307 9.826 ↑ 1.1 2,280 1

HashAggregate (cost=9,254.16..9,280.29 rows=2,613 width=104) (actual time=9.331..9.826 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.171 8.519 ↑ 1.1 2,280 1

Append (cost=229.42..9,221.50 rows=2,613 width=104) (actual time=1.581..8.519 rows=2,280 loops=1)

13. 0.005 3.590 ↑ 119.3 16 1

Result (cost=229.42..8,776.88 rows=1,909 width=40) (actual time=1.580..3.590 rows=16 loops=1)

  • One-Time Filter: $0
14.          

Initplan (for Result)

15. 0.015 0.015 ↑ 1.0 1 1

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

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

Nested Loop (cost=227.96..8,775.41 rows=1,909 width=40) (actual time=1.564..3.570 rows=16 loops=1)

17. 0.683 3.464 ↑ 83.0 23 1

Hash Join (cost=223.61..433.08 rows=1,909 width=36) (actual time=1.548..3.464 rows=23 loops=1)

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

Seq Scan on entities (cost=0.00..167.30 rows=6,155 width=7) (actual time=0.020..1.267 rows=6,155 loops=1)

  • Filter: (e_et_code = 'TAG'::text)
  • Rows Removed by Filter: 3,149
19. 0.546 1.514 ↑ 1.0 2,885 1

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

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

21. 0.000 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.046 0.092 ↑ 9.0 1 23

Sort (cost=4.35..4.37 rows=9 width=8) (actual time=0.004..0.004 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.381 4.758 ↓ 3.2 2,264 1

Hash Anti Join (cost=201.69..405.42 rows=704 width=40) (actual time=2.893..4.758 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.011 0.011 ↑ 1.0 1 1

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

  • Filter: (((sa_key)::text = 'enableRFID'::text) AND ((sa_value)::text = '1'::text))
  • Rows Removed by Filter: 20
27. 0.886 4.335 ↓ 3.2 2,268 1

Hash Join (cost=195.97..390.81 rows=704 width=36) (actual time=2.857..4.335 rows=2,268 loops=1)

  • Hash Cond: (nodeslogical_1.nl_e_id = entities_1.e_id)
28. 0.612 0.612 ↑ 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.612 rows=2,885 loops=1)

29. 0.353 2.837 ↑ 1.0 2,271 1

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

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

Seq Scan on entities entities_1 (cost=0.00..167.30 rows=2,271 width=7) (actual time=0.010..2.484 rows=2,271 loops=1)

  • Filter: (e_et_code = ANY ('{PSD,VMTR}'::text[]))
  • Rows Removed by Filter: 7,033
31. 0.002 0.031 ↑ 1.0 4 1

Hash (cost=4.21..4.21 rows=4 width=4) (actual time=0.031..0.031 rows=4 loops=1)

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

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

  • Filter: (tdh_date_end IS NULL)
  • Rows Removed by Filter: 217
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.003 0.025 ↑ 837.0 1 1

Result (cost=0.42..3,095.47 rows=837 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.022 0.022 ↑ 837.0 1 1

Index Scan using tmi_indextrackingmobile on trackingmessagesindexed (cost=0.42..3,095.47 rows=837 width=12) (actual time=0.022..0.022 rows=1 loops=1)

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

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

37. 0.002 0.010 ↑ 31.0 1 1

Result (cost=0.29..77.76 rows=31 width=8) (actual time=0.010..0.010 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.76 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))