explain.depesz.com

A tool for finding a real cause for slow queries.

Result: fyR

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.017 37,437.400 ↑ 217.4 69 1

Limit (cost=757,495.18..758,095.18 rows=15,000 width=179) (actual time=37,437.294..37,437.400 rows=69 loops=1)

2. 0.080 37,437.383 ↑ 757.2 69 1

Unique (cost=757,495.18..759,585.02 rows=52,246 width=179) (actual time=37,437.291..37,437.383 rows=69 loops=1)

3. 0.249 37,437.303 ↑ 746.4 70 1

Sort (cost=757,495.18..757,625.79 rows=52,246 width=179) (actual time=37,437.290..37,437.303 rows=70 loops=1)

  • Sort Key: public.events.eventid, public.events.objectid, (to_char(to_timestamp((public.events.clock)::double precision), 'DD/MM/YYYY HH24:MI:SS'::text)), public.events.value, public.events.acknowledged, triggers.description, functions.itemid, items.description, items.hostid, templates.host, hostmacro.value, hosts.host, triggers.priority, items.lastvalue
  • Sort Method: quicksort Memory: 43kB
4. 1.012 37,437.054 ↑ 746.4 70 1

Hash Left Join (cost=4,190.68..753,400.91 rows=52,246 width=179) (actual time=36,366.496..37,437.054 rows=70 loops=1)

  • Hash Cond: (items.templateid = templates.hostid)
5. 0.098 37,435.788 ↑ 746.4 70 1

Hash Join (cost=4,145.03..752,333.27 rows=52,246 width=170) (actual time=36,365.913..37,435.788 rows=70 loops=1)

  • Hash Cond: (items.hostid = hosts.hostid)
6. 0.126 37,430.627 ↑ 746.4 70 1

Hash Join (cost=3,807.14..751,277.00 rows=52,246 width=144) (actual time=36,360.819..37,430.627 rows=70 loops=1)

  • Hash Cond: (functions.itemid = items.itemid)
7. 0.132 37,408.682 ↑ 746.4 70 1

Hash Join (cost=968.43..747,262.75 rows=52,246 width=84) (actual time=36,338.953..37,408.682 rows=70 loops=1)

  • Hash Cond: (public.events.objectid = triggers.triggerid)
8. 0.086 37,102.634 ↑ 421.8 69 1

Append (cost=0.00..745,461.96 rows=29,104 width=32) (actual time=36,033.001..37,102.634 rows=69 loops=1)

9. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on events (cost=0.00..34.60 rows=2 width=32) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
10. 0.057 0.057 ↓ 0.0 0 1

