Originally, a query's lifecycle is expected to be complete in the closure of connExecutor.dispatchToExecutionEngine(). This is no longer true for pausable portals as we will rerun this function when re-executing the same portal. For example, the phase sessionphase.PlannerStartExecStmt maybe should only happen when the query is run for the first time.
|
ex.statsCollector.PhaseTimes().SetSessionPhaseTime(sessionphase.PlannerStartExecStmt, timeutil.Now()) |
Similarly, maybe we should set the sessionTracing.TracePlanEnd only when we close the portal.
|
ex.sessionTracing.TracePlanEnd(ctx, err) |
Or maybe we have these phases to be execution-bound rather than query-bound, but we should make it more explicit for pausable portals. Alternatively, we may want to have both execution-bound and query-bound phase markers.
Jira issue: CRDB-25870
Epic CRDB-25183
Originally, a query's lifecycle is expected to be complete in the closure of
connExecutor.dispatchToExecutionEngine(). This is no longer true for pausable portals as we will rerun this function when re-executing the same portal. For example, the phasesessionphase.PlannerStartExecStmtmaybe should only happen when the query is run for the first time.cockroach/pkg/sql/conn_executor_exec.go
Line 1305 in d8ea15c
Similarly, maybe we should set the
sessionTracing.TracePlanEndonly when we close the portal.cockroach/pkg/sql/conn_executor_exec.go
Line 1277 in 2bd2c80
Or maybe we have these phases to be execution-bound rather than query-bound, but we should make it more explicit for pausable portals. Alternatively, we may want to have both execution-bound and query-bound phase markers.
Jira issue: CRDB-25870
Epic CRDB-25183