mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 17:26:21 +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.
|
||||
Stat::INTERVALS.reduce do |previous, current|
|
||||
Rollup.where(name: 'host|uri', interval: previous)
|
||||
.where('time >= ?', beginning_of_interval)
|
||||
.where_dimensions(host: hostname, uri: uri)
|
||||
.group("dimensions->'host'", "dimensions->'uri'")
|
||||
.rollup('host|uri', interval: current, update: true) do |rollup|
|
||||
|
|
Loading…
Reference in a new issue