Seq Scan on events_y2011m07d30 events (cost=0.00..7.80 rows=1 width=32) (actual time=0.057..0.057 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
11. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on events_y2011m08d06 events (cost=0.00..34.60 rows=2 width=32) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
12. 0.573 0.573 ↓ 0.0 0 1

Seq Scan on events_y2011m08d13 events (cost=0.00..86.98 rows=1 width=32) (actual time=0.573..0.573 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
13. 2.610 2.610 ↓ 0.0 0 1

Seq Scan on events_y2011m08d20 events (cost=0.00..379.24 rows=1 width=32) (actual time=2.610..2.610 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
14. 2.582 2.582 ↓ 0.0 0 1

Seq Scan on events_y2011m08d27 events (cost=0.00..391.52 rows=1 width=32) (actual time=2.582..2.582 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
15. 5.378 5.378 ↓ 0.0 0 1

Seq Scan on events_y2011m09d03 events (cost=0.00..701.70 rows=1 width=32) (actual time=5.378..5.378 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
16. 5.766 5.766 ↓ 0.0 0 1

Seq Scan on events_y2011m09d10 events (cost=0.00..910.06 rows=1 width=32) (actual time=5.766..5.766 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
17. 0.014 0.014 ↓ 0.0 0 1

Seq Scan on events_y2011m09d17 events (cost=0.00..1.34 rows=1 width=32) (actual time=0.014..0.014 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
18. 0.382 0.382 ↓ 0.0 0 1

Seq Scan on events_y2011m09d24 events (cost=0.00..61.68 rows=1 width=32) (actual time=0.382..0.382 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
19. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on events_y2011m10d01 events (cost=0.00..34.60 rows=410 width=32) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
20. 5.383 5.383 ↓ 0.0 0 1

Seq Scan on events_y2011m10d08 events (cost=0.00..912.78 rows=1 width=32) (actual time=5.383..5.383 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
21. 16.430 16.430 ↓ 0.0 0 1

Seq Scan on events_y2011m10d15 events (cost=0.00..2,626.62 rows=1 width=32) (actual time=16.430..16.430 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
22. 17.275 17.275 ↓ 0.0 0 1

Seq Scan on events_y2011m10d22 events (cost=0.00..2,513.12 rows=1 width=32) (actual time=17.275..17.275 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
23. 10.916 10.916 ↓ 0.0 0 1

Seq Scan on events_y2011m10d29 events (cost=0.00..1,681.18 rows=1 width=32) (actual time=10.916..10.916 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
24. 25.087 25.087 ↓ 0.0 0 1

Seq Scan on events_y2011m11d05 events (cost=0.00..4,005.58 rows=1 width=32) (actual time=25.087..25.087 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
25. 30.642 30.642 ↓ 0.0 0 1

Seq Scan on events_y2011m11d12 events (cost=0.00..5,041.12 rows=1 width=32) (actual time=30.642..30.642 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
26. 30.094 30.094 ↓ 0.0 0 1

Seq Scan on events_y2011m11d19 events (cost=0.00..5,124.08 rows=1 width=32) (actual time=30.094..30.094 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
27. 27.047 27.047 ↓ 0.0 0 1

Seq Scan on events_y2011m11d26 events (cost=0.00..4,837.38 rows=1 width=32) (actual time=27.047..27.047 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
28. 13.191 13.191 ↓ 0.0 0 1

Seq Scan on events_y2011m12d03 events (cost=0.00..2,605.26 rows=1 width=32) (actual time=13.191..13.191 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
29. 24.510 24.510 ↓ 0.0 0 1

Seq Scan on events_y2011m12d10 events (cost=0.00..4,813.08 rows=1 width=32) (actual time=24.510..24.510 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
30. 23.121 23.121 ↓ 0.0 0 1

Seq Scan on events_y2011m12d17 events (cost=0.00..4,421.04 rows=1 width=32) (actual time=23.121..23.121 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
31. 21.458 21.458 ↓ 0.0 0 1

Seq Scan on events_y2011m12d24 events (cost=0.00..4,332.92 rows=1 width=32) (actual time=21.458..21.458 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
32. 23.808 23.808 ↓ 0.0 0 1

Seq Scan on events_y2011m12d31 events (cost=0.00..4,259.20 rows=1 width=32) (actual time=23.808..23.808 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
33. 73.265 73.265 ↓ 0.0 0 1

Seq Scan on events_y2012m01d07 events (cost=0.00..13,602.16 rows=1 width=32) (actual time=73.265..73.265 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
34. 301.533 301.533 ↓ 0.0 0 1

Seq Scan on events_y2012m01d14 events (cost=0.00..57,472.36 rows=1 width=32) (actual time=301.533..301.533 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
35. 873.442 873.442 ↓ 0.0 0 1

Seq Scan on events_y2012m01d21 events (cost=0.00..58,714.90 rows=1 width=32) (actual time=873.442..873.442 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
36. 2,207.708 2,207.708 ↓ 0.0 0 1

Seq Scan on events_y2012m01d28 events (cost=0.00..58,733.70 rows=1 width=32) (actual time=2,207.708..2,207.708 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
37. 1,302.261 1,302.261 ↓ 0.0 0 1

Seq Scan on events_y2012m02d04 events (cost=0.00..55,326.56 rows=1 width=32) (actual time=1,302.261..1,302.261 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
38. 768.709 768.709 ↓ 0.0 0 1

Seq Scan on events_y2012m02d11 events (cost=0.00..26,111.68 rows=1 width=32) (actual time=768.709..768.709 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
39. 2,825.254 2,825.254 ↓ 0.0 0 1

Seq Scan on events_y2012m02d18 events (cost=0.00..60,426.54 rows=1 width=32) (actual time=2,825.254..2,825.254 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
40. 2,147.261 2,147.261 ↓ 0.0 0 1

Seq Scan on events_y2012m02d25 events (cost=0.00..38,624.64 rows=292 width=32) (actual time=2,147.261..2,147.261 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
41. 436.527 436.527 ↓ 0.0 0 1

Seq Scan on events_y2012m03d03 events (cost=0.00..8,941.66 rows=1 width=32) (actual time=436.527..436.527 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
42. 915.353 915.353 ↓ 0.0 0 1

Seq Scan on events_y2012m03d10 events (cost=0.00..9,930.18 rows=38 width=32) (actual time=915.353..915.353 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
43. 1,151.426 1,151.426 ↓ 0.0 0 1

Seq Scan on events_y2012m03d17 events (cost=0.00..30,314.96 rows=115 width=32) (actual time=1,151.426..1,151.426 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
44. 1,908.171 1,908.171 ↓ 0.0 0 1

Seq Scan on events_y2012m03d24 events (cost=0.00..43,339.82 rows=1,629 width=32) (actual time=1,908.171..1,908.171 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
45. 4,385.768 4,385.768 ↓ 0.0 0 1

Seq Scan on events_y2012m03d31 events (cost=0.00..55,123.76 rows=5,625 width=32) (actual time=4,385.768..4,385.768 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
46. 4,087.108 4,087.108 ↓ 0.0 0 1

Seq Scan on events_y2012m04d07 events (cost=0.00..59,058.74 rows=6,924 width=32) (actual time=4,087.108..4,087.108 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
47. 5,762.546 5,762.546 ↓ 0.0 0 1

Seq Scan on events_y2012m04d14 events (cost=0.00..61,584.08 rows=4,426 width=32) (actual time=5,762.546..5,762.546 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
48. 6,434.040 6,434.040 ↓ 0.0 0 1

Seq Scan on events_y2012m04d21 events (cost=0.00..50,802.14 rows=8,071 width=32) (actual time=6,434.040..6,434.040 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
49. 1,235.848 1,235.848 ↑ 22.3 69 1

Seq Scan on events_y2012m04d28 events (cost=0.00..7,467.40 rows=1,537 width=32) (actual time=166.246..1,235.848 rows=69 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
50. 0.000 0.000 ↓ 0.0 0 1

Seq Scan on events_y2012m05d05 events (cost=0.00..34.60 rows=2 width=32) (actual time=0.000..0.000 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
51. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on events_y2012m05d12 events (cost=0.00..34.60 rows=2 width=32) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((source = 0) AND ((clock)::double precision > date_part('epoch'::text, '2012-04-30 16:08:52+02'::timestamp with time zone)))
52. 4.949 305.916 ↑ 1.0 8,871 1

Hash (cost=857.55..857.55 rows=8,871 width=68) (actual time=305.916..305.916 rows=8,871 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 896kB
53. 9.124 300.967 ↑ 1.0 8,871 1

Hash Join (cost=447.42..857.55 rows=8,871 width=68) (actual time=6.754..300.967 rows=8,871 loops=1)

  • Hash Cond: (functions.triggerid = triggers.triggerid)
54. 285.116 285.116 ↑ 1.0 8,871 1

Seq Scan on functions (cost=0.00..232.71 rows=8,871 width=16) (actual time=0.004..285.116 rows=8,871 loops=1)

55. 2.903 6.727 ↑ 1.0 5,974 1

Hash (cost=372.74..372.74 rows=5,974 width=52) (actual time=6.727..6.727 rows=5,974 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 513kB
56. 3.824 3.824 ↑ 1.0 5,974 1

Seq Scan on triggers (cost=0.00..372.74 rows=5,974 width=52) (actual time=0.015..3.824 rows=5,974 loops=1)

57. 4.899 21.819 ↑ 1.9 8,817 1

Hash (cost=2,627.76..2,627.76 rows=16,876 width=68) (actual time=21.819..21.819 rows=8,817 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 868kB
58. 16.920 16.920 ↑ 1.9 8,817 1

Seq Scan on items (cost=0.00..2,627.76 rows=16,876 width=68) (actual time=0.015..16.920 rows=8,817 loops=1)

59. 0.129 5.063 ↑ 1.1 239 1

Hash (cost=334.75..334.75 rows=251 width=34) (actual time=5.063..5.063 rows=239 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
60. 0.249 4.934 ↑ 1.1 239 1

Hash Left Join (cost=282.51..334.75 rows=251 width=34) (actual time=4.333..4.934 rows=239 loops=1)

  • Hash Cond: (hosts.hostid = hostmacro.hostid)
61. 0.385 0.385 ↑ 1.1 239 1

Seq Scan on hosts (cost=0.00..42.51 rows=251 width=25) (actual time=0.014..0.385 rows=239 loops=1)

62. 0.933 4.300 ↓ 1.0 2,334 1

Hash (cost=253.79..253.79 rows=2,298 width=17) (actual time=4.300..4.300 rows=2,334 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 110kB
63. 3.367 3.367 ↓ 1.0 2,334 1

Seq Scan on hostmacro (cost=0.00..253.79 rows=2,298 width=17) (actual time=0.010..3.367 rows=2,334 loops=1)

  • Filter: ((macro)::text = '{$ID_EQUIPEMENT}'::text)
64. 0.102 0.254 ↑ 1.1 239 1

Hash (cost=42.51..42.51 rows=251 width=25) (actual time=0.254..0.254 rows=239 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
65. 0.152 0.152 ↑ 1.1 239 1

Seq Scan on hosts templates (cost=0.00..42.51 rows=251 width=25) (actual time=0.005..0.152 rows=239 loops=1)