FIX: Error when calculating geometric mean of 0 for read timings
This commit is contained in:
parent
243b5756ee
commit
27a73c73f9
|
@ -505,7 +505,7 @@ class Post < ActiveRecord::Base
|
||||||
SET avg_time = (x.gmean / 1000)
|
SET avg_time = (x.gmean / 1000)
|
||||||
FROM (SELECT post_timings.topic_id,
|
FROM (SELECT post_timings.topic_id,
|
||||||
post_timings.post_number,
|
post_timings.post_number,
|
||||||
round(exp(avg(ln(msecs)))) AS gmean
|
round(exp(avg(CASE WHEN msecs > 0 THEN ln(msecs) ELSE 0 END))) AS gmean
|
||||||
FROM post_timings
|
FROM post_timings
|
||||||
INNER JOIN posts AS p2
|
INNER JOIN posts AS p2
|
||||||
ON p2.post_number = post_timings.post_number
|
ON p2.post_number = post_timings.post_number
|
||||||
|
|
Loading…
Reference in New Issue