Skip to content

QueryTrace

Defined in: libs/runtime/src/interpreter.ts:410

What the engine did for ONE query() call — counts, never times, so a regression test can assert that a join is not a cartesian product (a real performance defect: one subSkillsIn call evaluated ~211,000 combinations and took 32 s).

Off by default and then costs nothing: no proxy wraps the database and every hook is a single undefined check. Enabled by the trace constructor option or TYPEDBLITE_TRACE=1, and read with lastQueryTrace() — nothing is printed.

Properties

Name Description
candidateRows The rows those lookups returned.
candidatesCalls candidates() lookups, and the rows they returned.
combinationsCreated The sum of every stage’s output: the combinations the engine built.
findRelationsCalls findRelations evaluations, relationHolds and named-relation expansion alike.
relationHoldsCalls relationHolds evaluations, early (pushed-down) and final alike.
relationRows Rows the relation lookups read (findRelationsCalls): role-player combinations, before they are bound.
stages Output size of each stage of combinations(), in the order the stages ran.
statementsExecuted Statements the engine ran during the query: its all, get, run, iterate and exec calls.
statementsPrepared prepare() calls the engine made during the query.

candidateRows: number

Defined in: libs/runtime/src/interpreter.ts:422

The rows those lookups returned.


candidatesCalls: number

Defined in: libs/runtime/src/interpreter.ts:420

candidates() lookups, and the rows they returned.


combinationsCreated: number

Defined in: libs/runtime/src/interpreter.ts:414

The sum of every stage’s output: the combinations the engine built.


findRelationsCalls: number

Defined in: libs/runtime/src/interpreter.ts:418

findRelations evaluations, relationHolds and named-relation expansion alike.


relationHoldsCalls: number

Defined in: libs/runtime/src/interpreter.ts:416

relationHolds evaluations, early (pushed-down) and final alike.


relationRows: number

Defined in: libs/runtime/src/interpreter.ts:424

Rows the relation lookups read (findRelationsCalls): role-player combinations, before they are bound.


readonly stages: object[]

Defined in: libs/runtime/src/interpreter.ts:412

Output size of each stage of combinations(), in the order the stages ran.

combinations: number

stage: string


statementsExecuted: number

Defined in: libs/runtime/src/interpreter.ts:428

Statements the engine ran during the query: its all, get, run, iterate and exec calls.


statementsPrepared: number

Defined in: libs/runtime/src/interpreter.ts:426

prepare() calls the engine made during the query.

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.