From 196dbd3a337f2bfe34da1ac1cc86fd9f18ec20cf Mon Sep 17 00:00:00 2001 From: Calum Grant Date: Thu, 23 Feb 2023 19:01:52 +0000 Subject: [PATCH] Exploratory query to test the API --- .../experimental/queries/PredicateSummaries.ql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ql/ql/src/experimental/queries/PredicateSummaries.ql diff --git a/ql/ql/src/experimental/queries/PredicateSummaries.ql b/ql/ql/src/experimental/queries/PredicateSummaries.ql new file mode 100644 index 00000000000..d3f9d91e706 --- /dev/null +++ b/ql/ql/src/experimental/queries/PredicateSummaries.ql @@ -0,0 +1,18 @@ +/** + * Finds evaluations with very large tuple counts somewhere + */ + +import ql +import codeql_ql.StructuredLogs + +float maxTupleCount(KindPredicatesLog::SummaryEvent evt) { + result = max(KindPredicatesLog::PipeLineRuns r | r.getEvent() = evt | r.getRun(_).getCount(_)) +} + +int maxPipeLineLength(KindPredicatesLog::SummaryEvent evt) { + result = max(evt.getRA().getPipeLine(_).getLength()) +} + +from KindPredicatesLog::SummaryEvent evt +select evt, evt.getResultSize(), evt.getMillis() as ms, maxTupleCount(evt) as mc, evt.getMillis(), + maxPipeLineLength(evt) as len order by mc desc