Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Unique (cost=782681337.41..782681385.83 rows=200 width=36) (actual time=4122.622..4124.357 rows=23 loops=1)
- Buffers: shared hit=222770 dirtied=45, temp read=2339 written=2345
- CTE cte
- -> Nested Loop (cost=8.86..10137.56 rows=9662 width=12) (actual time=0.091..30.385 rows=28744 loops=1)
- Buffers: shared hit=37831
- -> Nested Loop (cost=8.44..8508.54 rows=1754 width=12) (actual time=0.083..14.582 rows=1066 loops=1)
- Buffers: shared hit=10590
- -> Hash Join (cost=8.16..7643.95 rows=1894 width=12) (actual time=0.058..12.249 rows=1111 loops=1)
- Hash Cond: (capturing_devices.capturing_device_type_id = capturing_device_types.id)
- Buffers: shared hit=7258
- -> Seq Scan on capturing_devices (cost=0.00..7540.13 rows=28413 width=16) (actual time=0.006..7.133 rows=28446 loops=1)
- Buffers: shared hit=7256
- -> Hash (cost=8.15..8.15 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)
- Buckets: 1024 Batches: 1 Memory Usage: 9kB
- Buffers: shared hit=2
- -> Index Scan using index_capturing_device_types_on_name on capturing_device_types (cost=0.14..8.15 rows=1 width=8) (actual time=0.009..0.010 rows=1 loops=1)
- Index Cond: ((name)::text = 'ENERGY_COMFOAIR'::text)
- Buffers: shared hit=2
- -> Index Scan using gateways_pkey on gateways (cost=0.28..0.46 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1111)
- Index Cond: (id = capturing_devices.gateway_id)
- Filter: (NOT inactive)
- Rows Removed by Filter: 0
- Buffers: shared hit=3332
- -> Index Scan using parameters_type_device_unique on parameters (cost=0.42..0.82 rows=11 width=12) (actual time=0.003..0.012 rows=27 loops=1066)
- Index Cond: (capturing_device_id = capturing_devices.id)
- Buffers: shared hit=27241
- -> Merge Anti Join (cost=782671199.85..782671236.23 rows=4818 width=36) (actual time=4122.621..4124.345 rows=149 loops=1)
- Merge Cond: (master.gateway_id = alerts.gateway_id)
- Buffers: shared hit=222770 dirtied=45, temp read=2339 written=2345
- -> Merge Anti Join (cost=782670942.25..782670966.48 rows=4824 width=4) (actual time=4122.068..4123.802 rows=3294 loops=1)
- Merge Cond: (master.gateway_id = alerts_1.gateway_id)
- Buffers: shared hit=222436 dirtied=45, temp read=2339 written=2345
- -> Sort (cost=782670684.64..782670696.72 rows=4831 width=4) (actual time=4121.528..4122.162 rows=11718 loops=1)
- Sort Key: master.gateway_id
- Sort Method: quicksort Memory: 934kB
- Buffers: shared hit=222102 dirtied=45, temp read=2339 written=2345
- -> Hash Anti Join (cost=708450171.95..782670389.03 rows=4831 width=4) (actual time=4031.325..4119.154 rows=11718 loops=1)
- Hash Cond: (master.gateway_id = cte.gateway_id)
- Buffers: shared hit=222102 dirtied=45, temp read=2339 written=2345
- -> CTE Scan on cte master (cost=0.00..193.24 rows=9662 width=4) (actual time=0.092..3.282 rows=28744 loops=1)
- Buffers: shared hit=20
- -> Hash (cost=396727205.34..396727205.34 rows=19000257009 width=4) (actual time=4013.567..4013.567 rows=41688 loops=1)
- Buckets: 131072 Batches: 262144 Memory Usage: 1024kB
- Buffers: shared hit=222082 dirtied=45, temp read=651 written=657
- -> Merge Join (cost=110740055.31..396727205.34 rows=19000257009 width=4) (actual time=3875.964..4003.340 rows=41688 loops=1)
- Merge Cond: (cte.parameter_id = parameter_values_202006.parameter_id)
- Buffers: shared hit=222082 dirtied=45, temp read=651 written=657
- -> Sort (cost=832.77..856.93 rows=9662 width=12) (actual time=43.980..46.410 rows=28744 loops=1)
- Sort Key: cte.parameter_id
- Sort Method: quicksort Memory: 2116kB
- Buffers: shared hit=37811
- -> CTE Scan on cte (cost=0.00..193.24 rows=9662 width=12) (actual time=0.002..38.222 rows=28744 loops=1)
- Buffers: shared hit=37811
- -> Materialize (cost=110739222.53..112705715.70 rows=393298634 width=4) (actual time=3827.412..3917.618 rows=377075 loops=1)
- Buffers: shared hit=184271 dirtied=45, temp read=651 written=657
- -> Sort (cost=110739222.53..111722469.12 rows=393298634 width=4) (actual time=3827.409..3871.706 rows=377075 loops=1)
- Sort Key: parameter_values_202006.parameter_id
- Sort Method: external merge Disk: 5208kB
- Buffers: shared hit=184271 dirtied=45, temp read=651 written=657
- -> Append (cost=0.00..38462386.34 rows=393298634 width=4) (actual time=1948.188..3720.997 rows=377076 loops=1)
- Buffers: shared hit=184271 dirtied=45
- Subplans Removed: 30
- -> Seq Scan on parameter_values_202006 (cost=0.00..644051.53 rows=323507 width=4) (actual time=1948.186..3692.410 rows=377076 loops=1)
- Filter: (datetime >= (now() - '02:00:00'::interval))
- Rows Removed by Filter: 25947993
- Buffers: shared hit=184265 dirtied=45
- -> Bitmap Heap Scan on parameter_values_202007 (cost=18.19..38.98 rows=617 width=4) (actual time=0.009..0.009 rows=0 loops=1)
- Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Index Scan on parameter_values_202007_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.007..0.007 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Heap Scan on parameter_values_202008 (cost=18.19..38.98 rows=617 width=4) (actual time=0.002..0.003 rows=0 loops=1)
- Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Index Scan on parameter_values_202008_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.002..0.002 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Heap Scan on parameter_values_202009 (cost=18.19..38.98 rows=617 width=4) (actual time=0.003..0.003 rows=0 loops=1)
- Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Index Scan on parameter_values_202009_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.002..0.002 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Heap Scan on parameter_values_202010 (cost=18.19..38.98 rows=617 width=4) (actual time=0.003..0.003 rows=0 loops=1)
- Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Index Scan on parameter_values_202010_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.002..0.002 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Heap Scan on parameter_values_202011 (cost=18.19..38.98 rows=617 width=4) (actual time=0.003..0.003 rows=0 loops=1)
- Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Index Scan on parameter_values_202011_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.002..0.002 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Heap Scan on parameter_values_202012 (cost=18.19..38.98 rows=617 width=4) (actual time=0.002..0.002 rows=0 loops=1)
- Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Bitmap Index Scan on parameter_values_202012_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.002..0.002 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Sort (cost=257.60..257.61 rows=2 width=4) (actual time=0.524..0.541 rows=307 loops=1)
- Sort Key: alerts_1.gateway_id
- Sort Method: quicksort Memory: 39kB
- Buffers: shared hit=334
- -> Hash Join (cost=8.47..257.59 rows=2 width=4) (actual time=0.043..0.466 rows=309 loops=1)
- Hash Cond: (alerts_1.alert_type_id = alert_types_1.id)
- Buffers: shared hit=334
- -> Index Scan using index_alerts_on_actual_status on alerts alerts_1 (cost=0.29..247.65 rows=665 width=8) (actual time=0.022..0.315 rows=708 loops=1)
- Index Cond: (actual_status = 0)
- Buffers: shared hit=332
- -> Hash (cost=8.17..8.17 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=1)
- Buckets: 1024 Batches: 1 Memory Usage: 9kB
- Buffers: shared hit=2
- -> Index Scan using index_alert_types_on_name on alert_types alert_types_1 (cost=0.15..8.17 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)
- Index Cond: ((name)::text = 'one_energy_offline'::text)
- Buffers: shared hit=2
- -> Sort (cost=257.60..257.61 rows=2 width=4) (actual time=0.279..0.288 rows=163 loops=1)
- Sort Key: alerts.gateway_id
- Sort Method: quicksort Memory: 32kB
- Buffers: shared hit=334
- -> Hash Join (cost=8.47..257.59 rows=2 width=4) (actual time=0.018..0.250 rows=166 loops=1)
- Hash Cond: (alerts.alert_type_id = alert_types.id)
- Buffers: shared hit=334
- -> Index Scan using index_alerts_on_actual_status on alerts (cost=0.29..247.65 rows=665 width=8) (actual time=0.007..0.158 rows=708 loops=1)
- Index Cond: (actual_status = 0)
- Buffers: shared hit=332
- -> Hash (cost=8.17..8.17 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)
- Buckets: 1024 Batches: 1 Memory Usage: 9kB
- Buffers: shared hit=2
- -> Index Scan using index_alert_types_on_name on alert_types (cost=0.15..8.17 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=1)
- Index Cond: ((name)::text = 'gateway_offline'::text)
- Buffers: shared hit=2
- Planning Time: 1.873 ms
- Execution Time: 4126.011 ms
Add Comment
Please, Sign In to add comment