-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27034: sql: turn on the optimizer for PREPARE statements r=benesch a=BramGruneir The optimizer, when enabled, was not used for prepare statements. This patch fixes that. It should be noted that PREPARE has a limited subset of statements it can be run with. Postgres only allows SELECT, INSERT, UPDATE, DELETE and VALUES statements to be prepared. See: https://www.postgresql.org/docs/current/static/sql-prepare.html However, we allow a large number of additional statements. As of right now, the optimizer only works on SELECT statements and will fallback for all others, so this change should be safe for the foreseeable future. Closes #26958. Release note (sql change): When the cost based optimizer is enabled, it will also affect prepared queries. 27040: sql: Remove SNAPSHOT isolation r=bdarnell a=bdarnell The SNAPSHOT isolation level is no longer accessible from SQL. Requests for SNAPSHOT will be remapped to SERIALIZABLE (in the same way that the other ANSI levels already are). KV-level support will remain through the next release cycle to support transactions that began during a rolling upgrade. Fixes #26475 Release note (sql change): The SNAPSHOT isolation level has been removed. Transactions that request to use it are now mapped to SERIALIZABLE. The change in `lease_test.go` is the most complicated part here - I tried to adapt the test to a serializable transaction, but it's possible I misunderstood the intent of the test. I left tests that used `BEGIN TRANSACTION SNAPSHOT` in place to ensure this syntax still works, and just changed the tests to reflect the new behavior of `SHOW transaction_isolation`. While making this change I found that the previous change to map all the ANSI isolation levels to SERIALIZABLE was incomplete. There were some paths (such as `SET default_transaction_isolation`) that still used the old mapping of `READ COMMITTED` to `SNAPSHOT`. Also fixes a bug in `SET transaction_isolation='serializable'`, which was previously setting `snapshot` instead. Co-authored-by: Bram Gruneir <bram@cockroachlabs.com> Co-authored-by: Vivek Menezes <vivek@cockroachlabs.com> Co-authored-by: Ben Darnell <ben@cockroachlabs.com>
- Loading branch information
Showing
16 changed files
with
175 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 0 additions & 60 deletions
60
pkg/sql/logictest/testdata/logic_test/snapshot_certain_read
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.