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
It looks like the current PQL parser, using instaparse, consumes exorbitant quantities of RAM when attempting to parse or clauses. In a recent test instance with 1G allocated to puppetdb's heap, this query was enough to exhaust the heap in ~3m:
reports {
latest_report? = true and (
certname = "foo22" or
certname = "foo21" or
certname = "foo20" or
certname = "foo19" or
certname = "foo18" or
certname = "foo17" or
certname = "foo16" or
certname = "foo15" or
certname = "foo14" or
certname = "foo13" or
certname = "foo12" or
certname = "foo11" or
certname = "foo10" or
certname = "foo9" or
certname = "foo8" or
certname = "foo7" or
certname = "foo6" or
certname = "foo5" or
certname = "foo4" or
certname = "foo3" or
certname = "foo2" or
certname = "foo1"
)
}
Calling it with 21 OR clauses, the query succeeded in 31s, with 20 in 7s, with 19 in 4s, and so on back down to <1 once you reach 16 clauses.
As a temporary measure, use in instead of a set of ors; or wrap the ors in parentheses, although in general an in will be faster on the postgres side once the query's been parsed and postgres is actually running it.
The text was updated successfully, but these errors were encountered:
It looks like the current PQL parser, using instaparse, consumes exorbitant quantities of RAM when attempting to parse
or
clauses. In a recent test instance with 1G allocated to puppetdb's heap, this query was enough to exhaust the heap in ~3m:Calling it with 21 OR clauses, the query succeeded in 31s, with 20 in 7s, with 19 in 4s, and so on back down to <1 once you reach 16 clauses.
As a temporary measure, use
in
instead of a set ofor
s; or wrap theor
s in parentheses, although in general anin
will be faster on the postgres side once the query's been parsed and postgres is actually running it.The text was updated successfully, but these errors were encountered: