
























pedantic.run parses a query and returns the patterns that get expensive at runtime — negative-regex matchers, bare selectors, high-cardinality groupings. Send a query, get back JSON findings. No auth, no state.
Post the query as JSON to /api/analyze:
The query is read from the first of these that is present:
?q= param
GET or POST query string
GET /api/analyze?q=rate(...)
query field
JSON or form body
{"query": "rate(...)"}
raw body
text/plain request body
POST body: rate(...)
A JSON object with the original query,
a summary
tally of verdicts, and the
flat list of findings.
✗ invalid
Doesn't type-check — won't run.
● slow
Expensive whatever your data.
◑ runtime_dependent
Cost depends on cardinality.
◐ moderate
Noticeable but usually fine.
○ fast
No concerns found.
200
Analyzed — findings returned.
400
Empty query — nothing to analyze.
422
Could not parse or analyze the query.
Each finding carries a
category
and one or more codes. Here's what every code means.
BARE_SELECTOR
REGEX_MATCHER
NEGATIVE_REGEX
CATCHALL_MATCHER
UNANCHORED_REGEX
LONG_RANGE_VECTOR
SHORT_RANGE_VECTOR
NO_AGGREGATION_HIGH_CARD
SUBQUERY
NESTED_SUBQUERY
HIGH_CARD_GROUPING
SORT_AGGREGATION
VECTOR_JOIN
REDUNDANT_SUBEXPR
ARITY_MISMATCH
ARG_TYPE_MISMATCH
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。