This change limits the results that Postgres uses to evaluate the window. Only `WHERE`, `HAVING`, and `GROUP BY` are used to constrain an `OVER` (not `LIMIT`), so the change to the subquery in the `FROM` clause effectively limits the result set to the number of blocks to include in the average result plus one. We could also use the (timestamp of the most recent + the timestamp of the oldest block) / the count of records returned, but that query requires casts from interval to integer and back to achieve the same result. The window query ends up being similar in how it communicates.pull/336/head
parent
9adad92d71
commit
7bde015bb1
Loading…
Reference in new issue