Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yuzefovich/27bafaaad29ed69cfa51eb8c0f9653ab to your computer and use it in GitHub Desktop.
Save yuzefovich/27bafaaad29ed69cfa51eb8c0f9653ab to your computer and use it in GitHub Desktop.

Add the AOST information into the DistSQL diagram (cockroachdb/cockroach#127583) to make it easier to confirm that the AOST is added implicitly.

CREATE TABLE t (k INT PRIMARY KEY);
INSERT INTO t SELECT generate_series(1, 100);

Test that in miscellaneous scenarios the inconsistent scan is used:

EXPLAIN (DISTSQL) CREATE STATISTICS s FROM t;
EXPLAIN (DISTSQL) CREATE STATISTICS s FROM t AS OF SYSTEM TIME '-1s';
EXPLAIN (DISTSQL) CREATE STATISTICS s FROM t AS OF SYSTEM TIME '+1s';
EXPLAIN (DISTSQL) CREATE STATISTICS s FROM t WITH OPTIONS THROTTLING 0.9 AS OF SYSTEM TIME '-1s';
EXPLAIN (DISTSQL) CREATE STATISTICS s FROM t WITH OPTIONS THROTTLING 0.9;
EXPLAIN (DISTSQL) CREATE STATISTICS s ON k FROM t;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment