This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener('install', function(e) { | |
self.skipWaiting(); | |
}); | |
self.addEventListener('activate', function(e) { | |
self.registration.unregister() | |
.then(function() { | |
return self.clients.matchAll(); | |
}) | |
.then(function(clients) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delivered-To: [email protected] | |
Received: by 2002:a4a:de4b:0:0:0:0:0 with SMTP id z11csp3925573oot; | |
Mon, 7 Jan 2019 14:31:40 -0800 (PST) | |
X-Received: by 2002:a63:4456:: with SMTP id t22mr12705447pgk.0.1546900300066; | |
Mon, 07 Jan 2019 14:31:40 -0800 (PST) | |
ARC-Seal: i=1; a=rsa-sha256; t=1546900300; cv=none; | |
d=google.com; s=arc-20160816; | |
b=DuyS7m69euwG5TTkNGu0WNjVlOSZk85WNl1OdWIgD8MtP+CZOEk66WwpoCK+JcN19B | |
MNNrPR+n6mnMKa6CL9yppdRVNLQDwwNK2G1IEHSAPtYgRljnZTRGjqLz9GN0w5LYpBMN | |
0zoaJEf5fjoWPQs+vEcAXIMGJ1S5UObc3yoiibSLiATeZLzBFyYZR+STiz5kGdnx+err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> Log.select('DISTINCT ON (sensor_id) logs.*').order('sensor_id, id DESC') | |
Log Load (91447.6ms) SELECT DISTINCT ON (sensor_id) logs.* FROM "logs" ORDER BY sensor_id, id DESC | |
EXPLAIN (1.4ms) EXPLAIN SELECT DISTINCT ON (sensor_id) logs.* FROM "logs" ORDER BY sensor_id, id DESC | |
EXPLAIN for: SELECT DISTINCT ON (sensor_id) logs.* FROM "logs" ORDER BY sensor_id, id DESC | |
QUERY PLAN | |
--------------------------------------------------------------------------------------------------------------- | |
Unique (cost=0.44..1803678.38 rows=180 width=53) | |
-> Index Scan using index_logs_on_sensor_id_and_id on logs (cost=0.44..1735089.77 rows=27435444 width=53) | |
(2 rows) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Log Load (9515.7ms) SELECT "logs".* FROM "logs" WHERE "logs"."id" IN (SELECT MAX(id) FROM "logs" GROUP BY sensor_id) | |
EXPLAIN (2.5ms) EXPLAIN SELECT "logs".* FROM "logs" WHERE "logs"."id" IN (SELECT MAX(id) FROM "logs" GROUP BY sensor_id) | |
EXPLAIN for: SELECT "logs".* FROM "logs" WHERE "logs"."id" IN (SELECT MAX(id) FROM "logs" GROUP BY sensor_id) | |
QUERY PLAN | |
----------------------------------------------------------------------------------------- | |
Nested Loop (cost=705950.15..707475.66 rows=180 width=53) | |
-> HashAggregate (cost=705949.71..705951.51 rows=180 width=4) | |
Group Key: max(logs_1.id) | |
-> HashAggregate (cost=705945.66..705947.46 rows=180 width=8) | |
Group Key: logs_1.sensor_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/sensors" for 127.0.0.1 at 2016-04-17 14:52:51 +1000 | |
Processing by SensorsController#index as HTML | |
User Load (2.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 | |
Sensor Load (4.2ms) SELECT "sensors".* FROM "sensors" | |
Log Load (9636.8ms) SELECT "logs".* FROM "logs" WHERE "logs"."id" IN (SELECT MAX(id) FROM "logs" GROUP BY sensor_id) | |
EXPLAIN (2.0ms) EXPLAIN SELECT "logs".* FROM "logs" WHERE "logs"."id" IN (SELECT MAX(id) FROM "logs" GROUP BY sensor_id) | |
EXPLAIN for: SELECT "logs".* FROM "logs" WHERE "logs"."id" IN (SELECT MAX(id) FROM "logs" GROUP BY sensor_id) | |
QUERY PLAN | |
----------------------------------------------------------------------------------------- | |
Nested Loop (cost=705950.15..707475.66 rows=180 width=53) |