Guest User

Untitled

a guest
Jun 8th, 2020
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     Unique  (cost=782681337.41..782681385.83 rows=200 width=36) (actual time=4122.622..4124.357 rows=23 loops=1)
  2.       Buffers: shared hit=222770 dirtied=45, temp read=2339 written=2345
  3.       CTE cte
  4.         ->  Nested Loop  (cost=8.86..10137.56 rows=9662 width=12) (actual time=0.091..30.385 rows=28744 loops=1)
  5.               Buffers: shared hit=37831
  6.               ->  Nested Loop  (cost=8.44..8508.54 rows=1754 width=12) (actual time=0.083..14.582 rows=1066 loops=1)
  7.                     Buffers: shared hit=10590
  8.                     ->  Hash Join  (cost=8.16..7643.95 rows=1894 width=12) (actual time=0.058..12.249 rows=1111 loops=1)
  9.                           Hash Cond: (capturing_devices.capturing_device_type_id = capturing_device_types.id)
  10.                           Buffers: shared hit=7258
  11.                           ->  Seq Scan on capturing_devices  (cost=0.00..7540.13 rows=28413 width=16) (actual time=0.006..7.133 rows=28446 loops=1)
  12.                                 Buffers: shared hit=7256
  13.                           ->  Hash  (cost=8.15..8.15 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=1)
  14.                                 Buckets: 1024  Batches: 1  Memory Usage: 9kB
  15.                                 Buffers: shared hit=2
  16.                                 ->  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)
  17.                                       Index Cond: ((name)::text = 'ENERGY_COMFOAIR'::text)
  18.                                       Buffers: shared hit=2
  19.                     ->  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)
  20.                           Index Cond: (id = capturing_devices.gateway_id)
  21.                           Filter: (NOT inactive)
  22.                           Rows Removed by Filter: 0
  23.                           Buffers: shared hit=3332
  24.               ->  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)
  25.                     Index Cond: (capturing_device_id = capturing_devices.id)
  26.                     Buffers: shared hit=27241
  27.       ->  Merge Anti Join  (cost=782671199.85..782671236.23 rows=4818 width=36) (actual time=4122.621..4124.345 rows=149 loops=1)
  28.             Merge Cond: (master.gateway_id = alerts.gateway_id)
  29.             Buffers: shared hit=222770 dirtied=45, temp read=2339 written=2345
  30.             ->  Merge Anti Join  (cost=782670942.25..782670966.48 rows=4824 width=4) (actual time=4122.068..4123.802 rows=3294 loops=1)
  31.                   Merge Cond: (master.gateway_id = alerts_1.gateway_id)
  32.                   Buffers: shared hit=222436 dirtied=45, temp read=2339 written=2345
  33.                   ->  Sort  (cost=782670684.64..782670696.72 rows=4831 width=4) (actual time=4121.528..4122.162 rows=11718 loops=1)
  34.                         Sort Key: master.gateway_id
  35.                         Sort Method: quicksort  Memory: 934kB
  36.                         Buffers: shared hit=222102 dirtied=45, temp read=2339 written=2345
  37.                         ->  Hash Anti Join  (cost=708450171.95..782670389.03 rows=4831 width=4) (actual time=4031.325..4119.154 rows=11718 loops=1)
  38.                               Hash Cond: (master.gateway_id = cte.gateway_id)
  39.                               Buffers: shared hit=222102 dirtied=45, temp read=2339 written=2345
  40.                               ->  CTE Scan on cte master  (cost=0.00..193.24 rows=9662 width=4) (actual time=0.092..3.282 rows=28744 loops=1)
  41.                                     Buffers: shared hit=20
  42.                               ->  Hash  (cost=396727205.34..396727205.34 rows=19000257009 width=4) (actual time=4013.567..4013.567 rows=41688 loops=1)
  43.                                     Buckets: 131072  Batches: 262144  Memory Usage: 1024kB
  44.                                     Buffers: shared hit=222082 dirtied=45, temp read=651 written=657
  45.                                     ->  Merge Join  (cost=110740055.31..396727205.34 rows=19000257009 width=4) (actual time=3875.964..4003.340 rows=41688 loops=1)
  46.                                           Merge Cond: (cte.parameter_id = parameter_values_202006.parameter_id)
  47.                                           Buffers: shared hit=222082 dirtied=45, temp read=651 written=657
  48.                                           ->  Sort  (cost=832.77..856.93 rows=9662 width=12) (actual time=43.980..46.410 rows=28744 loops=1)
  49.                                                 Sort Key: cte.parameter_id
  50.                                                 Sort Method: quicksort  Memory: 2116kB
  51.                                                 Buffers: shared hit=37811
  52.                                                 ->  CTE Scan on cte  (cost=0.00..193.24 rows=9662 width=12) (actual time=0.002..38.222 rows=28744 loops=1)
  53.                                                       Buffers: shared hit=37811
  54.                                           ->  Materialize  (cost=110739222.53..112705715.70 rows=393298634 width=4) (actual time=3827.412..3917.618 rows=377075 loops=1)
  55.                                                 Buffers: shared hit=184271 dirtied=45, temp read=651 written=657
  56.                                                 ->  Sort  (cost=110739222.53..111722469.12 rows=393298634 width=4) (actual time=3827.409..3871.706 rows=377075 loops=1)
  57.                                                       Sort Key: parameter_values_202006.parameter_id
  58.                                                       Sort Method: external merge  Disk: 5208kB
  59.                                                       Buffers: shared hit=184271 dirtied=45, temp read=651 written=657
  60.                                                       ->  Append  (cost=0.00..38462386.34 rows=393298634 width=4) (actual time=1948.188..3720.997 rows=377076 loops=1)
  61.                                                             Buffers: shared hit=184271 dirtied=45
  62.                                                             Subplans Removed: 30
  63.                                                             ->  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)
  64.                                                                   Filter: (datetime >= (now() - '02:00:00'::interval))
  65.                                                                   Rows Removed by Filter: 25947993
  66.                                                                   Buffers: shared hit=184265 dirtied=45
  67.                                                             ->  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)
  68.                                                                   Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  69.                                                                   Buffers: shared hit=1
  70.                                                                   ->  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)
  71.                                                                         Index Cond: (datetime >= (now() - '02:00:00'::interval))
  72.                                                                         Buffers: shared hit=1
  73.                                                             ->  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)
  74.                                                                   Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  75.                                                                   Buffers: shared hit=1
  76.                                                                   ->  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)
  77.                                                                         Index Cond: (datetime >= (now() - '02:00:00'::interval))
  78.                                                                         Buffers: shared hit=1
  79.                                                             ->  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)
  80.                                                                   Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  81.                                                                   Buffers: shared hit=1
  82.                                                                   ->  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)
  83.                                                                         Index Cond: (datetime >= (now() - '02:00:00'::interval))
  84.                                                                         Buffers: shared hit=1
  85.                                                             ->  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)
  86.                                                                   Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  87.                                                                   Buffers: shared hit=1
  88.                                                                   ->  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)
  89.                                                                         Index Cond: (datetime >= (now() - '02:00:00'::interval))
  90.                                                                         Buffers: shared hit=1
  91.                                                             ->  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)
  92.                                                                   Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  93.                                                                   Buffers: shared hit=1
  94.                                                                   ->  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)
  95.                                                                         Index Cond: (datetime >= (now() - '02:00:00'::interval))
  96.                                                                         Buffers: shared hit=1
  97.                                                             ->  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)
  98.                                                                   Recheck Cond: (datetime >= (now() - '02:00:00'::interval))
  99.                                                                   Buffers: shared hit=1
  100.                                                                   ->  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)
  101.                                                                         Index Cond: (datetime >= (now() - '02:00:00'::interval))
  102.                                                                         Buffers: shared hit=1
  103.                   ->  Sort  (cost=257.60..257.61 rows=2 width=4) (actual time=0.524..0.541 rows=307 loops=1)
  104.                         Sort Key: alerts_1.gateway_id
  105.                         Sort Method: quicksort  Memory: 39kB
  106.                         Buffers: shared hit=334
  107.                         ->  Hash Join  (cost=8.47..257.59 rows=2 width=4) (actual time=0.043..0.466 rows=309 loops=1)
  108.                               Hash Cond: (alerts_1.alert_type_id = alert_types_1.id)
  109.                               Buffers: shared hit=334
  110.                               ->  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)
  111.                                     Index Cond: (actual_status = 0)
  112.                                     Buffers: shared hit=332
  113.                               ->  Hash  (cost=8.17..8.17 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=1)
  114.                                     Buckets: 1024  Batches: 1  Memory Usage: 9kB
  115.                                     Buffers: shared hit=2
  116.                                     ->  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)
  117.                                           Index Cond: ((name)::text = 'one_energy_offline'::text)
  118.                                           Buffers: shared hit=2
  119.             ->  Sort  (cost=257.60..257.61 rows=2 width=4) (actual time=0.279..0.288 rows=163 loops=1)
  120.                   Sort Key: alerts.gateway_id
  121.                   Sort Method: quicksort  Memory: 32kB
  122.                   Buffers: shared hit=334
  123.                   ->  Hash Join  (cost=8.47..257.59 rows=2 width=4) (actual time=0.018..0.250 rows=166 loops=1)
  124.                         Hash Cond: (alerts.alert_type_id = alert_types.id)
  125.                         Buffers: shared hit=334
  126.                         ->  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)
  127.                               Index Cond: (actual_status = 0)
  128.                               Buffers: shared hit=332
  129.                         ->  Hash  (cost=8.17..8.17 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=1)
  130.                               Buckets: 1024  Batches: 1  Memory Usage: 9kB
  131.                               Buffers: shared hit=2
  132.                               ->  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)
  133.                                     Index Cond: ((name)::text = 'gateway_offline'::text)
  134.                                     Buffers: shared hit=2
  135.     Planning Time: 1.873 ms
  136.     Execution Time: 4126.011 ms
Add Comment
Please, Sign In to add comment