-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: support AS OF SYSTEM TIME readonly queries #7139
Conversation
Looks good generally.
|
Review status: 7 of 10 files reviewed at latest revision, 9 unresolved discussions, some commit checks pending. sql/as_of_test.go, line 50 [r1] (raw file):
|
Reviewed 1 of 10 files at r1, 3 of 3 files at r2. sql/executor.go, line 1173 [r2] (raw file):
I'd suggest adding a comment here "Analysis of the select statement is done here to bypass the logic in newPlan(), since that requires the transaction to be started already." Comments from Reviewable |
Reviewed 3 of 3 files at r2. sql/as_of_test.go, line 188 [r1] (raw file):
|
Review status: 8 of 10 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. sql/as_of_test.go, line 104 [r2] (raw file):
|
Review status: 8 of 10 files reviewed at latest revision, 7 unresolved discussions, some commit checks pending. sql/as_of_test.go, line 188 [r1] (raw file):
|
Review status: 8 of 10 files reviewed at latest revision, 13 unresolved discussions, some commit checks failed. sql/executor.go, line 421 [r3] (raw file):
how about sql/executor.go, line 421 [r3] (raw file):
is there a point in supporting txn retries for these reads, given that we can't update the txn timestamp? sql/executor.go, line 465 [r3] (raw file):
assert on the result of sql/executor.go, line 1176 [r3] (raw file):
please comment the return val sql/executor.go, line 1217 [r3] (raw file):
consider add an sql/planner.go, line 56 [r3] (raw file):
this comment is a bit weird. Not clear what transaction timestamps it's talking about. Comments from Reviewable |
Review status: 8 of 10 files reviewed at latest revision, 9 unresolved discussions, some commit checks failed. sql/executor.go, line 421 [r3] (raw file):
|
LGTM
|
Review status: 3 of 10 files reviewed at latest revision, 9 unresolved discussions, some commit checks pending. sql/executor.go, line 421 [r3] (raw file):
|
Review status: 3 of 10 files reviewed at latest revision, 11 unresolved discussions, some commit checks failed. sql/as_of_test.go, line 56 [r5] (raw file):
Can we support placeholders here? As soon as #7172 is merged sql/as_of_test.go, line 149 [r5] (raw file):
Add a test for It would be nice to support expressions like Comments from Reviewable |
Review status: 3 of 10 files reviewed at latest revision, 11 unresolved discussions, some commit checks failed. sql/as_of_test.go, line 56 [r5] (raw file):
|
Review status: 3 of 10 files reviewed at latest revision, 10 unresolved discussions, all commit checks successful. sql/as_of_test.go, line 56 [r5] (raw file):
|
Reviewed 1 of 2 files at r3, 4 of 6 files at r4, 2 of 2 files at r5. sql/as_of_test.go, line 149 [r5] (raw file):
|
Review status: all files reviewed at latest revision, 10 unresolved discussions, all commit checks successful. sql/as_of_test.go, line 56 [r5] (raw file):
|
LGTM Review status: 9 of 10 files reviewed at latest revision, 10 unresolved discussions, all commit checks successful. sql/as_of_test.go, line 56 [r5] (raw file):
|
Review status: 8 of 10 files reviewed at latest revision, 10 unresolved discussions, some commit checks pending. sql/as_of_test.go, line 149 [r5] (raw file):
|
This is implemented by adding special logic to the executor. It is unfortunate that we have to teach it so much about how SELECT statements work, but the executor is the thing that can set the proto timestamps during each retry attempt (they cannot only be set once since the auto-retry stuff will bump the timestamps otherwise). In the case of an AS OF query, we only want to fetch the table descriptor at that time, and not a lease, even if the time is current.
Reviewed 1 of 1 files at r6, 3 of 3 files at r7. Comments from Reviewable |
This is implemented by adding special logic to the executor. It is
unfortunate that we have to teach it so much about how SELECT statements
work, but the executor is the thing that can set the proto timestamps
during each retry attempt (they cannot only be set once since the
auto-retry stuff will bump the timestamps otherwise).
In the case of an AS OF query, we only want to fetch the table descriptor
at that time, and not a lease, even if the time is current.
This change is