-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: either unexport Executor or remove the Executor reference from Session. #10096
Copy link
Copy link
Closed
Labels
C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.E-easyEasy issue to tackle, requires little or no CockroachDB experienceEasy issue to tackle, requires little or no CockroachDB experiencehelp wantedHelp is requested / needed by the one who filed the issue to fix it.Help is requested / needed by the one who filed the issue to fix it.
Milestone
Description
Currently there is both an Executor pointer in sql.Session and the API to use the executor is executor.DoStuff(session, ...). The redundancy of information is confusing.
It also seems that this executor reference in Session is not used for much; we can find it used only for:
e.TxnAbortCount.Inc(1)insession.txnState.updateStateAndCleanupOnErr()(this could be passed explicitly in arguments, since this method is always only called from other executor method)p.session.executor.virtualSchemasinplanner.virtualSchemas()(this dependency could be dropped by hosting the virtualSchemas reference directly in the session objects, which may make sense in the future if we support per-session virtual tables.)
This suggests the executor pointer in Session could be removed, which would incidentally remove an argument from a few function in pgwire.
Alternatively, if we find it interesting to link the session to a particular executor (which makes some sense, if we squint enough) then we could unexport the methods of Executor and have Session be the only interface exported by sql, with appropriate prepare/execute entry points.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-cleanupTech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.E-easyEasy issue to tackle, requires little or no CockroachDB experienceEasy issue to tackle, requires little or no CockroachDB experiencehelp wantedHelp is requested / needed by the one who filed the issue to fix it.Help is requested / needed by the one who filed the issue to fix it.