mirror of
https://0xacab.org/sutty/sutty
synced 2024-10-05 09:16:57 +00:00
optimizar sql usando indices
This commit is contained in:
parent
0c34613cb5
commit
f94ece78cf
1 changed files with 1 additions and 0 deletions
|
@ -37,6 +37,7 @@ class UriCollectionJob < PeriodicJob
|
||||||
# intervalo más amplio.
|
# intervalo más amplio.
|
||||||
Stat::INTERVALS.reduce do |previous, current|
|
Stat::INTERVALS.reduce do |previous, current|
|
||||||
Rollup.where(name: 'host|uri', interval: previous)
|
Rollup.where(name: 'host|uri', interval: previous)
|
||||||
|
.where('time >= ?', beginning_of_interval)
|
||||||
.where_dimensions(host: hostname, uri: uri)
|
.where_dimensions(host: hostname, uri: uri)
|
||||||
.group("dimensions->'host'", "dimensions->'uri'")
|
.group("dimensions->'host'", "dimensions->'uri'")
|
||||||
.rollup('host|uri', interval: current, update: true) do |rollup|
|
.rollup('host|uri', interval: current, update: true) do |rollup|
|
||||||
|
|
Loading…
Reference in a new issue