Closed yhuelf closed 2 years ago
Hello,
If I am right, the UI takes predicates from pg_qualstat to generate EXPLAIN query. So if pg_qualstats.sample_rate is too low or if your workload generates too many predicates, it could happen predicates are missing to generate the EXPLAIN query.
OK, it does make sense, thank you for this explanation!
Indeed, but the problem here is different.
The error message is actually complaining about a coalesce(something, ?), like:
select coalesce(null, ?);
ERROR: 42601: syntax error at or near ")"
LINE 1: select coalesce(null, ?);
You have constants in the SELECT part of your statements, and as those aren't quals they're not stored by pg_qualstats. So when the UI tries to get a complete query string to run an explain, it first tries to get it from the non-normalized queries stored by pg_qualstats, but in your case it's not available anymore (as per previous issue). If then fallback to getting a normalized query and try to regenerate one using the quals, and end up with an invalid query as the constants in the SELECT part aren't available anywhere.
This is a known limitation unfortunately.
OK, now I understand better how PoWA works, thank you!
Hi, What does mean this error?
We couldn't get plans for this query, presumably because some parameters are missing: syntax error at or near ")"
I'm not sure too understand what powa is supposed to do, since the queries in pg_stat_statement are normalized.
The related logs are below (anonymized with '_____') :