explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C60m

Settings
# exclusive inclusive rows x rows loops node
1. 1.498 59.881 ↑ 1.4 1,877 1

Hash Join (cost=9,920.27..30,363.02 rows=2,613 width=201) (actual time=33.934..59.881 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.915 33.108 ↑ 1.1 2,280 1

Nested Loop Left Join (cost=9,191.99..29,595.22 rows=2,613 width=132) (actual time=8.538..33.108 rows=2,280 loops=1)

3. 1.010 31.193 ↑ 1.1 2,280 1

Nested Loop Left Join (cost=9,191.70..27,435.20 rows=2,613 width=120) (actual time=8.535..31.193 rows=2,280 loops=1)

4. 0.404 23.343 ↑ 1.1 2,280 1

Nested Loop Left Join (cost=9,191.41..20,078.82 rows=2,613 width=116) (actual time=8.484..23.343 rows=2,280 loops=1)

5. 1.951 9.259 ↑ 1.1 2,280 1

HashAggregate (cost=9,190.99..9,217.12 rows=2,613 width=104) (actual time=8.390..9.259 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.186 7.308 ↑ 1.1 2,280 1

Append (cost=236.40..9,158.32 rows=2,613 width=104) (actual time=1.936..7.308 rows=2,280 loops=1)

7. 0.006 4.082 ↑ 119.3 16 1

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

  • One-Time Filter: $0
8.          

Initplan (forResult)

9. 0.029 0.029 ↑ 1.0 1 1

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

  • Index Cond: ((sa_key)::text = 'enableRFID'::text)
  • Filter: ((sa_value)::text = '1'::text)
10. 0.007 4.047 ↑ 119.3 16 1

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

11. 0.740 3.856 ↑ 83.0 23 1

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

  • Hash Cond: (entities.e_id = nodeslogical.nl_e_id)
12. 1.425 1.425 ↑ 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.062..1.425 rows=6,155 loops=1)

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

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

  • Buckets: 4096 Batches: 1 Memory Usage: 180kB
14. 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.032..0.968 rows=2,885 loops=1)

15. 0.023 0.184 ↑ 1.0 1 23

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

16. 0.069 0.161 ↑ 9.0 1 23

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

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

Index Only Scan using tagdeviceshistory_pkey on tagdeviceshistory (cost=0.14..4.30 rows=9 width=8) (actual time=0.003..0.004 rows=4 loops=23)

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

Hash Anti Join (cost=113.37..318.86 rows=704 width=40) (actual time=1.103..3.040 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.019 0.019 ↑ 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.019..0.019 rows=1 loops=1)

  • Index Cond: ((sa_key)::text = 'enableRFID'::text)
  • Filter: ((sa_value)::text = '1'::text)
21. 0.975 2.579 ↓ 3.2 2,268 1

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

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

23. 0.431 0.964 ↑ 1.0 2,271 1

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

  • Buckets: 4096 Batches: 1 Memory Usage: 122kB
24. 0.533 0.533 ↑ 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.092..0.533 rows=2,271 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.033 0.033 ↑ 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.031..0.033 rows=4 loops=1)

  • Heap Fetches: 0
27. 2.280 13.680 ↑ 1.0 1 2,280

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

28. 0.080 11.400 ↑ 847.0 1 2,280

Result (cost=0.42..3,135.85 rows=847 width=12) (actual time=0.005..0.005 rows=1 loops=2,280)

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

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

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

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

31. 2.526 6.840 ↓ 0.0 0 2,280

Result (cost=0.29..77.88 rows=31 width=8) (actual time=0.003..0.003 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..77.88 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.81 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..274.15 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.336 0.336 ↑ 525.0 1 16

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

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

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

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

Index Scan using nodeslogical_pkey on nodeslogical nlf (cost=0.29..615.52 rows=9,021 width=53) (actual time=0.024..22.859 rows=9,021 loops=1)

Planning time : 4.281 ms