You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The performance isn't too terrible, it's no worse than most of the hash aggregate queries from clickbench, but this could be massively simplified by the following optimizations:
Getting the optimizer to factorize SUM(h.ResolutionWidth + N) into SUM(h.ResolutionWidth) + COUNT(h) * N
Only calculating SUM(h.ResolutionWidth) and COUNT(h) once and re-using the results.
On the other hand, this is a really contrived example and you could easily re-write it to something like ... WITH SUM(h.ResolutionWidth) as w, COUNT(h) as c RETURN w, w + c, w + c * 2, w + c * 3, .... But even that is only about 4x faster.
The performance at the moment (on our 2xEPYC 7551 machine) is roughly 3s for the original query, 0.8s for the simplified query I gave above, or just 0.1s for just MATCH (h:hits) RETURN SUM(h.ResolutionWidth), COUNT(h);.
The text was updated successfully, but these errors were encountered:
Description
The following query from ClickBench performs poorly (original sql):
The performance isn't too terrible, it's no worse than most of the hash aggregate queries from clickbench, but this could be massively simplified by the following optimizations:
SUM(h.ResolutionWidth + N)
intoSUM(h.ResolutionWidth) + COUNT(h) * N
SUM(h.ResolutionWidth)
andCOUNT(h)
once and re-using the results.On the other hand, this is a really contrived example and you could easily re-write it to something like
... WITH SUM(h.ResolutionWidth) as w, COUNT(h) as c RETURN w, w + c, w + c * 2, w + c * 3, ...
. But even that is only about 4x faster.The performance at the moment (on our 2xEPYC 7551 machine) is roughly 3s for the original query, 0.8s for the simplified query I gave above, or just 0.1s for just
MATCH (h:hits) RETURN SUM(h.ResolutionWidth), COUNT(h);
.The text was updated successfully, but these errors were encountered: