Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Unique (cost=2978200940.36..2978201098.74 rows=200 width=36) (actual time=3083.456..3085.229 rows=23 loops=1)
- Buffers: shared hit=160754, local hit=310, temp read=2360 written=2366
- -> Merge Anti Join (cost=2978200940.36..2978201059.32 rows=15767 width=36) (actual time=3083.455..3085.214 rows=149 loops=1)
- Merge Cond: (master.gateway_id = alerts.gateway_id)
- Buffers: shared hit=160754, local hit=310, temp read=2360 written=2366
- -> Merge Anti Join (cost=2978200684.55..2978200763.82 rows=15788 width=4) (actual time=3082.874..3084.689 rows=2713 loops=1)
- Merge Cond: (master.gateway_id = alerts_1.gateway_id)
- Buffers: shared hit=160397, local hit=310, temp read=2360 written=2366
- -> Sort (cost=2978200428.74..2978200468.27 rows=15810 width=4) (actual time=3082.361..3083.062 rows=11393 loops=1)
- Sort Key: master.gateway_id
- Sort Method: quicksort Memory: 919kB
- Buffers: shared hit=160040, local hit=310, temp read=2360 written=2366
- -> Hash Anti Join (cost=2665184930.53..2978199326.11 rows=15810 width=4) (actual time=2981.109..3079.755 rows=11393 loops=1)
- Hash Cond: (master.gateway_id = tmp_gateway_params.gateway_id)
- Buffers: shared hit=160040, local hit=310, temp read=2360 written=2366
- -> Seq Scan on tmp_gateway_params master (cost=0.00..471.20 rows=31620 width=4) (actual time=0.016..2.790 rows=28669 loops=1)
- Buffers: local hit=155
- -> Hash (cost=1350530154.72..1350530154.72 rows=80131338705 width=4) (actual time=2961.395..2961.395 rows=42765 loops=1)
- Buckets: 131072 Batches: 524288 Memory Usage: 1024kB
- Buffers: shared hit=160040, local hit=155, temp read=661 written=667
- -> Merge Join (cost=147292817.08..1350530154.72 rows=80131338705 width=4) (actual time=2816.646..2949.841 rows=42765 loops=1)
- Merge Cond: (tmp_gateway_params.parameter_id = parameter_values_202006.parameter_id)
- Buffers: shared hit=160040, local hit=155, temp read=661 written=667
- -> Sort (cost=2834.57..2913.62 rows=31620 width=12) (actual time=15.672..18.340 rows=28669 loops=1)
- Sort Key: tmp_gateway_params.parameter_id
- Sort Method: quicksort Memory: 2112kB
- Buffers: shared hit=7, local hit=155
- -> Seq Scan on tmp_gateway_params (cost=0.00..471.20 rows=31620 width=12) (actual time=0.014..6.264 rows=28669 loops=1)
- Buffers: local hit=155
- -> Materialize (cost=147289982.51..149824180.45 rows=506839587 width=4) (actual time=2796.094..2890.540 rows=381894 loops=1)
- Buffers: shared hit=160033, temp read=661 written=667
- -> Sort (cost=147289982.51..148557081.48 rows=506839587 width=4) (actual time=2796.089..2843.421 rows=381894 loops=1)
- Sort Key: parameter_values_202006.parameter_id
- Sort Method: external merge Disk: 5288kB
- Buffers: shared hit=160033, temp read=661 written=667
- -> Append (cost=0.00..46290895.48 rows=506839587 width=4) (actual time=1292.905..2677.108 rows=382936 loops=1)
- Buffers: shared hit=160033
- Subplans Removed: 30
- -> Seq Scan on parameter_values_202006 (cost=0.00..452878.48 rows=446392 width=4) (actual time=1292.903..2647.414 rows=382936 loops=1)
- Filter: (datetime >= (now() - '02:00:00'::interval))
- Rows Removed by Filter: 16395555
- Buffers: shared hit=160027
- -> Bitmap Heap Scan on parameter_values_202007 (cost=18.19..38.98 rows=617 width=4) (actual time=0.011..0.011 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.010..0.010 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.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_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.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_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.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_202012_pkey (cost=0.00..18.03 rows=617 width=0) (actual time=0.003..0.003 rows=0 loops=1)
- Index Cond: (datetime >= (now() - '02:00:00'::interval))
- Buffers: shared hit=1
- -> Sort (cost=255.81..255.81 rows=2 width=4) (actual time=0.494..0.512 rows=320 loops=1)
- Sort Key: alerts_1.gateway_id
- Sort Method: quicksort Memory: 40kB
- Buffers: shared hit=357
- -> Hash Join (cost=8.47..255.80 rows=2 width=4) (actual time=0.048..0.430 rows=321 loops=1)
- Hash Cond: (alerts_1.alert_type_id = alert_types_1.id)
- Buffers: shared hit=357
- -> Index Scan using index_alerts_on_actual_status on alerts alerts_1 (cost=0.29..245.86 rows=663 width=8) (actual time=0.021..0.300 rows=689 loops=1)
- Index Cond: (actual_status = 0)
- Buffers: shared hit=355
- -> Hash (cost=8.17..8.17 rows=1 width=8) (actual time=0.011..0.011 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.009 rows=1 loops=1)
- Index Cond: ((name)::text = 'one_energy_offline'::text)
- Buffers: shared hit=2
- -> Sort (cost=255.81..255.81 rows=2 width=4) (actual time=0.276..0.284 rows=129 loops=1)
- Sort Key: alerts.gateway_id
- Sort Method: quicksort Memory: 31kB
- Buffers: shared hit=357
- -> Hash Join (cost=8.47..255.80 rows=2 width=4) (actual time=0.018..0.252 rows=135 loops=1)
- Hash Cond: (alerts.alert_type_id = alert_types.id)
- Buffers: shared hit=357
- -> Index Scan using index_alerts_on_actual_status on alerts (cost=0.29..245.86 rows=663 width=8) (actual time=0.008..0.165 rows=689 loops=1)
- Index Cond: (actual_status = 0)
- Buffers: shared hit=355
- -> 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: 2.527 ms
- Execution Time: 3087.304 ms
Add Comment
Please, Sign In to add comment