Implement Select .... AS OF
syntax to support Stale Read
#24557
Labels
type/enhancement
The issue or PR belongs to an enhancement.
Background
This is a subtask of #21094.
pingcap/parser#1206 has implemented the syntax of the
Select .... FROM xxx AS OF timestamp xxx
syntax, so we have to implement the syntax. for example, we can select with:Implementation
SelectStmt
is different withBeginStmt
(#21897.). The read relative executors have a unified entrygetSnapshotTS
:tidb/executor/builder.go
Lines 1358 to 1362 in 3eedd40
It gets TS from the session variable or the txn context build from the
Optimize
stage. we may need to change the behavior:tidb/planner/optimize.go
Lines 116 to 124 in 3eedd40
Tasks:
as of
ClauseAS OF
and make they are using the same TS. Our current framework is not very good to support one statement to specify multiple TS.The text was updated successfully, but these errors were encountered: