Guest User

Untitled

a guest
Jun 5th, 2020
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Unique  (cost=2978200940.36..2978201098.74 rows=200 width=36) (actual time=3083.456..3085.229 rows=23 loops=1)
  2.   Buffers: shared hit=160754, local hit=310, temp read=2360 written=2366
  3.   ->  Merge Anti Join  (cost=2978200940.36..2978201059.32 rows=15767 width=36) (actual time=3083.455..3085.214 rows=149 loops=1)
  4.         Merge Cond: (master.gateway_id = alerts.gateway_id)
  5.         Buffers: shared hit=160754, local hit=310, temp read=2360 written=2366
  6.         ->  Merge Anti Join  (cost=2978200684.55..2978200763.82 rows=15788 width=4) (actual time=3082.874..3084.689 rows=2713 loops=1)
  7.               Merge Cond: (master.gateway_id = alerts_1.gateway_id)
  8.               Buffers: shared hit=160397, local hit=310, temp read=2360 written=2366
  9.               ->  Sort  (cost=2978200428.74..2978200468.27 rows=15810 width=4) (actual time=3082.361..3083.062 rows=11393 loops=1)
  10.                     Sort Key: master.gateway_id
  11.                     Sort Method: quicksort  Memory: 919kB
  12.                     Buffers: shared hit=160040, local hit=310, temp read=2360 written=2366
  13.                     ->  Hash Anti Join  (cost=2665184930.53..2978199326.11 rows=15810 width=4) (actual time=2981.109..3079.755 rows=11393 loops=1)
  14.                           Hash Cond: (master.gateway_id = tmp_gateway_params.gateway_id)
  15.                           Buffers: shared hit=160040, local hit=310, temp read=2360 written=2366
  16.                           ->  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)
  17.                                 Buffers: local hit=155
  18.                           ->  Hash  (cost=1350530154.72..1350530154.72 rows=80131338705 width=4) (actual time=2961.395..2961.395 rows=42765 loops=1)
  19.                                 Buckets: 131072  Batches: 524288  Memory Usage: 1024kB
  20.                                 Buffers: shared hit=160040, local hit=155, temp read=661 written=667
  21.                                 ->  Merge Join  (cost=147292817.08..1350530154.72 rows=80131338705 width=4) (actual time=2816.646..2949.841 rows=42765 loops=1)
  22.                                       Merge Cond: (tmp_gateway_params.parameter_id = parameter_values_202006.parameter_id)
  23.                                       Buffers: shared hit=160040, local hit=155, temp read=661 written=667
  24.                                       ->  Sort  (cost=2834.57..2913.62 rows=31620 width=12) (actual time=15.672..18.340 rows=28669 loops=1)
  25.                                             Sort Key: tmp_gateway_params.parameter_id
  26.                                             Sort Method: quicksort  Memory: 2112kB
  27.                                             Buffers: shared hit=7, local hit=155
  28.                                             ->  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)
  29.                                                   Buffers: local hit=155
  30.                                       ->  Materialize  (cost=147289982.51..149824180.45 rows=506839587 width=4) (actual time=2796.094..2890.540 rows=381894 loops=1)
  31.                                             Buffers: shared hit=160033, temp read=661 written=667
  32.                                             ->  Sort  (cost=147289982.51..148557081.48 rows=506839587 width=4) (actual time=2796.089..2843.421 rows=381894 loops=1)
  33.                                                   Sort Key: parameter_values_202006.parameter_id
  34.                                                   Sort Method: external merge  Disk: 5288kB
  35.                                                   Buffers: shared hit=160033, temp read=661 written=667
  36.                                                   ->  Append  (cost=0.00..46290895.48 rows=506839587 width=4) (actual time=1292.905..2677.108 rows=382936 loops=1)
  37.                                                         Buffers: shared hit=160033
  38.                                                         Subplans Removed: 30
  39.                                                         ->  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)
  40.                                                               Filter: (datetime >= (now() - '02:00:00'::interval))
  41.                                                               Rows Removed by Filter: 16395555
  42.                                                               Buffers: shared hit=160027
  43.                                                         ->  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)
  44.                                                               Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  45.                                                               Buffers: shared hit=1
  46.                                                               ->  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)
  47.                                                                     Index Cond: (datetime >= (now() - '02:00:00'::interval))
  48.                                                                     Buffers: shared hit=1
  49.                                                         ->  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)
  50.                                                               Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  51.                                                               Buffers: shared hit=1
  52.                                                               ->  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)
  53.                                                                     Index Cond: (datetime >= (now() - '02:00:00'::interval))
  54.                                                                     Buffers: shared hit=1
  55.                                                         ->  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)
  56.                                                               Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  57.                                                               Buffers: shared hit=1
  58.                                                               ->  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)
  59.                                                                     Index Cond: (datetime >= (now() - '02:00:00'::interval))
  60.                                                                     Buffers: shared hit=1
  61.                                                         ->  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)
  62.                                                               Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  63.                                                               Buffers: shared hit=1
  64.                                                               ->  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)
  65.                                                                     Index Cond: (datetime >= (now() - '02:00:00'::interval))
  66.                                                                     Buffers: shared hit=1
  67.                                                         ->  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)
  68.                                                               Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  69.                                                               Buffers: shared hit=1
  70.                                                               ->  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)
  71.                                                                     Index Cond: (datetime >= (now() - '02:00:00'::interval))
  72.                                                                     Buffers: shared hit=1
  73.                                                         ->  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)
  74.                                                               Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  75.                                                               Buffers: shared hit=1
  76.                                                               ->  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)
  77.                                                                     Index Cond: (datetime >= (now() - '02:00:00'::interval))
  78.                                                                     Buffers: shared hit=1
  79.               ->  Sort  (cost=255.81..255.81 rows=2 width=4) (actual time=0.494..0.512 rows=320 loops=1)
  80.                     Sort Key: alerts_1.gateway_id
  81.                     Sort Method: quicksort  Memory: 40kB
  82.                     Buffers: shared hit=357
  83.                     ->  Hash Join  (cost=8.47..255.80 rows=2 width=4) (actual time=0.048..0.430 rows=321 loops=1)
  84.                           Hash Cond: (alerts_1.alert_type_id = alert_types_1.id)
  85.                           Buffers: shared hit=357
  86.                           ->  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)
  87.                                 Index Cond: (actual_status = 0)
  88.                                 Buffers: shared hit=355
  89.                           ->  Hash  (cost=8.17..8.17 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=1)
  90.                                 Buckets: 1024  Batches: 1  Memory Usage: 9kB
  91.                                 Buffers: shared hit=2
  92.                                 ->  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)
  93.                                       Index Cond: ((name)::text = 'one_energy_offline'::text)
  94.                                       Buffers: shared hit=2
  95.         ->  Sort  (cost=255.81..255.81 rows=2 width=4) (actual time=0.276..0.284 rows=129 loops=1)
  96.               Sort Key: alerts.gateway_id
  97.               Sort Method: quicksort  Memory: 31kB
  98.               Buffers: shared hit=357
  99.               ->  Hash Join  (cost=8.47..255.80 rows=2 width=4) (actual time=0.018..0.252 rows=135 loops=1)
  100.                     Hash Cond: (alerts.alert_type_id = alert_types.id)
  101.                     Buffers: shared hit=357
  102.                     ->  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)
  103.                           Index Cond: (actual_status = 0)
  104.                           Buffers: shared hit=355
  105.                     ->  Hash  (cost=8.17..8.17 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)
  106.                           Buckets: 1024  Batches: 1  Memory Usage: 9kB
  107.                           Buffers: shared hit=2
  108.                           ->  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)
  109.                                 Index Cond: ((name)::text = 'gateway_offline'::text)
  110.                                 Buffers: shared hit=2
  111. Planning Time: 2.527 ms
  112. Execution Time: 3087.304 ms
Add Comment
Please, Sign In to add comment