diff --git a/pkg/ccl/backupccl/show_test.go b/pkg/ccl/backupccl/show_test.go index efe4f6f5a53c..3b284bc8627f 100644 --- a/pkg/ccl/backupccl/show_test.go +++ b/pkg/ccl/backupccl/show_test.go @@ -212,7 +212,7 @@ ORDER BY object_type, object_name`, full) expectedCreateTable := `CREATE TABLE tablea ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT tablea_pkey PRIMARY KEY (a ASC), INDEX tablea_b_idx (b ASC), FAMILY "primary" (a, b) )` @@ -247,14 +247,14 @@ ORDER BY object_type, object_name`, full) wantSameDB := `CREATE TABLE fkreftable ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT fkreftable_pkey PRIMARY KEY (a ASC), CONSTRAINT fk_b_ref_fksrc FOREIGN KEY (b) REFERENCES public.fksrc(a), FAMILY "primary" (a, b) )` wantDiffDB := `CREATE TABLE fkreftable ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT fkreftable_pkey PRIMARY KEY (a ASC), CONSTRAINT fk_b_ref_fksrc FOREIGN KEY (b) REFERENCES data.public.fksrc(a), FAMILY "primary" (a, b) )` @@ -280,7 +280,7 @@ ORDER BY object_type, object_name`, full) want := `CREATE TABLE fkreftable ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT fkreftable_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b) )` diff --git a/pkg/ccl/backupccl/testdata/backup-restore/virtual-columns b/pkg/ccl/backupccl/testdata/backup-restore/virtual-columns index dd6de794aeba..819cf7c9196f 100644 --- a/pkg/ccl/backupccl/testdata/backup-restore/virtual-columns +++ b/pkg/ccl/backupccl/testdata/backup-restore/virtual-columns @@ -44,7 +44,7 @@ d.public.tab CREATE TABLE public.tab ( a INT8 NULL, b INT8 NULL, v INT8 NULL AS (a + b) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT tab_pkey PRIMARY KEY (k ASC), INDEX tab_v_idx (v ASC), UNIQUE INDEX tab_a_b_key (a ASC, b ASC) WHERE v > 0:::INT8, FAMILY "primary" (k, a, b) diff --git a/pkg/ccl/importccl/exportcsv_test.go b/pkg/ccl/importccl/exportcsv_test.go index 5773dda10ba8..1bfdc0773f7f 100644 --- a/pkg/ccl/importccl/exportcsv_test.go +++ b/pkg/ccl/importccl/exportcsv_test.go @@ -113,7 +113,8 @@ func TestExportImportBank(t *testing.T) { fmt.Sprintf(`SELECT * FROM bank AS OF SYSTEM TIME %s ORDER BY id`, asOf), db.QueryStr(t, `SELECT * FROM bank2 ORDER BY id`), ) db.CheckQueryResults(t, - `SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE bank2`, db.QueryStr(t, `SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE bank`), + `SELECT fingerprint FROM [SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE bank2]`, + db.QueryStr(t, `SELECT fingerprint FROM [SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE bank]`), ) db.Exec(t, "DROP TABLE bank2") }) diff --git a/pkg/ccl/importccl/import_stmt_test.go b/pkg/ccl/importccl/import_stmt_test.go index 2e2c613589f3..01f3d220ca6e 100644 --- a/pkg/ccl/importccl/import_stmt_test.go +++ b/pkg/ccl/importccl/import_stmt_test.go @@ -993,7 +993,7 @@ END; `CREATE TABLE public.t ( a INT8 NOT NULL, b INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b) )`, }, @@ -1016,7 +1016,7 @@ END; a INT8 NOT NULL, b INT8 NOT VISIBLE NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b, c) )`, }, @@ -1037,7 +1037,7 @@ END; `CREATE TABLE public.t ( a INT8 NOT NULL, b INT8 NULL DEFAULT 8:::INT8, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b) )`, }, @@ -1463,7 +1463,7 @@ const ( prcp FLOAT4 NULL, date DATE NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT weather_pkey PRIMARY KEY (rowid ASC), CONSTRAINT weather_city_fkey FOREIGN KEY (city) REFERENCES public.cities(city) NOT VALID, FAMILY "primary" (city, temp_lo, temp_hi, prcp, date, rowid) )` @@ -5614,7 +5614,7 @@ func TestImportPgDump(t *testing.T) { a INT8 NULL DEFAULT nextval('public.a_seq'::REGCLASS), b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT seqtable_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, rowid) )`, }}) diff --git a/pkg/ccl/logictestccl/testdata/logic_test/alter_table_locality b/pkg/ccl/logictestccl/testdata/logic_test/alter_table_locality index e3b373e312c5..0620b94e8597 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/alter_table_locality +++ b/pkg/ccl/logictestccl/testdata/logic_test/alter_table_locality @@ -34,7 +34,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -45,22 +45,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -91,7 +91,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -102,22 +102,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -145,7 +145,7 @@ SHOW CREATE TABLE regional_by_table_in_primary_region regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -155,22 +155,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region @@ -198,7 +198,7 @@ SHOW CREATE TABLE regional_by_table_no_region regional_by_table_no_region CREATE TABLE public.regional_by_table_no_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -208,22 +208,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -251,7 +251,7 @@ SHOW CREATE TABLE regional_by_table_in_us_east regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_east ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN "us-east-1" @@ -261,22 +261,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -300,7 +300,7 @@ SHOW CREATE TABLE created_as_global created_as_global CREATE TABLE public.created_as_global ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY GLOBAL @@ -310,22 +310,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -351,7 +351,7 @@ SHOW CREATE TABLE created_as_global created_as_global CREATE TABLE public.created_as_global ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -361,22 +361,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -404,7 +404,7 @@ SHOW CREATE TABLE created_as_global created_as_global CREATE TABLE public.created_as_global ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN "ap-southeast-2" @@ -414,22 +414,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -457,7 +457,7 @@ SHOW CREATE TABLE created_as_global created_as_global CREATE TABLE public.created_as_global ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -467,22 +467,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -510,7 +510,7 @@ SHOW CREATE TABLE created_as_global created_as_global CREATE TABLE public.created_as_global ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY GLOBAL @@ -534,22 +534,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -592,7 +592,7 @@ created_as_global CREATE TABLE public.created_as_global ( i INT8 NULL, b INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), INDEX created_as_global_b_idx (b ASC), UNIQUE INDEX created_as_global_i_key (i ASC), FAMILY fam_0_pk_i_b (pk, i, b, crdb_region) @@ -604,22 +604,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -691,7 +691,7 @@ created_as_global CREATE TABLE public.created_as_global ( i INT8 NULL, b INT8 NULL, crdb_region public.crdb_internal_region NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), INDEX created_as_global_b_idx (b ASC), UNIQUE INDEX created_as_global_i_key (i ASC), FAMILY fam_0_pk_i_b_crdb_region (pk, i, b, crdb_region) @@ -703,22 +703,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -741,7 +741,7 @@ created_as_global CREATE TABLE public.created_as_global ( i INT8 NULL, b INT8 NULL, crdb_region public.crdb_internal_region NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), INDEX created_as_global_b_idx (b ASC), UNIQUE INDEX created_as_global_i_key (i ASC), FAMILY fam_0_pk_i_b_crdb_region (pk, i, b, crdb_region) @@ -790,7 +790,7 @@ created_as_global CREATE TABLE public.created_as_global ( i INT8 NULL, b INT8 NULL, cr public.crdb_internal_region NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT created_as_global_pkey PRIMARY KEY (pk ASC), INDEX created_as_global_b_idx (b ASC), UNIQUE INDEX created_as_global_i_key (i ASC), FAMILY fam_0_pk_i_b_cr (pk, i, b, cr) @@ -802,22 +802,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE created_as_global @@ -846,7 +846,7 @@ SHOW CREATE TABLE regional_by_table_in_primary_region regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN "ap-southeast-2" @@ -856,22 +856,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region @@ -896,7 +896,7 @@ SHOW CREATE TABLE regional_by_table_in_primary_region regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -906,22 +906,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region @@ -946,7 +946,7 @@ SHOW CREATE TABLE regional_by_table_in_primary_region regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -956,22 +956,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region @@ -995,7 +995,7 @@ SHOW CREATE TABLE regional_by_table_in_primary_region regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1005,22 +1005,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region @@ -1044,7 +1044,7 @@ SHOW CREATE TABLE regional_by_table_in_primary_region regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY GLOBAL @@ -1054,22 +1054,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region @@ -1108,7 +1108,7 @@ SHOW CREATE TABLE regional_by_table_no_region regional_by_table_no_region CREATE TABLE public.regional_by_table_no_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1118,22 +1118,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -1168,7 +1168,7 @@ SHOW CREATE TABLE regional_by_table_no_region regional_by_table_no_region CREATE TABLE public.regional_by_table_no_region ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN "ap-southeast-2" @@ -1178,22 +1178,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -1224,7 +1224,7 @@ SHOW CREATE TABLE regional_by_table_no_region regional_by_table_no_region CREATE TABLE public.regional_by_table_no_region ( i INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1234,22 +1234,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -1273,7 +1273,7 @@ SHOW CREATE TABLE regional_by_table_no_region regional_by_table_no_region CREATE TABLE public.regional_by_table_no_region ( i INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) LOCALITY GLOBAL @@ -1283,22 +1283,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -1339,7 +1339,7 @@ regional_by_table_no_region CREATE TABLE public.regional_by_table_no_region ( i INT8 NULL, b INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (pk ASC), INDEX regional_by_table_no_region_b_idx (b ASC), UNIQUE INDEX regional_by_table_no_region_i_key (i ASC), FAMILY fam_0_pk_i_b (pk, i, b, crdb_region) @@ -1364,22 +1364,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -1420,7 +1420,7 @@ regional_by_table_no_region CREATE TABLE public.regional_by_table_no_regio i INT8 NULL, b INT8 NULL, cr public.crdb_internal_region NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_no_region_pkey PRIMARY KEY (pk ASC), INDEX regional_by_table_no_region_b_idx (b ASC), UNIQUE INDEX regional_by_table_no_region_i_key (i ASC), FAMILY fam_0_pk_i_b_cr (pk, i, b, cr) @@ -1432,22 +1432,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_no_region @@ -1473,7 +1473,7 @@ SHOW CREATE TABLE regional_by_table_in_us_east regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_east ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1483,22 +1483,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -1525,7 +1525,7 @@ SHOW CREATE TABLE regional_by_table_in_us_east regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_east ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN "ap-southeast-2" @@ -1535,22 +1535,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -1577,7 +1577,7 @@ SHOW CREATE TABLE regional_by_table_in_us_east regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_east ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1587,22 +1587,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -1626,7 +1626,7 @@ SHOW CREATE TABLE regional_by_table_in_us_east regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_east ( pk INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_i (pk, i) ) LOCALITY GLOBAL @@ -1636,22 +1636,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -1690,7 +1690,7 @@ regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_east ( i INT8 NULL, b INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), INDEX regional_by_table_in_us_east_b_idx (b ASC), UNIQUE INDEX regional_by_table_in_us_east_i_key (i ASC), FAMILY fam_0_pk_i_b (pk, i, b, crdb_region) @@ -1702,22 +1702,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -1756,7 +1756,7 @@ regional_by_table_in_us_east CREATE TABLE public.regional_by_table_in_us_ea i INT8 NULL, b INT8 NULL, cr public.crdb_internal_region NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_table_in_us_east_pkey PRIMARY KEY (pk ASC), INDEX regional_by_table_in_us_east_b_idx (b ASC), UNIQUE INDEX regional_by_table_in_us_east_i_key (i ASC), FAMILY fam_0_pk_i_b_cr (pk, i, b, cr) @@ -1768,22 +1768,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_us_east @@ -1811,7 +1811,7 @@ regional_by_row CREATE TABLE public.regional_by_ pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1852,7 +1852,7 @@ regional_by_row CREATE TABLE public.regional_b pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY TABLE IN "ap-southeast-2" @@ -1893,7 +1893,7 @@ regional_by_row CREATE TABLE public.regional_by_ pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1934,7 +1934,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY GLOBAL @@ -1976,7 +1976,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -1987,22 +1987,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -2027,7 +2027,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW AS crdb_region @@ -2038,22 +2038,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -2079,7 +2079,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -2090,22 +2090,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -2139,7 +2139,7 @@ regional_by_row_to_regional_by_row_as CREATE TABLE public.regional_by_row_to_re i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_to_regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_to_regional_by_row_as_i_idx (i ASC), FAMILY fam_0_pk_i_cr_crdb_region (pk, i, cr, crdb_region) ) LOCALITY REGIONAL BY ROW AS cr @@ -2150,22 +2150,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_to_regional_by_row_as @@ -2193,7 +2193,7 @@ regional_by_row_as CREATE TABLE public.regional_by_ pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -2204,22 +2204,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -2253,7 +2253,7 @@ regional_by_row_as CREATE TABLE public.regional_b pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY TABLE IN "ap-southeast-2" @@ -2264,22 +2264,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -2313,7 +2313,7 @@ regional_by_row_as CREATE TABLE public.regional_by_ pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -2324,22 +2324,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -2373,7 +2373,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY GLOBAL @@ -2384,22 +2384,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -2434,7 +2434,7 @@ regional_by_row_as_to_regional_by_row CREATE TABLE public.regional_by_row_as_to i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_to_regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_to_regional_by_row_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -2445,22 +2445,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as_to_regional_by_row @@ -2494,7 +2494,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ap-southeast-2':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -2505,22 +2505,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -2547,22 +2547,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE rbt_table_gc_ttl @@ -2587,22 +2587,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE rbt_table_gc_ttl diff --git a/pkg/ccl/logictestccl/testdata/logic_test/auto_rehoming_mixed b/pkg/ccl/logictestccl/testdata/logic_test/auto_rehoming_mixed index c371c1cba719..f1dcca3f46b9 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/auto_rehoming_mixed +++ b/pkg/ccl/logictestccl/testdata/logic_test/auto_rehoming_mixed @@ -23,7 +23,7 @@ db.public.rbr CREATE TABLE public.rbr ( p INT8 NOT NULL, s STRING NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (p ASC), + CONSTRAINT rbr_pkey PRIMARY KEY (p ASC), FAMILY "primary" (p, s, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -40,6 +40,6 @@ SHOW CREATE TABLE db.rbr_altered db.public.rbr_altered CREATE TABLE public.rbr_altered ( p INT8 NOT NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (p ASC), + CONSTRAINT rbr_altered_pkey PRIMARY KEY (p ASC), FAMILY "primary" (p, crdb_region) ) LOCALITY REGIONAL BY ROW diff --git a/pkg/ccl/logictestccl/testdata/logic_test/case_sensitive_names b/pkg/ccl/logictestccl/testdata/logic_test/case_sensitive_names index 1ffb4c40201e..3447ad9b9ba7 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/case_sensitive_names +++ b/pkg/ccl/logictestccl/testdata/logic_test/case_sensitive_names @@ -12,7 +12,7 @@ SHOW CREATE TABLE p ---- p CREATE TABLE public.p ( a INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT p_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a) ) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN ((1)), diff --git a/pkg/ccl/logictestccl/testdata/logic_test/distsql_partitioning b/pkg/ccl/logictestccl/testdata/logic_test/distsql_partitioning index 6a0bc5529e01..1e28c7d52cc1 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/distsql_partitioning +++ b/pkg/ccl/logictestccl/testdata/logic_test/distsql_partitioning @@ -16,19 +16,19 @@ query TTTTTTTTT colnames SHOW PARTITIONS FROM DATABASE test ---- database_name table_name partition_name parent_partition column_names index_name partition_value zone_config full_zone_config -test t1 p1 NULL x t1@primary (1) NULL range_min_bytes = 134217728, +test t1 p1 NULL x t1@t1_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[]', lease_preferences = '[]' -test t1 p2 NULL x t1@primary (2) NULL range_min_bytes = 134217728, +test t1 p2 NULL x t1@t1_pkey (2) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[]', lease_preferences = '[]' -test t1 p3 NULL x t1@primary (3) NULL range_min_bytes = 134217728, +test t1 p3 NULL x t1@t1_pkey (3) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -44,19 +44,19 @@ query TTTTTTTTT colnames SHOW PARTITIONS FROM DATABASE test ---- database_name table_name partition_name parent_partition column_names index_name partition_value zone_config full_zone_config -test t1 p1 NULL x t1@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t1 p1 NULL x t1@t1_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t1 p2 NULL x t1@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t1 p2 NULL x t1@t1_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc2]', lease_preferences = '[]' -test t1 p3 NULL x t1@primary (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, +test t1 p3 NULL x t1@t1_pkey (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -66,19 +66,19 @@ lease_preferences = '[]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE t1 ---- -test t1 p1 NULL x t1@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t1 p1 NULL x t1@t1_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t1 p2 NULL x t1@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t1 p2 NULL x t1@t1_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc2]', lease_preferences = '[]' -test t1 p3 NULL x t1@primary (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, +test t1 p3 NULL x t1@t1_pkey (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -86,21 +86,21 @@ constraints = '[+dc=dc3]', lease_preferences = '[]' query TTTTTTTTT -SHOW PARTITIONS FROM INDEX t1@primary +SHOW PARTITIONS FROM INDEX t1@t1_pkey ---- -test t1 p1 NULL x t1@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t1 p1 NULL x t1@t1_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t1 p2 NULL x t1@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t1 p2 NULL x t1@t1_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc2]', lease_preferences = '[]' -test t1 p3 NULL x t1@primary (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, +test t1 p3 NULL x t1@t1_pkey (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -123,31 +123,31 @@ ALTER PARTITION p2 OF TABLE t2 CONFIGURE ZONE USING constraints='[+dc=dc2]' query TTTTTTTTT SHOW PARTITIONS FROM DATABASE test ---- -test t1 p1 NULL x t1@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t1 p1 NULL x t1@t1_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t1 p2 NULL x t1@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t1 p2 NULL x t1@t1_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc2]', lease_preferences = '[]' -test t1 p3 NULL x t1@primary (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, +test t1 p3 NULL x t1@t1_pkey (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc3]', lease_preferences = '[]' -test t2 p1 NULL x t2@primary (1) TO (2) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t2 p1 NULL x t2@t2_pkey (1) TO (2) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t2 p2 NULL x t2@primary (2) TO (3) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t2 p2 NULL x t2@t2_pkey (2) TO (3) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -157,13 +157,13 @@ lease_preferences = '[]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE t2 ---- -test t2 p1 NULL x t2@primary (1) TO (2) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t2 p1 NULL x t2@t2_pkey (1) TO (2) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t2 p2 NULL x t2@primary (2) TO (3) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t2 p2 NULL x t2@t2_pkey (2) TO (3) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -171,15 +171,15 @@ constraints = '[+dc=dc2]', lease_preferences = '[]' query TTTTTTTTT -SHOW PARTITIONS FROM INDEX t2@primary +SHOW PARTITIONS FROM INDEX t2@t2_pkey ---- -test t2 p1 NULL x t2@primary (1) TO (2) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t2 p1 NULL x t2@t2_pkey (1) TO (2) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t2 p2 NULL x t2@primary (2) TO (3) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t2 p2 NULL x t2@t2_pkey (2) TO (3) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -210,13 +210,13 @@ ALTER PARTITION p4 OF INDEX t3@sec CONFIGURE ZONE USING constraints='[+dc=dc4]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE t3 ---- -test t3 p1 NULL x t3@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t3 p1 NULL x t3@t3_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t3 p2 NULL x t3@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t3 p2 NULL x t3@t3_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -238,13 +238,13 @@ lease_preferences = '[]' query TTTTTTTTT SHOW PARTITIONS FROM INDEX t3@* ---- -test t3 p1 NULL x t3@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t3 p1 NULL x t3@t3_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t3 p2 NULL x t3@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t3 p2 NULL x t3@t3_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -303,31 +303,31 @@ ALTER PARTITION p2_a OF TABLE t4 CONFIGURE ZONE USING constraints='[+dc=dc5]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE t4 ---- -test t4 p1 NULL x t4@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, +test t4 p1 NULL x t4@t4_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc1]', lease_preferences = '[]' -test t4 p1_a p1 y t4@primary (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, +test t4 p1_a p1 y t4@t4_pkey (2) constraints = '[+dc=dc2]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc2]', lease_preferences = '[]' -test t4 p1_b p1 y t4@primary (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, +test t4 p1_b p1 y t4@t4_pkey (3) constraints = '[+dc=dc3]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc3]', lease_preferences = '[]' -test t4 p2 NULL x t4@primary (4) constraints = '[+dc=dc4]' range_min_bytes = 134217728, +test t4 p2 NULL x t4@t4_pkey (4) constraints = '[+dc=dc4]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, constraints = '[+dc=dc4]', lease_preferences = '[]' -test t4 p2_a p2 y t4@primary (5) constraints = '[+dc=dc5]' range_min_bytes = 134217728, +test t4 p2_a p2 y t4@t4_pkey (5) constraints = '[+dc=dc5]' range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -342,7 +342,7 @@ statement ok CREATE TABLE partitioning.inheritance (x INT PRIMARY KEY) statement ok -ALTER INDEX partitioning.inheritance@primary PARTITION BY LIST (x) ( PARTITION p1 VALUES IN (1)) +ALTER INDEX partitioning.inheritance@inheritance_pkey PARTITION BY LIST (x) ( PARTITION p1 VALUES IN (1)) statement ok ALTER DATABASE partitioning CONFIGURE ZONE USING range_min_bytes=64000, range_max_bytes=75000 @@ -350,7 +350,7 @@ ALTER DATABASE partitioning CONFIGURE ZONE USING range_min_bytes=64000, range_ma query TTTTTTTTT SHOW PARTITIONS FROM TABLE partitioning.inheritance ---- -partitioning inheritance p1 NULL x inheritance@primary (1) NULL range_min_bytes = 64000, +partitioning inheritance p1 NULL x inheritance@inheritance_pkey (1) NULL range_min_bytes = 64000, range_max_bytes = 75000, gc.ttlseconds = 90000, num_replicas = 3, @@ -363,7 +363,7 @@ ALTER TABLE partitioning.inheritance CONFIGURE ZONE USING gc.ttlseconds=80000 query TTTTTTTTT SHOW PARTITIONS FROM TABLE partitioning.inheritance ---- -partitioning inheritance p1 NULL x inheritance@primary (1) NULL range_min_bytes = 64000, +partitioning inheritance p1 NULL x inheritance@inheritance_pkey (1) NULL range_min_bytes = 64000, range_max_bytes = 75000, gc.ttlseconds = 80000, num_replicas = 3, @@ -371,12 +371,12 @@ constraints = '[]', lease_preferences = '[]' statement ok -ALTER INDEX partitioning.inheritance@primary CONFIGURE ZONE USING num_replicas=5 +ALTER INDEX partitioning.inheritance@inheritance_pkey CONFIGURE ZONE USING num_replicas=5 query TTTTTTTTT SHOW PARTITIONS FROM TABLE partitioning.inheritance ---- -partitioning inheritance p1 NULL x inheritance@primary (1) NULL range_min_bytes = 64000, +partitioning inheritance p1 NULL x inheritance@inheritance_pkey (1) NULL range_min_bytes = 64000, range_max_bytes = 75000, gc.ttlseconds = 80000, num_replicas = 5, @@ -384,12 +384,12 @@ constraints = '[]', lease_preferences = '[]' statement ok -ALTER PARTITION p1 OF INDEX partitioning.inheritance@primary CONFIGURE ZONE USING constraints='[+dc=dc1]' +ALTER PARTITION p1 OF INDEX partitioning.inheritance@inheritance_pkey CONFIGURE ZONE USING constraints='[+dc=dc1]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE partitioning.inheritance ---- -partitioning inheritance p1 NULL x inheritance@primary (1) constraints = '[+dc=dc1]' range_min_bytes = 64000, +partitioning inheritance p1 NULL x inheritance@inheritance_pkey (1) constraints = '[+dc=dc1]' range_min_bytes = 64000, range_max_bytes = 75000, gc.ttlseconds = 80000, num_replicas = 5, diff --git a/pkg/ccl/logictestccl/testdata/logic_test/multi_region b/pkg/ccl/logictestccl/testdata/logic_test/multi_region index 0c658b3f8483..071a3737d8c1 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/multi_region +++ b/pkg/ccl/logictestccl/testdata/logic_test/multi_region @@ -385,7 +385,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE regional_primary_region_table] CREATE TABLE public.regional_primary_region_table ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT regional_primary_region_table_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -421,7 +421,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE regional_implicit_primary_region CREATE TABLE public.regional_implicit_primary_region_table ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT regional_implicit_primary_region_table_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -447,7 +447,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE "regional_us-east-1_table"] CREATE TABLE public."regional_us-east-1_table" ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT "regional_us-east-1_table_pkey" PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY REGIONAL BY TABLE IN "us-east-1" @@ -476,7 +476,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE global_table] CREATE TABLE public.global_table ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT global_table_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY GLOBAL @@ -1030,7 +1030,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE no_initial_region.t] CREATE TABLE public.t ( k INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (k, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1457,7 +1457,7 @@ CREATE TABLE public.t_as ( i INT8 NULL, crdb_region public.crdb_internal_region NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_as_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, crdb_region, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1485,7 +1485,7 @@ CREATE TABLE public.t_as ( i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_as_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, crdb_region, rowid) ) LOCALITY REGIONAL BY ROW AS crdb_region @@ -1528,7 +1528,7 @@ create_statement CREATE TABLE public.t_as ( i INT8 NOT NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT t_as_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i, crdb_region) ) LOCALITY REGIONAL BY ROW AS crdb_region @@ -1539,7 +1539,7 @@ create_statement CREATE TABLE public.t ( i INT8 NOT NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT t_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i, crdb_region) ) LOCALITY REGIONAL BY ROW diff --git a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_backup b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_backup index ab3ef2653990..2120ded5c53e 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_backup +++ b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_backup @@ -70,10 +70,7 @@ query TTT SELECT partition_name, index_name, zone_config FROM [SHOW PARTITIONS FROM TABLE regional_by_row_table] ORDER BY partition_name, index_name ---- -ap-southeast-2 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' -ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -82,10 +79,10 @@ lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' -ca-central-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' -ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ap-southeast-2]', +lease_preferences = '[[+region=ap-southeast-2]]' +ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -94,10 +91,10 @@ lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' -us-east-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' -us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ca-central-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ca-central-1]', +lease_preferences = '[[+region=ca-central-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -106,6 +103,9 @@ lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=us-east-1]', +lease_preferences = '[[+region=us-east-1]]' query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -130,7 +130,7 @@ regional_by_row_table CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -237,10 +237,7 @@ query TTT SELECT partition_name, index_name, zone_config FROM [SHOW PARTITIONS FROM TABLE regional_by_row_table] ORDER BY partition_name, index_name ---- -ap-southeast-2 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' -ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -249,10 +246,10 @@ lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' -ca-central-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' -ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ap-southeast-2]', +lease_preferences = '[[+region=ap-southeast-2]]' +ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -261,10 +258,10 @@ lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' -us-east-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' -us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ca-central-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ca-central-1]', +lease_preferences = '[[+region=ca-central-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -273,6 +270,9 @@ lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=us-east-1]', +lease_preferences = '[[+region=us-east-1]]' query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -297,7 +297,7 @@ regional_by_row_table CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -449,10 +449,7 @@ query TTT SELECT partition_name, index_name, zone_config FROM [SHOW PARTITIONS FROM TABLE regional_by_row_table] ORDER BY partition_name, index_name ---- -ap-southeast-2 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' -ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -461,10 +458,10 @@ lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' -ca-central-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' -ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ap-southeast-2]', +lease_preferences = '[[+region=ap-southeast-2]]' +ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -473,10 +470,10 @@ lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' -us-east-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' -us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ca-central-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ca-central-1]', +lease_preferences = '[[+region=ca-central-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -485,6 +482,9 @@ lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=us-east-1]', +lease_preferences = '[[+region=us-east-1]]' query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -509,7 +509,7 @@ regional_by_row_table CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -604,10 +604,7 @@ query TTT SELECT partition_name, index_name, zone_config FROM [SHOW PARTITIONS FROM TABLE regional_by_row_table] ORDER BY partition_name, index_name ---- -ap-southeast-2 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' -ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -616,10 +613,10 @@ lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' -ca-central-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' -ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ap-southeast-2]', +lease_preferences = '[[+region=ap-southeast-2]]' +ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -628,10 +625,10 @@ lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' -us-east-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' -us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ca-central-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ca-central-1]', +lease_preferences = '[[+region=ca-central-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -640,6 +637,9 @@ lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=us-east-1]', +lease_preferences = '[[+region=us-east-1]]' query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -664,7 +664,7 @@ regional_by_row_table CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -784,10 +784,7 @@ query TTT SELECT partition_name, index_name, zone_config FROM [SHOW PARTITIONS FROM TABLE regional_by_row_table] ORDER BY partition_name, index_name ---- -ap-southeast-2 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' -ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -796,10 +793,10 @@ lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' -ca-central-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' -ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ap-southeast-2]', +lease_preferences = '[[+region=ap-southeast-2]]' +ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -808,10 +805,10 @@ lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' -us-east-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' -us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ca-central-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ca-central-1]', +lease_preferences = '[[+region=ca-central-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -820,6 +817,9 @@ lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=us-east-1]', +lease_preferences = '[[+region=us-east-1]]' query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -844,7 +844,7 @@ regional_by_row_table CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -913,10 +913,7 @@ query TTT SELECT partition_name, index_name, zone_config FROM [SHOW PARTITIONS FROM TABLE regional_by_row_table] ORDER BY partition_name, index_name ---- -ap-southeast-2 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' -ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -925,10 +922,10 @@ lease_preferences = '[[+region=ap-southeast-2]]' ap-southeast-2 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', lease_preferences = '[[+region=ap-southeast-2]]' -ca-central-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' -ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ap-southeast-2 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ap-southeast-2]', +lease_preferences = '[[+region=ap-southeast-2]]' +ca-central-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -937,10 +934,10 @@ lease_preferences = '[[+region=ca-central-1]]' ca-central-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=ca-central-1]', lease_preferences = '[[+region=ca-central-1]]' -us-east-1 regional_by_row_table@primary num_voters = 3, -voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' -us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, +ca-central-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=ca-central-1]', +lease_preferences = '[[+region=ca-central-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_a_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_b_key num_voters = 3, @@ -949,6 +946,9 @@ lease_preferences = '[[+region=us-east-1]]' us-east-1 regional_by_row_table@regional_by_row_table_j_idx num_voters = 3, voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' +us-east-1 regional_by_row_table@regional_by_row_table_pkey num_voters = 3, +voter_constraints = '[+region=us-east-1]', +lease_preferences = '[[+region=us-east-1]]' query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -973,7 +973,7 @@ regional_by_row_table CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -1094,12 +1094,12 @@ DATABASE "mr-backup-1" ALTER DATABASE "mr-backup-1" CONFIGURE ZONE USING query TT SHOW CREATE TABLE non_mr_table ---- -non_mr_table CREATE TABLE public.non_mr_table ( - i INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - FAMILY "primary" (i, rowid) - ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION +non_mr_table CREATE TABLE public.non_mr_table ( + i INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT non_mr_table_pkey PRIMARY KEY (rowid ASC), + FAMILY "primary" (i, rowid) +) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION statement ok @@ -1120,19 +1120,19 @@ RESTORE TABLE regional_by_row_table FROM 'nodelocal://1/mr-backup-2/' query TT SHOW CREATE TABLE regional_by_row_table ---- -regional_by_row_table CREATE TABLE public.regional_by_row_table ( +regional_by_row_table CREATE TABLE public.regional_by_row_table ( pk INT8 NOT NULL, pk2 INT8 NOT NULL, a INT8 NOT NULL, b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), FAMILY fam_0_pk_pk2_a_b_j_crdb_region (pk, pk2, a, b, j, crdb_region) - ) LOCALITY REGIONAL BY ROW +) LOCALITY REGIONAL BY ROW statement ok RESTORE TABLE regional_by_table_in_primary_region FROM 'nodelocal://1/mr-backup-2/' @@ -1140,12 +1140,12 @@ RESTORE TABLE regional_by_table_in_primary_region FROM 'nodelocal://1/mr-backup- query TT SHOW CREATE TABLE regional_by_table_in_primary_region ---- -regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( - pk INT8 NOT NULL, - i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), - FAMILY fam_0_pk_i (pk, i) - ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION +regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( + pk INT8 NOT NULL, + i INT8 NULL, + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), + FAMILY fam_0_pk_i (pk, i) +) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION statement ok @@ -1156,12 +1156,12 @@ RESTORE TABLE regional_by_table_in_ca_central_1 FROM 'nodelocal://1/mr-backup-2/ query TT SHOW CREATE TABLE regional_by_table_in_ca_central_1 ---- -regional_by_table_in_ca_central_1 CREATE TABLE public.regional_by_table_in_ca_central_1 ( - pk INT8 NOT NULL, - i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), - FAMILY fam_0_pk_i (pk, i) - ) LOCALITY REGIONAL BY TABLE IN "ca-central-1" +regional_by_table_in_ca_central_1 CREATE TABLE public.regional_by_table_in_ca_central_1 ( + pk INT8 NOT NULL, + i INT8 NULL, + CONSTRAINT regional_by_table_in_ca_central_1_pkey PRIMARY KEY (pk ASC), + FAMILY fam_0_pk_i (pk, i) +) LOCALITY REGIONAL BY TABLE IN "ca-central-1" statement ok RESTORE TABLE global_table FROM 'nodelocal://1/mr-backup-2/' @@ -1170,11 +1170,11 @@ query TT SHOW CREATE TABLE global_table ---- global_table CREATE TABLE public.global_table ( - pk INT8 NOT NULL, - i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), - FAMILY fam_0_pk_i (pk, i) - ) LOCALITY GLOBAL + pk INT8 NOT NULL, + i INT8 NULL, + CONSTRAINT global_table_pkey PRIMARY KEY (pk ASC), + FAMILY fam_0_pk_i (pk, i) +) LOCALITY GLOBAL # Restore individual tables into a database with different regions. subtest restore_tables_into_database_with_different_regions @@ -1191,11 +1191,11 @@ query TT SHOW CREATE TABLE global_table ---- global_table CREATE TABLE public.global_table ( - pk INT8 NOT NULL, - i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), - FAMILY fam_0_pk_i (pk, i) - ) LOCALITY GLOBAL + pk INT8 NOT NULL, + i INT8 NULL, + CONSTRAINT global_table_pkey PRIMARY KEY (pk ASC), + FAMILY fam_0_pk_i (pk, i) +) LOCALITY GLOBAL query TT SHOW ZONE CONFIGURATION FROM TABLE global_table @@ -1218,12 +1218,12 @@ RESTORE TABLE "mr-backup-2".regional_by_table_in_primary_region FROM 'nodelocal: query TT SHOW CREATE TABLE regional_by_table_in_primary_region ---- -regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( - pk INT8 NOT NULL, - i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), - FAMILY fam_0_pk_i (pk, i) - ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION +regional_by_table_in_primary_region CREATE TABLE public.regional_by_table_in_primary_region ( + pk INT8 NOT NULL, + i INT8 NULL, + CONSTRAINT regional_by_table_in_primary_region_pkey PRIMARY KEY (pk ASC), + FAMILY fam_0_pk_i (pk, i) +) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_table_in_primary_region diff --git a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_import_export b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_import_export index 677fddfd1e29..13c0cb561d2c 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_import_export +++ b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_import_export @@ -98,6 +98,6 @@ team CREATE TABLE public.team ( name STRING NULL, likes STRING[] NULL, dislikes STRING[] NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT team_pkey PRIMARY KEY (id ASC), FAMILY "primary" (id, name, likes, dislikes) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION diff --git a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_query_behavior b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_query_behavior index 71b05027b642..8308523678b4 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_query_behavior +++ b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_query_behavior @@ -283,7 +283,7 @@ vectorized: true • render │ └── • lookup join - │ table: promos@primary + │ table: promos@promos_pkey │ equality: (promo_id) = (promo_id) │ equality cols are key │ @@ -292,12 +292,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: orders@primary + │ table: orders@orders_pkey │ spans: [/'ca-central-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'ca-central-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] │ └── • scan missing stats - table: orders@primary + table: orders@orders_pkey spans: [/'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] [/'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykUttO20AQfe9XjOaFizZKfIEES0hGbUqD0oQmVK3UtZDxjmHbZNfdXauuUJ76bf2vyjYUghoE9MHWzuXMnHM012i_LzDC4efT8dFoAttvRvOz-YfxDsyH4-HrM9BGkDmXgkFh9FLfvGRGcDRvH-c_pLvSpTtvGm6ruyCkzXSp3Hpj2wVvZ9P37WwLJ9PRpJ1u4eN8NDmG7dtdO_Dp3XA2_MsCDmHrIKTwYhD2O4Pczzthmu11BkHudfZDT-xTIPK-399ChkoLmqRLshh9wRAThoXRGVmrTZ26bhpGosKox1CqonR1OmGYaUMYXaOTbkEY4Vl6saAZpYJMt4cMBblULpqxrYK4MHKZmp_IcF6kykbQ5Rhz7HLkvDoIOa-o_l0MjjmvBnn35PcvzqvcE5xXnlCHddDf4tjtQaoEeKDdFRlkOC1dBLHHYp_FASYrhrp0d0ytSy8JI2_FXqbGe7KamnfvRYqerMLfqOKOvCUj0wWUqqFKYo1_svqH3Inu6KLrrwsdy6V04G2k0nuOoSdaqhs_g_U17U3f83Os9beygK9aKtAqgrgGzEgJMo1BEAcMYr_-duO9jfSC59CbkS20svTAqk3CE4YkLqm13erSZHRqdNasacNpg2sSgqxrq34bjFRTag7yPtj7H7D_KDhYA_cegoNHweEDcLJ69ScAAP__fLWm2w== @@ -316,7 +316,7 @@ vectorized: true • render │ └── • lookup join - │ table: promos@primary + │ table: promos@promos_pkey │ equality: (promo_id) = (promo_id) │ equality cols are key │ pred: info @> info @@ -329,12 +329,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: orders@primary + │ table: orders@orders_pkey │ spans: [/'ca-central-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'ca-central-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] │ └── • scan missing stats - table: orders@primary + table: orders@orders_pkey spans: [/'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] [/'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykk99uGjsQxu_PU1hzk9PIhP0XICtFctTSlohCCpFaqUZos55N3IK9tb3tVhFXfba-V7W7JCmooCS9ANvj-Zjf5xluwX5dQAz9jxfDs8GI_P9qML2cvh--INP-sP_ykmgj0MyloCQ3eqntUb2sAzJFcjZtNvPv0t3ows3rhLvbQyKkTXWh3GZik0VeT8bvmhKWnI8Ho3URMr7bHUmVacJ44XkhrjOb2Ie3_Un_Ho-ckoOTCKOrXtRt9bIga0VJetzqhZnf6kS-6GAosm7QPQAKSgscJUu0EH-CCGYUcqNTtFabKnRbJwxECbFHQaq8cFV4RiHVBiG-BSfdAiGGy-RqgRNMBJq2BxQEukQu6p9tSFlu5DIxP4DCNE-UjUmbA-PQ5sB5eRJxXmL1ddV7w3nZy9rnv35yXma-4Lz0hTqtDt0DDm2PJEoQn2h3gwYojAsXE-ZTFlAWwWxFQRfugdS65Boh9lf0eW78R7upuL1nOXq0i2Cniwd4i0YmC1KoGhXFBv9s9Re7I93SeTvYNDqUS-mIvxPFe8qDDtQ3NA7FuZYKTTvcLNXMN2uWeTXScylKoPeyfpkbwjr3w8_CrRcL9z1a-BTSinDd-WgH5V3nh1p_KXLyWUtFtIoJqwTjEWHdTdAJKoGmZiXsmBIWVJ9D1tlJHD2FeII218riVp93dW1GAcU1NjNjdWFSvDA6rcs0x3GtqwMCrWtug-YwUPVV_W_6U-z_izjYKw43xN62ONwrjvaLo73i4y3xbPXf7wAAAP__Xc4AbA== diff --git a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_zone_configs b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_zone_configs index f50568f09051..5eb0f90dca3e 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/multi_region_zone_configs +++ b/pkg/ccl/logictestccl/testdata/logic_test/multi_region_zone_configs @@ -448,11 +448,11 @@ TABLE regional_by_row ALTER TABLE regional_by_row CONFIGURE ZONE USING lease_preferences = '[[+region=us-east-1]]' statement error attempting to modify protected field "num_replicas" of a multi-region zone configuration -ALTER partition "us-east-1" of index regional_by_row@primary CONFIGURE ZONE USING num_replicas = 10 +ALTER partition "us-east-1" of index regional_by_row@regional_by_row_pkey CONFIGURE ZONE USING num_replicas = 10 statement ok SET override_multi_region_zone_config = true; -ALTER partition "us-east-1" of index regional_by_row@primary CONFIGURE ZONE USING num_replicas = 10; +ALTER partition "us-east-1" of index regional_by_row@regional_by_row_pkey CONFIGURE ZONE USING num_replicas = 10; SET override_multi_region_zone_config = false query TTT @@ -461,23 +461,23 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 -num_replicas = 10, +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +num_replicas = 10, num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 statement error attempting to update zone configuration for table regional_by_row which contains modified field "num_replicas" ALTER TABLE regional_by_row SET LOCALITY REGIONAL BY TABLE @@ -488,7 +488,7 @@ ALTER TABLE regional_by_row SET LOCALITY REGIONAL BY TABLE; SET override_multi_region_zone_config = false statement error attempting to modify protected field "num_replicas" of a multi-region zone configuration -ALTER index regional_by_row@primary CONFIGURE ZONE USING num_replicas = 10 +ALTER index regional_by_row@regional_by_row_pkey CONFIGURE ZONE USING num_replicas = 10 query TTT SELECT ZONE_config, index_name, partition_name FROM [SHOW PARTITIONS FROM TABLE regional_by_row] @@ -496,7 +496,7 @@ ORDER BY partition_name, index_name ---- query TT -SHOW ZONE CONFIGURATION FOR INDEX regional_by_row@primary +SHOW ZONE CONFIGURATION FOR INDEX regional_by_row@regional_by_row_pkey ---- TABLE regional_by_row ALTER TABLE regional_by_row CONFIGURE ZONE USING range_min_bytes = 1000, @@ -624,16 +624,16 @@ SELECT crdb_internal.validate_multi_region_zone_configs() statement ok SET override_multi_region_zone_config = true; -ALTER index regional_by_row@primary CONFIGURE ZONE USING num_replicas = 10; +ALTER index regional_by_row@regional_by_row_pkey CONFIGURE ZONE USING num_replicas = 10; SET override_multi_region_zone_config = false -statement error attempting to update zone config which contains an extra zone configuration for index regional_by_row@"primary" with field num_replicas populated +statement error attempting to update zone config which contains an extra zone configuration for index regional_by_row@regional_by_row_pkey with field num_replicas populated ALTER TABLE regional_by_row SET LOCALITY GLOBAL -statement error extraneous zone configuration for index regional_by_row@"primary" with field num_replicas populated +statement error extraneous zone configuration for index regional_by_row@regional_by_row_pkey with field num_replicas populated SELECT crdb_internal.validate_multi_region_zone_configs() -statement error attempting to update zone config which contains an extra zone configuration for index regional_by_row@"primary" with field num_replicas populated +statement error attempting to update zone config which contains an extra zone configuration for index regional_by_row@regional_by_row_pkey with field num_replicas populated ALTER TABLE regional_by_row SET LOCALITY REGIONAL BY ROW statement ok @@ -652,13 +652,13 @@ CREATE TABLE regional_by_row_as ( statement ok SET override_multi_region_zone_config = true; -ALTER index regional_by_row_as@primary CONFIGURE ZONE USING num_replicas = 10; +ALTER index regional_by_row_as@regional_by_row_as_pkey CONFIGURE ZONE USING num_replicas = 10; SET override_multi_region_zone_config = false query TT -SHOW ZONE CONFIGURATION FOR INDEX regional_by_row_as@primary +SHOW ZONE CONFIGURATION FOR INDEX regional_by_row_as@regional_by_row_as_pkey ---- -INDEX regional_by_row_as@primary ALTER INDEX regional_by_row_as@primary CONFIGURE ZONE USING +INDEX regional_by_row_as@regional_by_row_as_pkey ALTER INDEX regional_by_row_as@regional_by_row_as_pkey CONFIGURE ZONE USING range_min_bytes = 1000, range_max_bytes = 100000, gc.ttlseconds = 100000, @@ -668,7 +668,7 @@ INDEX regional_by_row_as@primary ALTER INDEX regional_by_row_as@primary CONFIGU voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' -statement error attempting to update zone config which contains an extra zone configuration for index regional_by_row_as@"primary" with field num_replicas populated +statement error attempting to update zone config which contains an extra zone configuration for index regional_by_row_as@regional_by_row_as_pkey with field num_replicas populated ALTER TABLE regional_by_row_as SET LOCALITY REGIONAL BY ROW statement ok @@ -677,7 +677,7 @@ ALTER TABLE regional_by_row_as SET LOCALITY REGIONAL BY ROW; SET override_multi_region_zone_config = false query TT -SHOW ZONE CONFIGURATION FOR INDEX regional_by_row_as@primary +SHOW ZONE CONFIGURATION FOR INDEX regional_by_row_as@regional_by_row_as_pkey ---- DATABASE "mr-zone-configs" ALTER DATABASE "mr-zone-configs" CONFIGURE ZONE USING range_min_bytes = 1000, @@ -697,7 +697,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -708,22 +708,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FOR DATABASE "mr-zone-configs" @@ -758,14 +758,14 @@ RANGE default ALTER RANGE default CONFIGURE ZONE USING lease_preferences = '[]' statement ok -ALTER INDEX regional_by_row@primary CONFIGURE ZONE DISCARD +ALTER INDEX regional_by_row@regional_by_row_pkey CONFIGURE ZONE DISCARD statement error attempting to discard the zone configuration of a multi-region entity -ALTER PARTITION "ca-central-1" OF INDEX regional_by_row@primary CONFIGURE ZONE DISCARD +ALTER PARTITION "ca-central-1" OF INDEX regional_by_row@regional_by_row_pkey CONFIGURE ZONE DISCARD statement ok SET override_multi_region_zone_config = true; -ALTER PARTITION "ca-central-1" OF INDEX regional_by_row@primary CONFIGURE ZONE DISCARD; +ALTER PARTITION "ca-central-1" OF INDEX regional_by_row@regional_by_row_pkey CONFIGURE ZONE DISCARD; SET override_multi_region_zone_config = false # Drop invalid zone config database so validation passes. @@ -1463,9 +1463,9 @@ CREATE TABLE tbl8 ( ) LOCALITY REGIONAL BY ROW query TT -SHOW ZONE CONFIGURATION FOR PARTITION "us-east-1" of INDEX tbl8@primary +SHOW ZONE CONFIGURATION FOR PARTITION "us-east-1" of INDEX tbl8@tbl8_pkey ---- -PARTITION "us-east-1" OF INDEX tbl8@primary ALTER PARTITION "us-east-1" OF INDEX tbl8@primary CONFIGURE ZONE USING +PARTITION "us-east-1" OF INDEX tbl8@tbl8_pkey ALTER PARTITION "us-east-1" OF INDEX tbl8@tbl8_pkey CONFIGURE ZONE USING range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, @@ -1477,11 +1477,11 @@ PARTITION "us-east-1" OF INDEX tbl8@primary ALTER PARTITION "us-east-1" OF INDE statement ok SET override_multi_region_zone_config = true; -ALTER PARTITION "us-east-1" OF INDEX tbl8@primary CONFIGURE ZONE DISCARD; +ALTER PARTITION "us-east-1" OF INDEX tbl8@tbl8_pkey CONFIGURE ZONE DISCARD; SET override_multi_region_zone_config = false query TT -SHOW ZONE CONFIGURATION FOR PARTITION "us-east-1" of INDEX tbl8@primary +SHOW ZONE CONFIGURATION FOR PARTITION "us-east-1" of INDEX tbl8@tbl8_pkey ---- DATABASE initial_multiregion_db ALTER DATABASE initial_multiregion_db CONFIGURE ZONE USING range_min_bytes = 134217728, @@ -1493,7 +1493,7 @@ DATABASE initial_multiregion_db ALTER DATABASE initial_multiregion_db CONFIGURE voter_constraints = '[+region=us-east-1]', lease_preferences = '[[+region=us-east-1]]' -statement error missing zone configuration for partition "us-east-1" of tbl8@"primary" +statement error missing zone configuration for partition "us-east-1" of tbl8@tbl8_pkey SELECT crdb_internal.validate_multi_region_zone_configs() let $tbl8_id @@ -1503,9 +1503,9 @@ statement ok SELECT crdb_internal.reset_multi_region_zone_configs_for_table($tbl8_id) query TT -SHOW ZONE CONFIGURATION FOR PARTITION "us-east-1" of INDEX tbl8@primary +SHOW ZONE CONFIGURATION FOR PARTITION "us-east-1" of INDEX tbl8@tbl8_pkey ---- -PARTITION "us-east-1" OF INDEX tbl8@primary ALTER PARTITION "us-east-1" OF INDEX tbl8@primary CONFIGURE ZONE USING +PARTITION "us-east-1" OF INDEX tbl8@tbl8_pkey ALTER PARTITION "us-east-1" OF INDEX tbl8@tbl8_pkey CONFIGURE ZONE USING range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, diff --git a/pkg/ccl/logictestccl/testdata/logic_test/partitioning b/pkg/ccl/logictestccl/testdata/logic_test/partitioning index 4d3677eeee1d..712833d75923 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/partitioning +++ b/pkg/ccl/logictestccl/testdata/logic_test/partitioning @@ -53,32 +53,32 @@ CREATE TABLE t (a INT DEFAULT 12, b INT DEFAULT 34) PARTITION BY LIST (a, b) ( PARTITION default VALUES IN (DEFAULT) ) -statement error PARTITION p1: name must be unique \(used twice in index "primary"\) +statement error PARTITION p1: name must be unique \(used twice in index "t_pkey"\) CREATE TABLE t (a INT, b INT, c INT, PRIMARY KEY (a, b)) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN (1), PARTITION p1 VALUES IN (2) ) -statement error PARTITION p1: name must be unique \(used twice in index "primary"\) +statement error PARTITION p1: name must be unique \(used twice in index "t_pkey"\) CREATE TABLE t (a INT, b INT, c INT, PRIMARY KEY (a, b)) PARTITION BY RANGE (a) ( PARTITION p1 VALUES FROM (1) TO (2), PARTITION p1 VALUES FROM (2) TO (3) ) -statement error PARTITION p1: name must be unique \(used twice in index "primary"\) +statement error PARTITION p1: name must be unique \(used twice in index "t_pkey"\) CREATE TABLE t (a INT, b INT, c INT, PRIMARY KEY (a, b)) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN (1), PARTITION P1 VALUES IN (2) ) -statement error PARTITION p1: name must be unique \(used twice in index "primary"\) +statement error PARTITION p1: name must be unique \(used twice in index "t_pkey"\) CREATE TABLE t (a INT, b INT, c INT, PRIMARY KEY (a, b)) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN (1) PARTITION BY LIST (b) ( PARTITION p1 VALUES IN (2) ) ) -statement error PARTITION p1: name must be unique \(used twice in index "primary"\) +statement error PARTITION p1: name must be unique \(used twice in index "t_pkey"\) CREATE TABLE t (a INT, b INT, c INT, PRIMARY KEY (a, b)) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN (1) PARTITION BY RANGE (b) ( PARTITION p1 VALUES FROM (1) TO (2) @@ -409,7 +409,7 @@ ok1 CREATE TABLE public.ok1 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok1_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN ((1)), @@ -431,7 +431,7 @@ TABLE ok1 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok1_pkey ├── a int not null ├── b int not null └── partitions @@ -462,7 +462,7 @@ ok2 CREATE TABLE public.ok2 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok2_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN ((1)), @@ -479,7 +479,7 @@ TABLE ok2 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok2_pkey ├── a int not null ├── b int not null └── partitions @@ -510,7 +510,7 @@ ok3 CREATE TABLE public.ok3 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok3_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN ((1)), @@ -527,7 +527,7 @@ TABLE ok3 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok3_pkey ├── a int not null ├── b int not null └── partitions @@ -560,7 +560,7 @@ ok4 CREATE TABLE public.ok4 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok4_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a, b) ( PARTITION p1 VALUES IN ((1, 1)), @@ -579,7 +579,7 @@ TABLE ok4 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok4_pkey ├── a int not null ├── b int not null └── partitions @@ -628,7 +628,7 @@ TABLE ok5 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok5_pkey ├── a int not null ├── b int not null └── partitions @@ -650,7 +650,7 @@ ok5 CREATE TABLE public.ok5 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok5_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN ((1)) PARTITION BY LIST (b) ( @@ -683,7 +683,7 @@ ok6 CREATE TABLE public.ok6 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok6_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY RANGE (a) ( PARTITION p1 VALUES FROM (0) TO (1), @@ -700,7 +700,7 @@ TABLE ok6 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok6_pkey ├── a int not null └── b int not null scan ok6 @@ -721,7 +721,7 @@ ok7 CREATE TABLE public.ok7 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok7_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY RANGE (a) ( PARTITION p1 VALUES FROM (0) TO (1) @@ -737,7 +737,7 @@ TABLE ok7 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok7_pkey ├── a int not null └── b int not null scan ok7 @@ -762,7 +762,7 @@ ok8 CREATE TABLE public.ok8 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok8_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY RANGE (a) ( PARTITION p1 VALUES FROM (MINVALUE) TO (1), @@ -780,7 +780,7 @@ TABLE ok8 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok8_pkey ├── a int not null └── b int not null scan ok8 @@ -806,7 +806,7 @@ ok9 CREATE TABLE public.ok9 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok9_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY RANGE (a, b) ( PARTITION p1 VALUES FROM (MINVALUE, MINVALUE) TO (1, MAXVALUE), @@ -825,7 +825,7 @@ TABLE ok9 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok9_pkey ├── a int not null └── b int not null scan ok9 @@ -852,7 +852,7 @@ ok10 CREATE TABLE public.ok10 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok10_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY RANGE (a, b) ( PARTITION p1 VALUES FROM (MINVALUE, MINVALUE) TO (1, 1), @@ -872,7 +872,7 @@ TABLE ok10 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok10_pkey ├── a int not null └── b int not null scan ok10 @@ -904,7 +904,7 @@ ok11 CREATE TABLE public.ok11 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC, c ASC), + CONSTRAINT ok11_pkey PRIMARY KEY (a ASC, b ASC, c ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a) ( PARTITION p1 VALUES IN ((1)) PARTITION BY LIST (b) ( @@ -928,7 +928,7 @@ TABLE ok11 ├── c int not null ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok11_pkey ├── a int not null ├── b int not null ├── c int not null @@ -961,7 +961,7 @@ ok12 CREATE TABLE public.ok12 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT ok12_pkey PRIMARY KEY (a ASC, b ASC), FAMILY "primary" (a, b, c) ) PARTITION BY LIST (a) ( PARTITION pu VALUES IN ((NULL)), @@ -979,7 +979,7 @@ TABLE ok12 ├── c int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX ok12_pkey ├── a int not null ├── b int not null └── partitions @@ -1029,7 +1029,7 @@ CREATE TABLE d_show_partitions.t (x INT PRIMARY KEY) PARTITION BY LIST (x) ( PAR query TTTTTTTTT SHOW PARTITIONS FROM DATABASE d_show_partitions ---- -d_show_partitions t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +d_show_partitions t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1039,7 +1039,7 @@ lease_preferences = '[]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE d_show_partitions.t ---- -d_show_partitions t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +d_show_partitions t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1047,9 +1047,9 @@ constraints = '[]', lease_preferences = '[]' query TTTTTTTTT -SHOW PARTITIONS FROM INDEX d_show_partitions.t@primary +SHOW PARTITIONS FROM INDEX d_show_partitions.t@t_pkey ---- -d_show_partitions t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +d_show_partitions t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1065,7 +1065,7 @@ CREATE TABLE "show partitions".t (x INT PRIMARY KEY) PARTITION BY LIST (x) ( PAR query TTTTTTTTT SHOW PARTITIONS FROM DATABASE "show partitions" ---- -show partitions t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +show partitions t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1075,7 +1075,7 @@ lease_preferences = '[]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE "show partitions".t ---- -show partitions t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +show partitions t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1083,9 +1083,9 @@ constraints = '[]', lease_preferences = '[]' query TTTTTTTTT -SHOW PARTITIONS FROM INDEX "show partitions".t@primary +SHOW PARTITIONS FROM INDEX "show partitions".t@t_pkey ---- -show partitions t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +show partitions t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1101,7 +1101,7 @@ CREATE TABLE """".t (x INT PRIMARY KEY) PARTITION BY LIST (x) ( PARTITION p1 VAL query TTTTTTTTT SHOW PARTITIONS FROM DATABASE """" ---- -" t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +" t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1111,7 +1111,7 @@ lease_preferences = '[]' query TTTTTTTTT SHOW PARTITIONS FROM TABLE """".t ---- -" t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +" t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1119,9 +1119,9 @@ constraints = '[]', lease_preferences = '[]' query TTTTTTTTT -SHOW PARTITIONS FROM INDEX """".t@primary +SHOW PARTITIONS FROM INDEX """".t@t_pkey ---- -" t p1 NULL x t@primary (1) NULL range_min_bytes = 134217728, +" t p1 NULL x t@t_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1143,7 +1143,7 @@ ALTER TABLE t_inherit PARTITION BY LIST (x) ( PARTITION p1 VALUES IN (1) ) query TTTTTTTTT SHOW PARTITIONS FROM TABLE t_inherit ---- -test t_inherit p1 NULL x t_inherit@primary (1) NULL range_min_bytes = 134217728, +test t_inherit p1 NULL x t_inherit@t_inherit_pkey (1) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1156,7 +1156,7 @@ ALTER PARTITION p1 of TABLE t_inherit CONFIGURE ZONE USING num_replicas=5 query TTTTTTTTT SHOW PARTITIONS FROM TABLE t_inherit ---- -test t_inherit p1 NULL x t_inherit@primary (1) num_replicas = 5 range_min_bytes = 134217728, +test t_inherit p1 NULL x t_inherit@t_inherit_pkey (1) num_replicas = 5 range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 5, @@ -1172,7 +1172,7 @@ ALTER TABLE t_inherit_range PARTITION BY RANGE (x) ( PARTITION p1 VALUES FROM (1 query TTTTTTTTT SHOW PARTITIONS FROM TABLE t_inherit_range ---- -test t_inherit_range p1 NULL x t_inherit_range@primary (1) TO (2) NULL range_min_bytes = 134217728, +test t_inherit_range p1 NULL x t_inherit_range@t_inherit_range_pkey (1) TO (2) NULL range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 3, @@ -1185,7 +1185,7 @@ ALTER PARTITION p1 of TABLE t_inherit_range CONFIGURE ZONE USING num_replicas=5 query TTTTTTTTT SHOW PARTITIONS FROM TABLE t_inherit_range ---- -test t_inherit_range p1 NULL x t_inherit_range@primary (1) TO (2) num_replicas = 5 range_min_bytes = 134217728, +test t_inherit_range p1 NULL x t_inherit_range@t_inherit_range_pkey (1) TO (2) num_replicas = 5 range_min_bytes = 134217728, range_max_bytes = 536870912, gc.ttlseconds = 90000, num_replicas = 5, @@ -1209,7 +1209,7 @@ CREATE TABLE public.partition_by_nothing ( pk INT8 NOT NULL, a INT8 NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT partition_by_nothing_pkey PRIMARY KEY (pk ASC), UNIQUE INDEX partition_by_nothing_b_key (b ASC), INDEX partition_by_nothing_b_idx (b ASC), FAMILY fam_0_pk_a_b (pk, a, b) diff --git a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_all_by_nothing b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_all_by_nothing index 8bae52b18576..c2a5ee06f3ad 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_all_by_nothing +++ b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_all_by_nothing @@ -32,7 +32,7 @@ CREATE TABLE public.partition_all_by_nothing ( a INT8 NULL, b INT8 NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT partition_all_by_nothing_pkey PRIMARY KEY (pk ASC), UNIQUE INDEX partition_all_by_nothing_c_key (c ASC), UNIQUE INDEX partition_all_by_nothing_b_key (b ASC), INDEX partition_all_by_nothing_b_idx (b ASC), @@ -53,7 +53,7 @@ CREATE TABLE public.partition_all_by_nothing ( a INT8 NULL, b INT8 NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT partition_all_by_nothing_pkey PRIMARY KEY (pk ASC), UNIQUE INDEX partition_all_by_nothing_c_key (c ASC), UNIQUE INDEX partition_all_by_nothing_b_key (b ASC), INDEX partition_all_by_nothing_b_idx (b ASC), diff --git a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_enum b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_enum index 37a741298799..70badf372e1e 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_enum +++ b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_enum @@ -65,7 +65,7 @@ drop type if exists t; create type t as enum('a', 'b', 'c'); create table tbl (pk t PRIMARY KEY) PARTITION BY LIST (pk) (PARTITION "a" VALUES IN ('a')) -statement error pgcode 2BP01 could not remove enum value "a" as it is being used in the partitioning of index tbl@primary +statement error pgcode 2BP01 could not remove enum value "a" as it is being used in the partitioning of index tbl@tbl_pkey alter type t drop value 'a' statement ok @@ -74,7 +74,7 @@ drop type if exists t; create type t as enum('a', 'b', 'c'); create table tbl (i INT, k t, PRIMARY KEY (i, k)) PARTITION BY LIST (i) (PARTITION "one" VALUES IN (1) PARTITION BY RANGE (k) (PARTITION "a" VALUES FROM ('a') TO ('b'))) -statement error pgcode 2BP01 could not remove enum value "a" as it is being used in the partitioning of index tbl@primary +statement error pgcode 2BP01 could not remove enum value "a" as it is being used in the partitioning of index tbl@tbl_pkey alter type t drop value 'a' statement ok diff --git a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit index a91a2aca74db..0db41ac879f3 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit +++ b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit @@ -93,7 +93,7 @@ CREATE TABLE public.t ( c INT8 NULL, d INT8 NULL, j JSONB NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT t_pkey PRIMARY KEY (pk ASC), INDEX t_b_idx (b ASC) PARTITION BY LIST (a) ( PARTITION b_implicit VALUES IN ((2)) ), @@ -127,7 +127,7 @@ CREATE TABLE public.t ( c INT8 NULL, d INT8 NULL, j JSONB NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT t_pkey PRIMARY KEY (pk ASC), INDEX t_b_idx (b ASC) PARTITION BY LIST (a) ( PARTITION b_implicit VALUES IN ((2)) ), @@ -163,7 +163,7 @@ TABLE t ├── tableoid oid [hidden] [system] ├── j_inverted_key bytes not null [inverted] ├── FAMILY fam_0_pk_a_b_c_d_j (pk, a, b, c, d, j) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── a int not null (implicit) │ ├── pk int not null │ └── partitions @@ -242,7 +242,7 @@ CREATE TABLE public.fk_using_implicit_columns_against_t_one_family ( pk INT8 NOT NULL, ref_t_pk INT8 NOT NULL, ref_t_c INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT fk_using_implicit_columns_against_t_one_family_pkey PRIMARY KEY (pk ASC), CONSTRAINT fk_ref_t_pk_ref_t FOREIGN KEY (ref_t_pk) REFERENCES public.t(pk), CONSTRAINT fk_ref_t_c_ref_t FOREIGN KEY (ref_t_c) REFERENCES public.t(c), FAMILY fam_0_pk_ref_t_pk_ref_t_c (pk, ref_t_pk, ref_t_c) @@ -368,8 +368,6 @@ ORDER BY 1, 2 index_name column_name implicit new_idx a true new_idx d false -primary a true -primary pk false t_a_b_c_idx a false t_a_b_c_idx b false t_a_b_c_idx c false @@ -380,6 +378,8 @@ t_c_key a true t_c_key c false t_j_idx a true t_j_idx j false +t_pkey a true +t_pkey pk false query TTT colnames SELECT @@ -390,11 +390,11 @@ ORDER BY 1, 2, 3 ---- tablename indexname indexdef t new_idx CREATE INDEX new_idx ON test.public.t USING btree (d ASC) -t primary CREATE UNIQUE INDEX "primary" ON test.public.t USING btree (pk ASC) t t_a_b_c_idx CREATE INDEX t_a_b_c_idx ON test.public.t USING btree (a ASC, b ASC, c ASC) t t_b_idx CREATE INDEX t_b_idx ON test.public.t USING btree (b ASC) t t_c_key CREATE UNIQUE INDEX t_c_key ON test.public.t USING btree (c ASC) t t_j_idx CREATE INDEX t_j_idx ON test.public.t USING gin (j ASC) +t t_pkey CREATE UNIQUE INDEX t_pkey ON test.public.t USING btree (pk ASC) statement error cannot ALTER INDEX PARTITION BY on an index which already has implicit column partitioning ALTER INDEX new_idx PARTITION BY LIST (a) ( @@ -496,7 +496,7 @@ CREATE TABLE public.t ( j JSONB NULL, u STRING NULL, e INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT t_pkey PRIMARY KEY (pk ASC), UNIQUE INDEX t_u_key (u ASC), INDEX t_a_idx (a ASC), UNIQUE INDEX t_b_key (b ASC), @@ -519,16 +519,6 @@ ORDER BY index_name, seq_in_index created_idx partition_by true created_idx c false created_idx pk true -primary partition_by true -primary pk false -primary pk2 false -primary a false -primary b false -primary c false -primary d false -primary j false -primary u false -primary e false t_a_idx partition_by true t_a_idx a false t_a_idx pk true @@ -544,6 +534,16 @@ t_j_idx pk true t_partition_by_c_idx partition_by false t_partition_by_c_idx c false t_partition_by_c_idx pk true +t_pkey partition_by true +t_pkey pk false +t_pkey pk2 false +t_pkey a false +t_pkey b false +t_pkey c false +t_pkey d false +t_pkey j false +t_pkey u false +t_pkey e false t_u_key partition_by true t_u_key u false t_u_key pk true @@ -560,8 +560,6 @@ ORDER BY 1, 2 index_name column_name implicit created_idx c false created_idx partition_by true -primary partition_by true -primary pk false t_a_idx a false t_a_idx partition_by true t_b_key b false @@ -572,6 +570,8 @@ t_j_idx j false t_j_idx partition_by true t_partition_by_c_idx c false t_partition_by_c_idx partition_by false +t_pkey partition_by true +t_pkey pk false t_u_key partition_by true t_u_key u false unique_c_d c false @@ -595,7 +595,7 @@ CREATE TABLE public.t ( j JSONB NULL, u STRING NULL, e INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk2 ASC), + CONSTRAINT t_pkey PRIMARY KEY (pk2 ASC), UNIQUE INDEX t_pk_key (pk ASC), UNIQUE INDEX t_u_key (u ASC), INDEX t_a_idx (a ASC), @@ -620,8 +620,6 @@ ORDER BY 1, 2 index_name column_name implicit created_idx c false created_idx partition_by true -primary partition_by true -primary pk2 false t_a_idx a false t_a_idx partition_by true t_b_key b false @@ -634,6 +632,8 @@ t_partition_by_c_idx c false t_partition_by_c_idx partition_by false t_pk_key partition_by true t_pk_key pk false +t_pkey partition_by true +t_pkey pk2 false t_u_key partition_by true t_u_key u false unique_c_d c false @@ -679,8 +679,6 @@ ORDER BY 1, 2 index_name column_name implicit created_idx c false created_idx partition_by true -primary partition_by true -primary pk false t_a_idx a false t_a_idx partition_by true t_b_key b false @@ -689,6 +687,8 @@ t_c_key c false t_c_key partition_by true t_partition_by_c_idx c false t_partition_by_c_idx partition_by false +t_pkey partition_by true +t_pkey pk false query T SELECT create_statement FROM [SHOW CREATE TABLE t] @@ -701,7 +701,7 @@ CREATE TABLE public.t ( b INT8 NULL, c INT8 NULL, d INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT t_pkey PRIMARY KEY (pk ASC), INDEX t_a_idx (a ASC), UNIQUE INDEX t_b_key (b ASC), UNIQUE INDEX t_c_key (c ASC) WHERE d > 100:::INT8, @@ -779,7 +779,7 @@ vectorized: true │ count: 1 │ └── • lookup join - │ table: t@primary + │ table: t@t_pkey │ equality: (partition_by, pk) = (partition_by,pk) │ equality cols are key │ @@ -820,7 +820,7 @@ vectorized: true │ ├── • upsert │ │ into: t(pk, pk2, partition_by, a, b, c, d) -│ │ arbiter constraints: primary +│ │ arbiter constraints: t_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -837,7 +837,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -865,7 +865,7 @@ vectorized: true │ count: 1 │ └── • lookup join - │ table: t@primary + │ table: t@t_pkey │ equality: (partition_by, pk) = (partition_by,pk) │ equality cols are key │ diff --git a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_index b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_index index 1846dcc42bdf..7ed4f11e0003 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/partitioning_index +++ b/pkg/ccl/logictestccl/testdata/logic_test/partitioning_index @@ -16,7 +16,7 @@ SHOW CREATE TABLE ok1 ok1 CREATE TABLE public.ok1 ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT ok1_pkey PRIMARY KEY (a ASC), INDEX ok1_b_idx (b ASC) PARTITION BY LIST (b) ( PARTITION p1 VALUES IN ((1)), PARTITION pu VALUES IN ((NULL)) @@ -45,7 +45,7 @@ SHOW CREATE TABLE ok2 ok2 CREATE TABLE public.ok2 ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT ok2_pkey PRIMARY KEY (a ASC), UNIQUE INDEX ok2_b_key (b ASC) PARTITION BY LIST (b) ( PARTITION p1 VALUES IN ((1)) ), @@ -76,7 +76,7 @@ SHOW CREATE TABLE ok3 ok3 CREATE TABLE public.ok3 ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT ok3_pkey PRIMARY KEY (a ASC), UNIQUE INDEX ok3_b_key (b ASC) PARTITION BY LIST (b) ( PARTITION p1 VALUES IN ((1)) ), @@ -131,7 +131,7 @@ SHOW CREATE TABLE indexes indexes CREATE TABLE public.indexes ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT indexes_pkey PRIMARY KEY (a ASC), INDEX i1 (b ASC) PARTITION BY LIST (b) ( PARTITION p1 VALUES IN ((1)) ), @@ -173,7 +173,7 @@ inverted CREATE TABLE public.inverted ( a INT8 NOT NULL, b INT8 NULL, j JSONB NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT inverted_pkey PRIMARY KEY (a ASC), INVERTED INDEX inverted_b_j_idx (b, j) PARTITION BY LIST (b) ( PARTITION p1 VALUES IN ((1)), PARTITION pu VALUES IN ((NULL)) @@ -205,7 +205,7 @@ CREATE TABLE public.t60019 ( pk INT8 NOT NULL, a INT8 NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT t60019_pkey PRIMARY KEY (pk ASC), INDEX t60019_a_b_idx (a ASC, b ASC) PARTITION BY LIST (a) ( PARTITION c_implicit VALUES IN ((3)) ) WHERE b > 0:::INT8, diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row index ab96aa1f2866..10b080dd801a 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row @@ -143,7 +143,7 @@ CREATE TABLE public.regional_by_row_table_explicit_crdb_region_column ( pk INT8 NOT NULL, a INT8 NULL, crdb_region public.crdb_internal_region NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_explicit_crdb_region_column_pkey PRIMARY KEY (pk ASC), FAMILY fam_0_pk_a_crdb_region (pk, a, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -153,13 +153,13 @@ ORDER BY partition_name, index_name ---- num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table_explicit_crdb_region_column@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table_explicit_crdb_region_column@regional_by_row_table_explicit_crdb_region_column_pkey ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table_explicit_crdb_region_column@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table_explicit_crdb_region_column@regional_by_row_table_explicit_crdb_region_column_pkey ca-central-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_table_explicit_crdb_region_column@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_table_explicit_crdb_region_column@regional_by_row_table_explicit_crdb_region_column_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table_explicit_crdb_region_column @@ -191,12 +191,6 @@ query TTB SELECT index_name, column_name, implicit FROM [SHOW INDEXES FROM regional_by_row_table] ORDER BY index_name, seq_in_index ---- -primary crdb_region true -primary pk false -primary pk2 false -primary a false -primary b false -primary j false regional_by_row_table_a_idx crdb_region true regional_by_row_table_a_idx a false regional_by_row_table_a_idx pk true @@ -206,6 +200,12 @@ regional_by_row_table_b_key pk true regional_by_row_table_j_idx crdb_region true regional_by_row_table_j_idx j false regional_by_row_table_j_idx pk true +regional_by_row_table_pkey crdb_region true +regional_by_row_table_pkey pk false +regional_by_row_table_pkey pk2 false +regional_by_row_table_pkey a false +regional_by_row_table_pkey b false +regional_by_row_table_pkey j false query T SELECT create_statement FROM [SHOW CREATE TABLE regional_by_row_table] @@ -217,7 +217,7 @@ CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -230,9 +230,6 @@ ORDER BY partition_name, index_name ---- num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@primary ap-southeast-2 -num_voters = 5, -voter_constraints = '{+region=ap-southeast-2: 2}', lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_a_idx ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', @@ -241,8 +238,8 @@ num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_j_idx ap-southeast-2 num_voters = 5, -voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@primary ca-central-1 +voter_constraints = '{+region=ap-southeast-2: 2}', +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_pkey ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_a_idx ca-central-1 @@ -253,8 +250,8 @@ num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_j_idx ca-central-1 num_voters = 5, -voter_constraints = '{+region=us-east-1: 2}', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@primary us-east-1 +voter_constraints = '{+region=ca-central-1: 2}', +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_pkey ca-central-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_row_table_a_idx us-east-1 @@ -264,6 +261,9 @@ lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_r num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_row_table_j_idx us-east-1 +num_voters = 5, +voter_constraints = '{+region=us-east-1: 2}', +lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_row_table_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table @@ -284,14 +284,14 @@ WHERE descriptor_name = 'regional_by_row_table' AND column_type = 'key' ORDER BY 1, 2 ---- index_name column_name implicit -primary crdb_region true -primary pk false regional_by_row_table_a_idx a false regional_by_row_table_a_idx crdb_region true regional_by_row_table_b_key b false regional_by_row_table_b_key crdb_region true regional_by_row_table_j_idx crdb_region true regional_by_row_table_j_idx j false +regional_by_row_table_pkey crdb_region true +regional_by_row_table_pkey pk false query TTTTIT colnames SHOW TABLES @@ -317,7 +317,7 @@ CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -372,7 +372,7 @@ CREATE TABLE public.regional_by_row_table ( j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, unique_col INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -387,9 +387,6 @@ ORDER BY partition_name, index_name ---- num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@primary ap-southeast-2 -num_voters = 5, -voter_constraints = '{+region=ap-southeast-2: 2}', lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_a_idx ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', @@ -399,10 +396,10 @@ voter_constraints = '{+region=ap-southeast-2: 2}', lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_j_idx ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_unique_col_key ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_pkey ap-southeast-2 num_voters = 5, -voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@primary ca-central-1 +voter_constraints = '{+region=ap-southeast-2: 2}', +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table@regional_by_row_table_unique_col_key ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_a_idx ca-central-1 @@ -414,10 +411,10 @@ voter_constraints = '{+region=ca-central-1: 2}', lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_j_idx ca-central-1 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_unique_col_key ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_pkey ca-central-1 num_voters = 5, -voter_constraints = '{+region=us-east-1: 2}', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@primary us-east-1 +voter_constraints = '{+region=ca-central-1: 2}', +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table@regional_by_row_table_unique_col_key ca-central-1 gc.ttlseconds = 10, num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', @@ -430,6 +427,9 @@ voter_constraints = '{+region=us-east-1: 2}', lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_row_table_j_idx us-east-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', +lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_row_table_pkey us-east-1 +num_voters = 5, +voter_constraints = '{+region=us-east-1: 2}', lease_preferences = '[[+region=us-east-1]]' regional_by_row_table@regional_by_row_table_unique_col_key us-east-1 statement ok @@ -461,14 +461,14 @@ WHERE descriptor_name = 'regional_by_row_table' AND column_type = 'key' ORDER BY 1, 2 ---- index_name column_name implicit -primary crdb_region true -primary pk false regional_by_row_table_a_idx a false regional_by_row_table_a_idx crdb_region true regional_by_row_table_b_key b false regional_by_row_table_b_key crdb_region true regional_by_row_table_j_idx crdb_region true regional_by_row_table_j_idx j false +regional_by_row_table_pkey crdb_region true +regional_by_row_table_pkey pk false uniq_idx a false uniq_idx crdb_region true @@ -576,7 +576,7 @@ CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk2 ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk2 ASC), UNIQUE INDEX regional_by_row_table_pk_key (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), @@ -588,17 +588,17 @@ CREATE TABLE public.regional_by_row_table ( ALTER PARTITION "us-east-1" OF INDEX multi_region_test_db.public.regional_by_row_table@regional_by_row_table_a_idx CONFIGURE ZONE USING "gc.ttlseconds" = 10 query TT -SHOW ZONE CONFIGURATION FOR PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@primary ----- -PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@primary ALTER PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@primary CONFIGURE ZONE USING - range_min_bytes = 134217728, - range_max_bytes = 536870912, - gc.ttlseconds = 90000, - num_replicas = 5, - num_voters = 5, - constraints = '{+region=ap-southeast-2: 1, +region=ca-central-1: 1, +region=us-east-1: 1}', - voter_constraints = '{+region=ap-southeast-2: 2}', - lease_preferences = '[[+region=ap-southeast-2]]' +SHOW ZONE CONFIGURATION FOR PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@regional_by_row_table_pkey +---- +PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@regional_by_row_table_pkey ALTER PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@regional_by_row_table_pkey CONFIGURE ZONE USING + range_min_bytes = 134217728, + range_max_bytes = 536870912, + gc.ttlseconds = 90000, + num_replicas = 5, + num_voters = 5, + constraints = '{+region=ap-southeast-2: 1, +region=ca-central-1: 1, +region=us-east-1: 1}', + voter_constraints = '{+region=ap-southeast-2: 2}', + lease_preferences = '[[+region=ap-southeast-2]]' query TT SHOW ZONE CONFIGURATION FOR PARTITION "ap-southeast-2" OF INDEX regional_by_row_table@regional_by_row_table_pk_key @@ -678,7 +678,7 @@ CREATE TABLE public.regional_by_row_table_as ( a INT8 NULL, b INT8 NULL, crdb_region_col public.crdb_internal_region NOT NULL AS (CASE WHEN pk <= 10:::INT8 THEN 'us-east-1':::public.crdb_internal_region ELSE 'ap-southeast-2':::public.crdb_internal_region END) STORED, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_as_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_as_b_key (b ASC), FAMILY fam_0_pk_a_b_crdb_region_col (pk, a, b, crdb_region_col) @@ -690,16 +690,13 @@ ORDER BY partition_name, index_name ---- num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table_as@primary ap-southeast-2 -num_voters = 5, -voter_constraints = '{+region=ap-southeast-2: 2}', lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table_as@regional_by_row_table_as_a_idx ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table_as@regional_by_row_table_as_b_key ap-southeast-2 num_voters = 5, -voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table_as@primary ca-central-1 +voter_constraints = '{+region=ap-southeast-2: 2}', +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_table_as@regional_by_row_table_as_pkey ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table_as@regional_by_row_table_as_a_idx ca-central-1 @@ -707,14 +704,17 @@ num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table_as@regional_by_row_table_as_b_key ca-central-1 num_voters = 5, -voter_constraints = '{+region=us-east-1: 2}', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_table_as@primary us-east-1 +voter_constraints = '{+region=ca-central-1: 2}', +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_table_as@regional_by_row_table_as_pkey ca-central-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', lease_preferences = '[[+region=us-east-1]]' regional_by_row_table_as@regional_by_row_table_as_a_idx us-east-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', lease_preferences = '[[+region=us-east-1]]' regional_by_row_table_as@regional_by_row_table_as_b_key us-east-1 +num_voters = 5, +voter_constraints = '{+region=us-east-1: 2}', +lease_preferences = '[[+region=us-east-1]]' regional_by_row_table_as@regional_by_row_table_as_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_table_as @@ -779,13 +779,13 @@ ORDER BY partition_name, index_name ---- num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@t_regional_by_row_pkey ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@t_regional_by_row_pkey ca-central-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', -lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@t_regional_by_row_pkey us-east-1 query TTT SELECT zone_config, index_name, partition_name FROM [SHOW PARTITIONS FROM TABLE t_regional_by_row] @@ -793,13 +793,13 @@ ORDER BY partition_name, index_name ---- num_voters = 5, voter_constraints = '{+region=ap-southeast-2: 2}', -lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@t_regional_by_row_pkey ap-southeast-2 num_voters = 5, voter_constraints = '{+region=ca-central-1: 2}', -lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@t_regional_by_row_pkey ca-central-1 num_voters = 5, voter_constraints = '{+region=us-east-1: 2}', -lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@t_regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE t_regional_by_row @@ -840,13 +840,13 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@t_regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@t_regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@t_regional_by_row_pkey us-east-1 query TTT SELECT zone_config, index_name, partition_name FROM [SHOW PARTITIONS FROM TABLE t_regional_by_row] @@ -854,13 +854,13 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' t_regional_by_row@t_regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' t_regional_by_row@t_regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' t_regional_by_row@t_regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE t_regional_by_row @@ -947,7 +947,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -958,10 +958,10 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -983,7 +983,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -994,10 +994,10 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -1027,7 +1027,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -1038,16 +1038,16 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -1069,7 +1069,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -1081,16 +1081,16 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -1116,7 +1116,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -1128,22 +1128,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -1165,7 +1165,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -1176,22 +1176,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -1241,7 +1241,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -1252,22 +1252,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -1293,7 +1293,7 @@ regional_by_row_like CREATE TABLE public.regional_by_ i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT regional_by_row_like_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (pk, i, crdb_region, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1308,7 +1308,7 @@ regional_by_row_like CREATE TABLE public.regional_by_ pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (crdb_region ASC, pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (crdb_region ASC, pk ASC), INDEX regional_by_row_i_idx (crdb_region ASC, i ASC), FAMILY "primary" (pk, i, crdb_region) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1325,7 +1325,7 @@ regional_by_row_like CREATE TABLE public.regional_by_ pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (crdb_region ASC, pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (crdb_region ASC, pk ASC), INDEX regional_by_row_i_idx (crdb_region ASC, i ASC), FAMILY "primary" (pk, i, crdb_region) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION @@ -1340,7 +1340,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -1351,22 +1351,22 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -1402,7 +1402,7 @@ regional_by_row_unique_in_column CREATE TABLE public.regional_by_row_unique_in_ d INT8 NULL, e INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT regional_by_row_unique_in_column_pkey PRIMARY KEY (a ASC), UNIQUE INDEX regional_by_row_unique_in_column_b_key (b ASC), UNIQUE INDEX regional_by_row_unique_in_column_d_e_key (d ASC, e ASC), FAMILY fam_0_a_b_c_d_e_crdb_region (a, b, c, d, e, crdb_region) @@ -1429,7 +1429,7 @@ regional_by_row_fk CREATE TABLE public.regional_by_row_fk ( i INT8 NULL, j INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (f ASC), + CONSTRAINT regional_by_row_fk_pkey PRIMARY KEY (f ASC), CONSTRAINT ij_fk FOREIGN KEY (i, j) REFERENCES public.regional_by_row_unique_in_column(e, d), CONSTRAINT fk_g_ref_regional_by_row_unique_in_column FOREIGN KEY (g) REFERENCES public.regional_by_row_unique_in_column(a), CONSTRAINT fk_h_ref_regional_by_row_unique_in_column FOREIGN KEY (h) REFERENCES public.regional_by_row_unique_in_column(b), @@ -1464,16 +1464,16 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row@regional_by_row_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -1495,7 +1495,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -1506,16 +1506,16 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@primary ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ap-southeast-2]', -lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_i_idx ap-southeast-2 +lease_preferences = '[[+region=ap-southeast-2]]' regional_by_row_as@regional_by_row_as_pkey ap-southeast-2 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -1537,7 +1537,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -1555,16 +1555,16 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row@regional_by_row_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -1586,7 +1586,7 @@ regional_by_row CREATE TABLE public.regional_by_row ( pk INT8 NOT NULL, i INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_i_idx (i ASC), FAMILY fam_0_pk_i_crdb_region (pk, i, crdb_region) ) LOCALITY REGIONAL BY ROW @@ -1597,16 +1597,16 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@primary us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 num_voters = 3, voter_constraints = '[+region=us-east-1]', -lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_i_idx us-east-1 +lease_preferences = '[[+region=us-east-1]]' regional_by_row_as@regional_by_row_as_pkey us-east-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row_as @@ -1628,7 +1628,7 @@ regional_by_row_as CREATE TABLE public.regional_by_row_as ( pk INT8 NOT NULL, i INT8 NULL, cr public.crdb_internal_region NOT NULL DEFAULT 'ca-central-1':::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_as_i_idx (i ASC), FAMILY fam_0_cr_pk_i (cr, pk, i) ) LOCALITY REGIONAL BY ROW AS cr @@ -1643,10 +1643,10 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row@regional_by_row_pkey ca-central-1 query TT SHOW ZONE CONFIGURATION FROM TABLE regional_by_row @@ -1680,10 +1680,10 @@ ORDER BY partition_name, index_name ---- num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@primary ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 num_voters = 3, voter_constraints = '[+region=ca-central-1]', -lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_i_idx ca-central-1 +lease_preferences = '[[+region=ca-central-1]]' regional_by_row_as@regional_by_row_as_pkey ca-central-1 # Can't drop the primary region while regional by row tables still exist in the database. statement error removing primary region from database drop_regions: cannot drop type "crdb_internal_region" because other objects \(\[drop_regions.public.regional_by_row drop_regions.public.regional_by_row_as\]\) still depend on it diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior index d70e1a244ddf..ba22a9541e1f 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior @@ -36,7 +36,7 @@ TABLE regional_by_row_table ├── j_inverted_key bytes not null [inverted] ├── FAMILY fam_0_pk_pk2_a_b_j_crdb_region (pk, pk2, a, b, j, crdb_region) ├── CHECK (crdb_region IN (x'40':::@, x'80':::@, x'c0':::@)) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX regional_by_row_table_pkey │ ├── crdb_region crdb_internal_region not null default (default_to_database_primary_region(gateway_region())::@) [hidden] (implicit) │ ├── pk int not null │ ├── ZONE @@ -303,7 +303,7 @@ ORDER BY pk LIMIT 5] OFFSET 2 │ │ columns: (pk, pk2, a, b, j) │ │ ordering: +pk │ │ estimated row count: 5 (missing stats) - │ │ table: regional_by_row_table@primary + │ │ table: regional_by_row_table@regional_by_row_table_pkey │ │ spans: /"@"-/"@"/PrefixEnd │ │ limit: 5 │ │ @@ -311,7 +311,7 @@ ORDER BY pk LIMIT 5] OFFSET 2 │ columns: (pk, pk2, a, b, j) │ ordering: +pk │ estimated row count: 5 (missing stats) - │ table: regional_by_row_table@primary + │ table: regional_by_row_table@regional_by_row_table_pkey │ spans: /"\x80"-/"\x80"/PrefixEnd │ limit: 5 │ @@ -319,7 +319,7 @@ ORDER BY pk LIMIT 5] OFFSET 2 columns: (pk, pk2, a, b, j) ordering: +pk estimated row count: 5 (missing stats) - table: regional_by_row_table@primary + table: regional_by_row_table@regional_by_row_table_pkey spans: /"\xc0"-/"\xc0"/PrefixEnd limit: 5 @@ -349,7 +349,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM regional_by_row_table WHERE pk = · • scan missing stats - table: regional_by_row_table@primary + table: regional_by_row_table@regional_by_row_table_pkey spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8kN2q00AQgO99imWuVFbyV0EWhIimGKhNTQIKTSjb7FCCaTbubrCl5N0lm4taKYdz2sO5nJ9v5ps5gf7dAIMsWkSfc_KWzNPkG1lHP1eLT_GSvP4SZ3n2ffGGXDYo3NWy5c1me9wo-Wdj-LZB8uNrlEak-0U-Eq8kyXyeRTnxgUIrBS75HjWwNXhQUuiUrFBrqcbUyTbE4gDMpVC3XW_GdEmhkgqBncDUpkFgkI97UuQCleMCBYGG140de1Up7FS95-oIFLKOt5oRp4CwAMezeNIbRkKPhj4NAxrOaPgeyoGC7M3ZQRu-Q2DeQG_z9G71LIrDB_dlXf07XKvndj0r9q1UAhWKC71yuHLNUr6TnRP813h9tf-UN6WoO9lqfNRkd1RDscPpDi17VeFKycqumcLEcjYhUJupGkxB3NqS_c2_sHcP7N8DBw_CswvYHcrh1d8AAAD__97CZ-c= @@ -383,7 +383,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY Scan /Table/56/1/"\xc0"/1/0 Scan /Table/56/1/"@"/1/0 Scan /Table/56/1/"\x80"/1/0 -fetched: /regional_by_row_table/primary/'ap-southeast-2'/1/pk2/a/b/j -> /1/2/3/'{"a": "b"}' +fetched: /regional_by_row_table/regional_by_row_table_pkey/'ap-southeast-2'/1/pk2/a/b/j -> /1/2/3/'{"a": "b"}' output row: [1 1 2 3 '{"a": "b"}'] statement ok @@ -404,12 +404,12 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM regional_by_row_table WHERE pk = │ ├── • scan │ missing stats -│ table: regional_by_row_table@primary +│ table: regional_by_row_table@regional_by_row_table_pkey │ spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] │ └── • scan missing stats - table: regional_by_row_table@primary + table: regional_by_row_table@regional_by_row_table_pkey spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysklFr2zAQx9_3KcQ9bUMjlpPCEAw8NocFsqSzDRvUJqjWEcQcy5Nk1hL83Yflh84jC43TR53up_vd3z6C_VUBhzRex58y8pYsk-1Xchf_uF1_XG3I68-rNEu_rd-QcYPBvdK1qHb3jzujf--cuK-QfP8SJzFpfpIPhBVku1ymcUZCoFBriRtxQAv8DhgUFBqjS7RWm7509A0r-QA8oKDqpnV9uaBQaoPAj-CUqxA4ZP2cBIVEMwuAgkQnVOWfPakUNUYdhHkECmkjasvJLIc8f3gf5DBj_olt6ziJGI1CGs1ptKDRDRQdBd26Jw_rxB6Bs45Oc2VXuJYv7fqk2NbaSDQoR3pFd2KbjX6nm1n4T-Pp0eHUmOZTY4omRTR_RkQWjRIVuTipxXiVtTooR9h_VYJLIkvQNrq2-KyPEfSOKPc47GV1a0q8Nbr0Y4bj1nO-ING64TYcDqvaX_nf6W-YXQOHZ-HFeXh-Dbw4C9-M4KAruld_AgAA__9L0Kp2 @@ -449,7 +449,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/56/1/"@"/1/0 -fetched: /regional_by_row_table/primary/'ap-southeast-2'/1/pk2/a/b/j -> /1/2/3/'{"a": "b"}' +fetched: /regional_by_row_table/regional_by_row_table_pkey/'ap-southeast-2'/1/pk2/a/b/j -> /1/2/3/'{"a": "b"}' output row: [1 1 2 3 '{"a": "b"}'] statement ok @@ -469,7 +469,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- Scan /Table/56/1/"@"/10/0 Scan /Table/56/1/"\x80"/10/0 -fetched: /regional_by_row_table/primary/'ca-central-1'/10/pk2/a/b -> /10/11/12 +fetched: /regional_by_row_table/regional_by_row_table_pkey/'ca-central-1'/10/pk2/a/b -> /10/11/12 output row: [10 10 11 12 NULL] statement ok @@ -488,7 +488,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- Scan /Table/56/1/"@"/10/0 Scan /Table/56/1/"\x80"/10/0, /Table/56/1/"\xc0"/10/0 -fetched: /regional_by_row_table/primary/'ca-central-1'/10/pk2/a/b -> /10/11/12 +fetched: /regional_by_row_table/regional_by_row_table_pkey/'ca-central-1'/10/pk2/a/b -> /10/11/12 output row: [10 10 11 12 NULL] statement ok @@ -506,12 +506,12 @@ SELECT * FROM [EXPLAIN SELECT * FROM regional_by_row_table WHERE pk = 1] OFFSET │ ├── • scan │ missing stats -│ table: regional_by_row_table@primary +│ table: regional_by_row_table@regional_by_row_table_pkey │ spans: [/'ca-central-1'/1 - /'ca-central-1'/1] │ └── • scan missing stats - table: regional_by_row_table@primary + table: regional_by_row_table@regional_by_row_table_pkey spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] [/'us-east-1'/1 - /'us-east-1'/1] @@ -525,12 +525,12 @@ SELECT * FROM [EXPLAIN SELECT * FROM regional_by_row_table WHERE pk IN (1, 4)] O │ ├── • scan │ missing stats -│ table: regional_by_row_table@primary +│ table: regional_by_row_table@regional_by_row_table_pkey │ spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] [/'ap-southeast-2'/4 - /'ap-southeast-2'/4] │ └── • scan missing stats - table: regional_by_row_table@primary + table: regional_by_row_table@regional_by_row_table_pkey spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'ca-central-1'/4 - /'ca-central-1'/4] [/'us-east-1'/1 - /'us-east-1'/1] [/'us-east-1'/4 - /'us-east-1'/4] statement ok @@ -544,9 +544,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/56/1/"@"/1/0, /Table/56/1/"@"/4/0 -fetched: /regional_by_row_table/primary/'ap-southeast-2'/1/pk2/a/b/j -> /1/2/3/'{"a": "b"}' +fetched: /regional_by_row_table/regional_by_row_table_pkey/'ap-southeast-2'/1/pk2/a/b/j -> /1/2/3/'{"a": "b"}' output row: [1 1 2 3 '{"a": "b"}'] -fetched: /regional_by_row_table/primary/'ap-southeast-2'/4/pk2/a/b/j -> /4/5/6/'{"c": "d"}' +fetched: /regional_by_row_table/regional_by_row_table_pkey/'ap-southeast-2'/4/pk2/a/b/j -> /4/5/6/'{"c": "d"}' output row: [4 4 5 6 '{"c": "d"}'] # Tests using locality optimized search for lookup joins (including foreign @@ -596,13 +596,13 @@ SELECT * FROM [EXPLAIN SELECT * FROM child WHERE NOT EXISTS (SELECT * FROM paren ---- · • lookup join (anti) -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ap-southeast-2', 'ca-central-1', 'us-east-1')) │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] statement ok @@ -616,9 +616,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0, /Table/58/1/"\x80"/10/0, /Table/58/1/"\xc0"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0, /Table/57/1/"\x80"/10/0, /Table/57/1/"\xc0"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL # Semi join with locality optimized search disabled. query T @@ -626,13 +626,13 @@ SELECT * FROM [EXPLAIN SELECT * FROM child WHERE EXISTS (SELECT * FROM parent WH ---- · • lookup join (semi) -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ap-southeast-2', 'ca-central-1', 'us-east-1')) │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] statement ok @@ -646,9 +646,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0, /Table/58/1/"\x80"/10/0, /Table/58/1/"\xc0"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0, /Table/57/1/"\x80"/10/0, /Table/57/1/"\xc0"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL output row: [10 10] # Inner join with locality optimized search disabled. @@ -657,13 +657,13 @@ SELECT * FROM [EXPLAIN SELECT * FROM child INNER JOIN parent ON p_id = c_p_id WH ---- · • lookup join -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ap-southeast-2', 'ca-central-1', 'us-east-1')) │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] statement ok @@ -677,9 +677,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0, /Table/58/1/"\x80"/10/0, /Table/58/1/"\xc0"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0, /Table/57/1/"\x80"/10/0, /Table/57/1/"\xc0"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL output row: [10 10 10] # Left join with locality optimized search disabled. @@ -688,13 +688,13 @@ SELECT * FROM [EXPLAIN SELECT * FROM child LEFT JOIN parent ON p_id = c_p_id WHE ---- · • lookup join (left outer) -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ap-southeast-2', 'ca-central-1', 'us-east-1')) │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] statement ok @@ -708,9 +708,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0, /Table/58/1/"\x80"/10/0, /Table/58/1/"\xc0"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0, /Table/57/1/"\x80"/10/0, /Table/57/1/"\xc0"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL output row: [10 10 10] statement ok @@ -722,12 +722,12 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE NOT EXISTS (SELECT * ---- · • lookup join (anti) -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region = 'ap-southeast-2') │ @@ -736,12 +736,12 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE NOT EXISTS (SELECT * │ ├── • scan │ missing stats - │ table: child@primary + │ table: child@child_pkey │ spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0k9Fr2zAQxt_3Vxz3kmRoRHZcKIKCy-owF8_uEsMKjSmefbTeHMuTZEgJ-d9H7EDjsIS0Y2_R6ftyv-98WqP-XaLAuRd4n2P4CNNZ9BUevPu74NoPYXjjz-P5t2AEfUH2XJQ5fP_izTwYhlEM3v1WCMO-rE4VVWanqx-LHK4ge9z-GI3gOryBYdYVLT5KIJpO514MNjKsZE5huiSN4gEtTBjWSmaktVTb0roV-PkKBWdYVHVjtuWEYSYVoVijKUxJKDBOf5Q0ozQnNebIMCeTFmX7t20Gt1bFMlUvyHBep5UWMF7gYrG65AscW3zMIa1ysECaZ1LIMGqMANdiro3JhqFszGtvbdInQmFt2Pv4rHP53B3beTz2UZ5XDE2qSEtoKqlyUpT3SJLNX8BD-UnWY7uPHBTLwoB1FIW_ZTS3sqh2k5n028QvNQkIvGkM12Hsw23kh8iw27a9iQVS_mpq-CmLCmQlYOhO4Apce7d7rgNXsBo4fCCEcC3O-YUzOm-mk3cGcf5XkO1bXQ0u96MwWA2yXrYzwzlvCTcjXctK08HGHPv-CUPKn6jbPi0bldGdklnbpjtGra8t5KRNd2t3B79qr9oXtm-2_sVsnzRPemZ-aJ6cNDunzc5J88WBOdl8-BMAAP__98_FSA== @@ -775,9 +775,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL statement ok SET tracing = on,kv,results; SELECT * FROM child WHERE NOT EXISTS (SELECT * FROM parent WHERE p_id = c_p_id) AND c_id = 20; SET tracing = off @@ -792,10 +792,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- Scan /Table/58/1/"@"/20/0 Scan /Table/58/1/"\x80"/20/0, /Table/58/1/"\xc0"/20/0 -fetched: /child/primary/'ca-central-1'/20/c_p_id -> /20 +fetched: /child/child_pkey/'ca-central-1'/20/c_p_id -> /20 Scan /Table/57/1/"@"/20/0 Scan /Table/57/1/"\x80"/20/0, /Table/57/1/"\xc0"/20/0 -fetched: /parent/primary/'ca-central-1'/20 -> NULL +fetched: /parent/parent_pkey/'ca-central-1'/20 -> NULL # Semi join with locality optimized search enabled. query T @@ -803,7 +803,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE EXISTS (SELECT * FROM ---- · • lookup join (semi) -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region = 'ap-southeast-2') │ remote lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) @@ -813,12 +813,12 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE EXISTS (SELECT * FROM │ ├── • scan │ missing stats - │ table: child@primary + │ table: child@child_pkey │ spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykk1Fr2zAQgN_3K457STI0IjsZFEHAZXWYi5t0sWGFxhTPPlpvjuRJMqSE_PcRO9A4LF26vlmn-3Qfd-cNmt8lCoz80P8Sw0eYLuY3cO_f3YaXwQz6V0EUR9_CAXQTsqeizOH7V3_hg3-3y4F-N6NKNUm7T6keihwmkD3sPgZwObuCftbGHD5IYD6dRn4MLjKUKqdZuiKD4h4dTBhWWmVkjNK70KZJCPI1Cs6wkFVtd-GEYaY0odigLWxJKDBOf5S0oDQnPeTIMCebFmXzbGPvVbpYpfoZGUZVKo2A4RKXy_UFX-LQ4UMOqczBAWWfSCPDeW0FeA7zXEy2DFVtX2obmz4SCmfL_s_POdfP27ud5-Oe9HnRMKSLtIRaKp2Tprxjkmz_Ij5Tn1Q1dLvKYbEqLDgnVfhbWnOtCrnvzKhbJn6uSEDoT2OI_JsArufBDBm2y3bQsVCpX3UFP1UhQUkBfW8EE_Dc_e55Y5jAujfmPSGE53DOP48HyHBBK2UJyn_Su19j3bs45Bmse1nnwcF5Uxq9pTULMpWSho7GdKrpCUPKH6kduVG1zuhWq6wp0x7nDdcEcjK2vXXbQyCbq2atD2HnPbD7KjzqwPwYHr0Kj4_gZPvhTwAAAP__xPiDsw== @@ -851,9 +851,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL output row: [10 10] statement ok @@ -869,10 +869,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- Scan /Table/58/1/"@"/20/0 Scan /Table/58/1/"\x80"/20/0, /Table/58/1/"\xc0"/20/0 -fetched: /child/primary/'ca-central-1'/20/c_p_id -> /20 +fetched: /child/child_pkey/'ca-central-1'/20/c_p_id -> /20 Scan /Table/57/1/"@"/20/0 Scan /Table/57/1/"\x80"/20/0, /Table/57/1/"\xc0"/20/0 -fetched: /parent/primary/'ca-central-1'/20 -> NULL +fetched: /parent/parent_pkey/'ca-central-1'/20 -> NULL output row: [20 20] # Inner join with locality optimized search enabled. @@ -881,7 +881,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child INNER JOIN parent ON p_id = ---- · • lookup join -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region = 'ap-southeast-2') │ remote lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) @@ -891,12 +891,12 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child INNER JOIN parent ON p_id = │ ├── • scan │ missing stats - │ table: child@primary + │ table: child@child_pkey │ spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykklFr2zAQx9_3KY57STM0ItsZFEHBZXWYS2Z3TmCDxhTPPlptjuRJMmSEfPcRu9A4LF27vdkn_XQ__ndbtD9rFLiI5tGHJbyFWZZ-gtvo6838Mk7g7CpeLBef52MYXigfZF1BnCRRBtdpnEBTGFIO0gSaO1nBBZR33ceXj1EWQdnXPJ5DOpstoiX4yFDpipJiTRbFLXqYM2yMLslabfalbXchrjYoOEOpmtbtyznDUhtCsUUnXU0ocFl8qymjoiIz4ciwIlfIunu2Ew0bI9eF-YUMF02hrIDJClerzTlf4cTjEw6FqsAD7R7IIMO0dQJCj4U-5juGunVPva0r7gmFt2P_5ue91C98dHuZj3_S50nDkpFFDa3SpiJD1cAk3_1BPNHvdDPxh8pzuZYOvJMq_DXRXGupHpMJhm36jTqIZq71j7aB71oq0ErAWRjABYT-GC6TKzgLp3ABm9GUj4QQocc5fz8dI8OM1toR1H-l9-u-GZ0f8gw2o3Lw4HgwDhYGJ2MIXhNDRrbRytLRSE4FnDOk6p768VrdmpJujC67Nv1v2nFdoSLr-lO__4lVd9St8CHs_Q_sPwsHA5gfw8Gz8PQIzndvfgcAAP___at5GA== @@ -929,9 +929,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL output row: [10 10 10] statement ok @@ -947,10 +947,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- Scan /Table/58/1/"@"/20/0 Scan /Table/58/1/"\x80"/20/0, /Table/58/1/"\xc0"/20/0 -fetched: /child/primary/'ca-central-1'/20/c_p_id -> /20 +fetched: /child/child_pkey/'ca-central-1'/20/c_p_id -> /20 Scan /Table/57/1/"@"/20/0 Scan /Table/57/1/"\x80"/20/0, /Table/57/1/"\xc0"/20/0 -fetched: /parent/primary/'ca-central-1'/20 -> NULL +fetched: /parent/parent_pkey/'ca-central-1'/20 -> NULL output row: [20 20 20] # Left join with locality optimized search enabled. @@ -959,7 +959,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child LEFT JOIN parent ON p_id = ---- · • lookup join (left outer) -│ table: parent@primary +│ table: parent@parent_pkey │ equality cols are key │ lookup condition: (p_id = c_p_id) AND (crdb_region = 'ap-southeast-2') │ remote lookup condition: (p_id = c_p_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) @@ -969,12 +969,12 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child LEFT JOIN parent ON p_id = │ ├── • scan │ missing stats - │ table: child@primary + │ table: child@child_pkey │ spans: [/'ap-southeast-2'/10 - /'ap-southeast-2'/10] │ └── • scan missing stats - table: child@primary + table: child@child_pkey spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykk1Fr2zAQx9_3KY57STM0ItsZFEHAZXVYimd3jscGjSmefbTeHMmTZEgJ-e4jdqFxWLp2e7NO-kk__nfeovlVo8BlEAYfUngL8yT-BDfBt-vwYhHB2eVimS4_h2MYHijuq7qEMJincBUvImhyTdJCHEFzW5Uwg-K2-_j6MUgCKPqawzOI5_NlkIKLDKUqKcrXZFDcoIMZw0argoxRel_adgcW5QYFZ1jJprX7csawUJpQbNFWtiYUmObfa0ooL0lPODIsyeZV3V3befqNrta5fkCGyyaXRsBkhavV5pyvcOLwCYdcluCAsvekkWHcWgG-w3wXsx1D1dqnt43N7wiFs2P_5ue81M9_dHuZj3vS50nDkK7yGlqpdEmayoFJtvuDeKTeqWbiDpXDal1ZcE6q8NdEc6Uq-ZiMN3wmfWhI9BMWf0mDpJszZNhP2kFkoVI_2wZ-qEqCkgLOfA9m4LtjuIgu4cyfwgw2oykfCSF8h3P-fjpGhgmtlSWo_0rv_4LN6PyQZ7AZFYMLx4M2Md87GY_3mngSMo2Sho5adSr4jCGVd9S33ahWF3StVdE90y_jjusKJRnb77r9YiG7rW60D2Hnf2D3WdgbwPwY9p6Fp0dwtnvzOwAA__9DX39d @@ -1007,9 +1007,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY ordinality ASC ---- Scan /Table/58/1/"@"/10/0 -fetched: /child/primary/'ap-southeast-2'/10/c_p_id -> /10 +fetched: /child/child_pkey/'ap-southeast-2'/10/c_p_id -> /10 Scan /Table/57/1/"@"/10/0 -fetched: /parent/primary/'ap-southeast-2'/10 -> NULL +fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> NULL output row: [10 10 10] statement ok @@ -1025,10 +1025,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- Scan /Table/58/1/"@"/20/0 Scan /Table/58/1/"\x80"/20/0, /Table/58/1/"\xc0"/20/0 -fetched: /child/primary/'ca-central-1'/20/c_p_id -> /20 +fetched: /child/child_pkey/'ca-central-1'/20/c_p_id -> /20 Scan /Table/57/1/"@"/20/0 Scan /Table/57/1/"\x80"/20/0, /Table/57/1/"\xc0"/20/0 -fetched: /parent/primary/'ca-central-1'/20 -> NULL +fetched: /parent/parent_pkey/'ca-central-1'/20 -> NULL output row: [20 20 20] query T @@ -1051,7 +1051,7 @@ SELECT * FROM [EXPLAIN INSERT INTO child VALUES (1, 1)] OFFSET 2 │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: child@primary +│ │ table: child@child_pkey │ │ lookup condition: (column1 = c_id) AND (crdb_region = 'ap-southeast-2') │ │ remote lookup condition: (column1 = c_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ │ pred: crdb_region_default != crdb_region @@ -1064,12 +1064,12 @@ SELECT * FROM [EXPLAIN INSERT INTO child VALUES (1, 1)] OFFSET 2 └── • error if rows │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality cols are key │ lookup condition: (column2 = p_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality cols are key │ lookup condition: (column2 = p_id) AND (crdb_region = 'ap-southeast-2') │ @@ -1084,7 +1084,7 @@ SELECT * FROM [EXPLAIN UPSERT INTO child VALUES (1, 1)] OFFSET 2 │ ├── • upsert │ │ into: child(c_id, c_p_id, crdb_region) -│ │ arbiter constraints: primary +│ │ arbiter constraints: child_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -1101,12 +1101,12 @@ SELECT * FROM [EXPLAIN UPSERT INTO child VALUES (1, 1)] OFFSET 2 │ │ │ ├── • scan │ │ missing stats -│ │ table: child@primary +│ │ table: child@child_pkey │ │ spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1] │ └── • constraint-check @@ -1114,12 +1114,12 @@ SELECT * FROM [EXPLAIN UPSERT INTO child VALUES (1, 1)] OFFSET 2 └── • error if rows │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality cols are key │ lookup condition: (column2 = p_id) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality cols are key │ lookup condition: (column2 = p_id) AND (crdb_region = 'ap-southeast-2') │ @@ -1143,12 +1143,12 @@ SELECT * FROM [EXPLAIN DELETE FROM parent WHERE p_id = 1] OFFSET 2 │ │ │ ├── • scan │ │ missing stats -│ │ table: parent@primary +│ │ table: parent@parent_pkey │ │ spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] │ │ │ └── • scan │ missing stats -│ table: parent@primary +│ table: parent@parent_pkey │ spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1] │ └── • constraint-check @@ -1433,7 +1433,7 @@ SELECT * FROM [EXPLAIN INSERT INTO regional_by_row_table (pk, pk2, a, b) VALUES │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: regional_by_row_table@primary +│ │ table: regional_by_row_table@regional_by_row_table_pkey │ │ lookup condition: (column1 = pk) AND (crdb_region = 'ap-southeast-2') │ │ remote lookup condition: (column1 = pk) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ │ pred: crdb_region_default != crdb_region @@ -1500,7 +1500,7 @@ SELECT * FROM [EXPLAIN UPSERT INTO regional_by_row_table (crdb_region, pk, pk2, │ ├── • upsert │ │ into: regional_by_row_table(pk, pk2, a, b, j, crdb_region) -│ │ arbiter constraints: primary +│ │ arbiter constraints: regional_by_row_table_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -1517,12 +1517,12 @@ SELECT * FROM [EXPLAIN UPSERT INTO regional_by_row_table (crdb_region, pk, pk2, │ │ │ ├── • scan │ │ missing stats -│ │ table: regional_by_row_table@primary +│ │ table: regional_by_row_table@regional_by_row_table_pkey │ │ spans: [/'ap-southeast-2'/2 - /'ap-southeast-2'/2] │ │ │ └── • scan │ missing stats -│ table: regional_by_row_table@primary +│ table: regional_by_row_table@regional_by_row_table_pkey │ spans: [/'ca-central-1'/2 - /'ca-central-1'/2] [/'us-east-1'/2 - /'us-east-1'/2] │ ├── • constraint-check @@ -1579,7 +1579,7 @@ VALUES ('us-east-1', 23, 24, 25, 26), ('ca-central-1', 30, 30, 31, 32)] OFFSET 2 │ ├── • upsert │ │ into: regional_by_row_table(pk, pk2, a, b, j, crdb_region) -│ │ arbiter constraints: primary +│ │ arbiter constraints: regional_by_row_table_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -1587,7 +1587,7 @@ VALUES ('us-east-1', 23, 24, 25, 26), ('ca-central-1', 30, 30, 31, 32)] OFFSET 2 │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: regional_by_row_table@primary +│ │ table: regional_by_row_table@regional_by_row_table_pkey │ │ equality cols are key │ │ lookup condition: (column2 = pk) AND (crdb_region = 'ap-southeast-2') │ │ remote lookup condition: (column2 = pk) AND (crdb_region IN ('ca-central-1', 'us-east-1')) @@ -1678,7 +1678,7 @@ CREATE TABLE public.regional_by_row_table ( b INT8 NOT NULL, j JSONB NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_b_key (b ASC), INVERTED INDEX regional_by_row_table_j_idx (j), @@ -1697,14 +1697,14 @@ index_name column_name implicit new_idx a false new_idx b false new_idx crdb_region true -primary crdb_region true -primary pk false regional_by_row_table_a_idx a false regional_by_row_table_a_idx crdb_region true regional_by_row_table_b_key b false regional_by_row_table_b_key crdb_region true regional_by_row_table_j_idx crdb_region true regional_by_row_table_j_idx j false +regional_by_row_table_pkey crdb_region true +regional_by_row_table_pkey pk false uniq_idx a false uniq_idx crdb_region true unique_b_a a false @@ -1776,7 +1776,7 @@ SELECT * FROM [EXPLAIN INSERT INTO regional_by_row_table_as (pk, a, b) VALUES (1 └── • scan buffer label: buffer 1 -statement error pq: duplicate key value violates unique constraint "primary"\nDETAIL: Key \(pk\)=\(1\) already exists\. +statement error pq: duplicate key value violates unique constraint "regional_by_row_table_as_pkey"\nDETAIL: Key \(pk\)=\(1\) already exists\. INSERT INTO regional_by_row_table_as (pk, a, b) VALUES (1, 1, 1) statement ok @@ -1792,7 +1792,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM regional_by_row_table_as WHERE pk = 10] OFF · • scan missing stats - table: regional_by_row_table_as@primary + table: regional_by_row_table_as@regional_by_row_table_as_pkey spans: [/'us-east-1'/10 - /'us-east-1'/10] subtest virtual_columns @@ -1829,7 +1829,7 @@ SELECT * FROM [EXPLAIN INSERT INTO regional_by_row_table_virt (pk, a, b) VALUES │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: regional_by_row_table_virt@primary +│ │ table: regional_by_row_table_virt@regional_by_row_table_virt_pkey │ │ lookup condition: (column1 = pk) AND (crdb_region = 'ap-southeast-2') │ │ remote lookup condition: (column1 = pk) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ │ pred: crdb_region_default != crdb_region @@ -1889,7 +1889,7 @@ SELECT * FROM [EXPLAIN UPSERT INTO regional_by_row_table_virt (pk, a, b) VALUES │ ├── • upsert │ │ into: regional_by_row_table_virt(pk, a, b, v, crdb_region, crdb_internal_idx_expr) -│ │ arbiter constraints: primary +│ │ arbiter constraints: regional_by_row_table_virt_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -1910,12 +1910,12 @@ SELECT * FROM [EXPLAIN UPSERT INTO regional_by_row_table_virt (pk, a, b) VALUES │ │ │ ├── • scan │ │ missing stats -│ │ table: regional_by_row_table_virt@primary +│ │ table: regional_by_row_table_virt@regional_by_row_table_virt_pkey │ │ spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] │ │ │ └── • scan │ missing stats -│ table: regional_by_row_table_virt@primary +│ table: regional_by_row_table_virt@regional_by_row_table_virt_pkey │ spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1] │ ├── • constraint-check @@ -2008,7 +2008,7 @@ SELECT * FROM [EXPLAIN INSERT INTO regional_by_row_table_virt_partial (pk, a, b) │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: regional_by_row_table_virt_partial@primary +│ │ table: regional_by_row_table_virt_partial@regional_by_row_table_virt_partial_pkey │ │ lookup condition: (column1 = pk) AND (crdb_region = 'ap-southeast-2') │ │ remote lookup condition: (column1 = pk) AND (crdb_region IN ('ca-central-1', 'us-east-1')) │ │ pred: crdb_region_default != crdb_region @@ -2099,7 +2099,7 @@ SELECT * FROM [EXPLAIN UPSERT INTO regional_by_row_table_virt_partial (pk, a, b) │ ├── • upsert │ │ into: regional_by_row_table_virt_partial(pk, a, b, v, crdb_region, crdb_internal_idx_expr) -│ │ arbiter constraints: primary +│ │ arbiter constraints: regional_by_row_table_virt_partial_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -2120,12 +2120,12 @@ SELECT * FROM [EXPLAIN UPSERT INTO regional_by_row_table_virt_partial (pk, a, b) │ │ │ ├── • scan │ │ missing stats -│ │ table: regional_by_row_table_virt_partial@primary +│ │ table: regional_by_row_table_virt_partial@regional_by_row_table_virt_partial_pkey │ │ spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] │ │ │ └── • scan │ missing stats -│ table: regional_by_row_table_virt_partial@primary +│ table: regional_by_row_table_virt_partial@regional_by_row_table_virt_partial_pkey │ spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1] │ ├── • constraint-check diff --git a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_rename_column b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_rename_column index 2b2e23d40efd..4973c288d9dd 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_rename_column +++ b/pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_rename_column @@ -87,7 +87,7 @@ CREATE TABLE public.regional_by_row_table_as ( a INT8 NULL, b INT8 NULL, cr public.crdb_internal_region NOT NULL AS (CASE WHEN pk <= 10:::INT8 THEN 'us-east-1':::public.crdb_internal_region ELSE 'ap-southeast-2':::public.crdb_internal_region END) STORED, - CONSTRAINT "primary" PRIMARY KEY (pk ASC), + CONSTRAINT regional_by_row_table_as_pkey PRIMARY KEY (pk ASC), INDEX regional_by_row_table_as_a_idx (a ASC), UNIQUE INDEX regional_by_row_table_as_b_key (b ASC), FAMILY fam_0_pk_a_b_crdb_region_col (pk, a, b, cr) diff --git a/pkg/ccl/logictestccl/testdata/logic_test/zone b/pkg/ccl/logictestccl/testdata/logic_test/zone index 8266c148c80a..82747cf50328 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/zone +++ b/pkg/ccl/logictestccl/testdata/logic_test/zone @@ -44,7 +44,7 @@ TABLE t ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_k_v (k, v) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── k int not null │ └── ZONE │ └── constraints: [+region=test,+dc=dc2] @@ -91,7 +91,7 @@ TABLE t ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_k_v (k, v) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── k int not null │ └── ZONE │ └── constraints: [+region=test,+dc=dc2] @@ -148,7 +148,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/10 - /10] query T retry @@ -160,7 +160,7 @@ TABLE t ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_k_v (k, v) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── k int not null │ └── ZONE │ └── constraints: [+region=test,+dc=dc1] @@ -192,7 +192,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/10 - /10] statement ok @@ -272,7 +272,7 @@ TABLE t ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_k_v (k, v) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── k int not null │ └── ZONE │ ├── constraints: [+region=test] @@ -329,7 +329,7 @@ TABLE t ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_k_v (k, v) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── k int not null │ └── ZONE │ ├── constraints: [+region=test] @@ -379,7 +379,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/10 - /10] statement ok @@ -440,7 +440,7 @@ TABLE t ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_k_v (k, v) - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX t_pkey │ ├── k int not null │ └── ZONE │ ├── constraints: [+region=test] @@ -592,34 +592,34 @@ CREATE INDEX "my index" ON "my table" (x) PARTITION BY LIST (x) ( ALTER DATABASE "my database" CONFIGURE ZONE USING num_replicas = 1; ALTER TABLE "my table" CONFIGURE ZONE USING num_replicas = 1; ALTER INDEX "my table"@"my index" CONFIGURE ZONE USING num_replicas = 1; -ALTER PARTITION "my partition" OF INDEX "my table"@primary CONFIGURE ZONE USING num_replicas = 1; +ALTER PARTITION "my partition" OF INDEX "my table"@"my table_pkey" CONFIGURE ZONE USING num_replicas = 1; ALTER PARTITION "my partition" OF INDEX "my table"@"my index" CONFIGURE ZONE USING num_replicas = 1 query TTTTTT SELECT target, range_name, database_name, table_name, index_name, partition_name FROM crdb_internal.zones ---- -RANGE default default NULL NULL NULL NULL -DATABASE system NULL system NULL NULL NULL -RANGE meta meta NULL NULL NULL NULL -RANGE system system NULL NULL NULL NULL -RANGE liveness liveness NULL NULL NULL NULL -TABLE system.public.replication_constraint_stats NULL system replication_constraint_stats NULL NULL -TABLE system.public.replication_stats NULL system replication_stats NULL NULL -TABLE system.public.tenant_usage NULL system tenant_usage NULL NULL -TABLE test.public.t NULL test t NULL NULL -INDEX test.public.t@secondary NULL test t secondary NULL -INDEX test.public.t@tertiary NULL test t tertiary NULL -INDEX test.public.t36642@secondary NULL test t36642 secondary NULL -INDEX test.public.t36642@tertiary NULL test t36642 tertiary NULL -INDEX test.public.t36644@secondary NULL test t36644 secondary NULL -INDEX test.public.t36644@tertiary NULL test t36644 tertiary NULL -PARTITION x1_idx OF INDEX test.public.t38391@foo NULL test t38391 foo x1_idx -DATABASE "my database" NULL my database NULL NULL NULL -TABLE "my database".public."my table" NULL my database my table NULL NULL -INDEX "my database".public."my table"@"my index" NULL my database my table my index NULL -PARTITION "my partition" OF INDEX "my database".public."my table"@primary NULL my database my table primary my partition -PARTITION "my partition" OF INDEX "my database".public."my table"@"my index" NULL my database my table my index my partition +RANGE default default NULL NULL NULL NULL +DATABASE system NULL system NULL NULL NULL +RANGE meta meta NULL NULL NULL NULL +RANGE system system NULL NULL NULL NULL +RANGE liveness liveness NULL NULL NULL NULL +TABLE system.public.replication_constraint_stats NULL system replication_constraint_stats NULL NULL +TABLE system.public.replication_stats NULL system replication_stats NULL NULL +TABLE system.public.tenant_usage NULL system tenant_usage NULL NULL +TABLE test.public.t NULL test t NULL NULL +INDEX test.public.t@secondary NULL test t secondary NULL +INDEX test.public.t@tertiary NULL test t tertiary NULL +INDEX test.public.t36642@secondary NULL test t36642 secondary NULL +INDEX test.public.t36642@tertiary NULL test t36642 tertiary NULL +INDEX test.public.t36644@secondary NULL test t36644 secondary NULL +INDEX test.public.t36644@tertiary NULL test t36644 tertiary NULL +PARTITION x1_idx OF INDEX test.public.t38391@foo NULL test t38391 foo x1_idx +DATABASE "my database" NULL my database NULL NULL NULL +TABLE "my database".public."my table" NULL my database my table NULL NULL +INDEX "my database".public."my table"@"my index" NULL my database my table my index NULL +PARTITION "my partition" OF INDEX "my database".public."my table"@"my table_pkey" NULL my database my table my table_pkey my partition +PARTITION "my partition" OF INDEX "my database".public."my table"@"my index" NULL my database my table my index my partition # Test the zone information being displayed in SHOW CREATE statement ok @@ -639,15 +639,15 @@ SHOW CREATE TABLE show_test ---- show_test CREATE TABLE public.show_test ( x INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT show_test_pkey PRIMARY KEY (x ASC), FAMILY "primary" (x) ) PARTITION BY LIST (x) ( PARTITION p1 VALUES IN ((1)), PARTITION p2 VALUES IN ((2)) ); -ALTER PARTITION p1 OF INDEX "my database".public.show_test@primary CONFIGURE ZONE USING +ALTER PARTITION p1 OF INDEX "my database".public.show_test@show_test_pkey CONFIGURE ZONE USING constraints = '[+dc=dc1]'; -ALTER PARTITION p2 OF INDEX "my database".public.show_test@primary CONFIGURE ZONE USING +ALTER PARTITION p2 OF INDEX "my database".public.show_test@show_test_pkey CONFIGURE ZONE USING constraints = '[+dc=dc2]' # test warnings on table creation @@ -662,7 +662,7 @@ SHOW CREATE warning ---- warning CREATE TABLE public.warning ( x INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT warning_pkey PRIMARY KEY (x ASC), FAMILY "primary" (x) ) PARTITION BY LIST (x) ( PARTITION p1 VALUES IN ((1)) @@ -700,7 +700,7 @@ ALTER PARTITION p1 OF INDEX t2 CONFIGURE ZONE USING num_replicas = 1 query TT SELECT * FROM [SHOW ALL ZONE CONFIGURATIONS] WHERE target LIKE '%t2@%' ---- -PARTITION p1 OF INDEX "my database".public.t2@primary ALTER PARTITION p1 OF INDEX "my database".public.t2@primary CONFIGURE ZONE USING +PARTITION p1 OF INDEX "my database".public.t2@t2_pkey ALTER PARTITION p1 OF INDEX "my database".public.t2@t2_pkey CONFIGURE ZONE USING num_replicas = 1 PARTITION p1 OF INDEX "my database".public.t2@x1 ALTER PARTITION p1 OF INDEX "my database".public.t2@x1 CONFIGURE ZONE USING num_replicas = 1 @@ -741,12 +741,12 @@ SHOW CREATE TABLE t40417 ---- t40417 CREATE TABLE public.t40417 ( x INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t40417_pkey PRIMARY KEY (x ASC), FAMILY "primary" (x) ) PARTITION BY LIST (x) ( PARTITION p1 VALUES IN ((1)) ); -ALTER PARTITION p1 OF INDEX "my database".public.t40417@primary CONFIGURE ZONE USING +ALTER PARTITION p1 OF INDEX "my database".public.t40417@t40417_pkey CONFIGURE ZONE USING num_replicas = 1 subtest authorization @@ -877,12 +877,12 @@ statement ok ALTER TABLE system.jobs CONFIGURE ZONE USING num_replicas = 3 # Test that index configurations don't infect partition configurations. -# Specifically we are testing that values written to infect@primary's -# zone configuration does not appear in partition p1 of infect@primary's zone config. +# Specifically we are testing that values written to infect@infect_pkey's +# zone configuration does not appear in partition p1 of infect@infect_pkey's zone config. statement ok CREATE TABLE infect (x INT PRIMARY KEY); ALTER TABLE infect PARTITION BY LIST (x) ( PARTITION p1 VALUES IN (1)); -ALTER INDEX infect@primary CONFIGURE ZONE USING num_replicas=5; +ALTER INDEX infect@infect_pkey CONFIGURE ZONE USING num_replicas=5; ALTER PARTITION p1 OF TABLE infect CONFIGURE ZONE USING constraints='[+dc=dc1]' query TT @@ -993,8 +993,6 @@ query TTTT SELECT table_name, index_name, partition_name, raw_config_sql FROM crdb_internal.zones WHERE table_name = 'copy_from_parent' AND index_name = 'primary' AND partition_name = 'p1' ---- -copy_from_parent primary p1 ALTER PARTITION p1 OF INDEX test.public.copy_from_parent@primary CONFIGURE ZONE USING - num_replicas = 3 statement ok ALTER PARTITION p1 OF TABLE copy_from_parent CONFIGURE ZONE USING num_replicas = COPY FROM PARENT @@ -1003,43 +1001,35 @@ query TTTT SELECT table_name, index_name, partition_name, raw_config_sql FROM crdb_internal.zones WHERE table_name = 'copy_from_parent' AND index_name = 'primary' AND partition_name = 'p1' ---- -copy_from_parent primary p1 ALTER PARTITION p1 OF INDEX test.public.copy_from_parent@primary CONFIGURE ZONE USING - num_replicas = 6 statement ok -ALTER INDEX copy_from_parent@primary CONFIGURE ZONE USING num_replicas = 5 +ALTER INDEX copy_from_parent@copy_from_parent_pkey CONFIGURE ZONE USING num_replicas = 5 query TTTT SELECT table_name, index_name, partition_name, raw_config_sql FROM crdb_internal.zones WHERE table_name = 'copy_from_parent' AND index_name = 'primary' AND partition_name IS NULL ---- -copy_from_parent primary NULL ALTER INDEX test.public.copy_from_parent@primary CONFIGURE ZONE USING - num_replicas = 5 # Test that an index can inherit from its parent. statement ok -ALTER INDEX copy_from_parent@primary CONFIGURE ZONE USING num_replicas = COPY FROM PARENT +ALTER INDEX copy_from_parent@copy_from_parent_pkey CONFIGURE ZONE USING num_replicas = COPY FROM PARENT query TTTT SELECT table_name, index_name, partition_name, raw_config_sql FROM crdb_internal.zones WHERE table_name = 'copy_from_parent' AND index_name = 'primary' AND partition_name IS NULL ---- -copy_from_parent primary NULL ALTER INDEX test.public.copy_from_parent@primary CONFIGURE ZONE USING - num_replicas = 6 # Test that a partition can inherit from its parent index configuration. # First change the index's field value. statement ok -ALTER INDEX copy_from_parent@primary CONFIGURE ZONE USING num_replicas = 9 +ALTER INDEX copy_from_parent@copy_from_parent_pkey CONFIGURE ZONE USING num_replicas = 9 query TTTT SELECT table_name, index_name, partition_name, raw_config_sql FROM crdb_internal.zones WHERE table_name = 'copy_from_parent' AND index_name = 'primary' AND partition_name IS NULL ---- -copy_from_parent primary NULL ALTER INDEX test.public.copy_from_parent@primary CONFIGURE ZONE USING - num_replicas = 9 statement ok ALTER PARTITION p1 OF TABLE copy_from_parent CONFIGURE ZONE USING num_replicas = COPY FROM PARENT @@ -1048,8 +1038,6 @@ query TTTT SELECT table_name, index_name, partition_name, raw_config_sql FROM crdb_internal.zones WHERE table_name = 'copy_from_parent' AND index_name = 'primary' AND partition_name = 'p1' ---- -copy_from_parent primary p1 ALTER PARTITION p1 OF INDEX test.public.copy_from_parent@primary CONFIGURE ZONE USING - num_replicas = 9 # check that copy from parent on a subzone doesn't accidentally modify the parent zone. statement ok @@ -1107,7 +1095,7 @@ t CREATE TABLE public.t ( y INT8 NOT NULL, z INT8 NULL, w INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT t_pkey PRIMARY KEY (y ASC), UNIQUE INDEX t_x_key (x ASC), INDEX i1 (z ASC) PARTITION BY LIST (z) ( PARTITION p1 VALUES IN ((1), (2)), diff --git a/pkg/ccl/multiregionccl/region_test.go b/pkg/ccl/multiregionccl/region_test.go index 00a343663b0c..1be1a19a0e28 100644 --- a/pkg/ccl/multiregionccl/region_test.go +++ b/pkg/ccl/multiregionccl/region_test.go @@ -245,7 +245,7 @@ func TestRegionAddDropEnclosingRegionalByRowOps(t *testing.T) { { name: "create-rbr-table", op: `DROP TABLE IF EXISTS db.rbr; CREATE TABLE db.rbr() LOCALITY REGIONAL BY ROW`, - expectedIndexes: []string{"rbr@primary"}, + expectedIndexes: []string{"rbr@rbr_pkey"}, }, } @@ -982,7 +982,7 @@ INSERT INTO db.rbr VALUES (1,1),(2,2),(3,3); sqlDBRestore, "db", "rbr", - []string{"rbr@primary"}, + []string{"rbr@rbr_pkey"}, ) }) }) diff --git a/pkg/ccl/multiregionccl/show_test.go b/pkg/ccl/multiregionccl/show_test.go index 23e426dcb293..e0bd613d18fd 100644 --- a/pkg/ccl/multiregionccl/show_test.go +++ b/pkg/ccl/multiregionccl/show_test.go @@ -28,10 +28,10 @@ func TestShowCreateTable(t *testing.T) { CreateStatement: `CREATE TABLE %s ( a INT ) LOCALITY GLOBAL`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY GLOBAL`, Database: "mrdb", @@ -41,10 +41,10 @@ func TestShowCreateTable(t *testing.T) { CreateStatement: `CREATE TABLE %s ( a INT ) LOCALITY REGIONAL BY TABLE`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY REGIONAL BY TABLE IN PRIMARY REGION`, Database: "mrdb", @@ -53,10 +53,10 @@ func TestShowCreateTable(t *testing.T) { CreateStatement: `CREATE TABLE %s ( a INT ) LOCALITY REGIONAL BY TABLE IN "us-west1"`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) LOCALITY REGIONAL BY TABLE IN "us-west1"`, Database: "mrdb", @@ -71,7 +71,7 @@ func TestShowCreateTable(t *testing.T) { a INT8 NULL, crdb_region public.crdb_internal_region NOT VISIBLE NOT NULL DEFAULT default_to_database_primary_region(gateway_region())::public.crdb_internal_region, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), INDEX a_idx (a ASC), FAMILY "primary" (a, crdb_region, rowid) ) LOCALITY REGIONAL BY ROW`, @@ -87,7 +87,7 @@ func TestShowCreateTable(t *testing.T) { a INT8 NULL, crdb_region_col public.crdb_internal_region NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), INDEX a_idx (a ASC), FAMILY "primary" (a, crdb_region_col, rowid) ) LOCALITY REGIONAL BY ROW AS crdb_region_col`, @@ -103,7 +103,7 @@ func TestShowCreateTable(t *testing.T) { a INT8 NULL, crdb_region_col public.crdb_internal_region NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), INDEX a_idx (a ASC) WHERE a > 0:::INT8, FAMILY "primary" (a, crdb_region_col, rowid) ) LOCALITY REGIONAL BY ROW AS crdb_region_col`, diff --git a/pkg/ccl/partitionccl/drop_test.go b/pkg/ccl/partitionccl/drop_test.go index 87b975a5167f..3805547c9d92 100644 --- a/pkg/ccl/partitionccl/drop_test.go +++ b/pkg/ccl/partitionccl/drop_test.go @@ -83,7 +83,7 @@ func TestDropIndexWithZoneConfigCCL(t *testing.T) { // Set zone configs on the primary index, secondary index, and one partition // of the secondary index. ttlYaml := "gc: {ttlseconds: 1}" - sqlutils.SetZoneConfig(t, sqlDB, "INDEX t.kv@primary", "") + sqlutils.SetZoneConfig(t, sqlDB, "INDEX t.kv@kv_pkey", "") sqlutils.SetZoneConfig(t, sqlDB, "INDEX t.kv@i", ttlYaml) sqlutils.SetZoneConfig(t, sqlDB, "PARTITION p2 OF INDEX t.kv@i", ttlYaml) diff --git a/pkg/ccl/partitionccl/partition_test.go b/pkg/ccl/partitionccl/partition_test.go index 66d5450becc2..191a9099cc71 100644 --- a/pkg/ccl/partitionccl/partition_test.go +++ b/pkg/ccl/partitionccl/partition_test.go @@ -1504,7 +1504,7 @@ func TestRemovePartitioningExpiredLicense(t *testing.T) { )`) sqlDB.Exec(t, `ALTER PARTITION p1 OF TABLE t CONFIGURE ZONE USING DEFAULT`) sqlDB.Exec(t, `ALTER PARTITION p34 OF INDEX t@i CONFIGURE ZONE USING DEFAULT`) - sqlDB.Exec(t, `ALTER INDEX t@primary CONFIGURE ZONE USING DEFAULT`) + sqlDB.Exec(t, `ALTER INDEX t@t_pkey CONFIGURE ZONE USING DEFAULT`) sqlDB.Exec(t, `ALTER INDEX t@i CONFIGURE ZONE USING DEFAULT`) // Remove the enterprise license. @@ -1522,18 +1522,18 @@ func TestRemovePartitioningExpiredLicense(t *testing.T) { expectErr(`ALTER INDEX t@i PARTITION BY RANGE (a) (PARTITION p45 VALUES FROM (4) TO (5))`, partitionErr) expectErr(`ALTER PARTITION p1 OF TABLE t CONFIGURE ZONE USING DEFAULT`, zoneErr) expectErr(`ALTER PARTITION p34 OF INDEX t@i CONFIGURE ZONE USING DEFAULT`, zoneErr) - expectErr(`ALTER INDEX t@primary CONFIGURE ZONE USING DEFAULT`, zoneErr) + expectErr(`ALTER INDEX t@t_pkey CONFIGURE ZONE USING DEFAULT`, zoneErr) expectErr(`ALTER INDEX t@i CONFIGURE ZONE USING DEFAULT`, zoneErr) // But they can be removed. sqlDB.Exec(t, `ALTER TABLE t PARTITION BY NOTHING`) sqlDB.Exec(t, `ALTER INDEX t@i PARTITION BY NOTHING`) - sqlDB.Exec(t, `ALTER INDEX t@primary CONFIGURE ZONE DISCARD`) + sqlDB.Exec(t, `ALTER INDEX t@t_pkey CONFIGURE ZONE DISCARD`) sqlDB.Exec(t, `ALTER INDEX t@i CONFIGURE ZONE DISCARD`) // Once removed, they cannot be added back. expectErr(`ALTER TABLE t PARTITION BY LIST (a) (PARTITION p2 VALUES IN (2))`, partitionErr) expectErr(`ALTER INDEX t@i PARTITION BY RANGE (a) (PARTITION p45 VALUES FROM (4) TO (5))`, partitionErr) - expectErr(`ALTER INDEX t@primary CONFIGURE ZONE USING DEFAULT`, zoneErr) + expectErr(`ALTER INDEX t@t_pkey CONFIGURE ZONE USING DEFAULT`, zoneErr) expectErr(`ALTER INDEX t@i CONFIGURE ZONE USING DEFAULT`, zoneErr) } diff --git a/pkg/ccl/partitionccl/zone_test.go b/pkg/ccl/partitionccl/zone_test.go index dc64dccc3389..73768a5134bb 100644 --- a/pkg/ccl/partitionccl/zone_test.go +++ b/pkg/ccl/partitionccl/zone_test.go @@ -117,7 +117,7 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "RANGE default", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", defaultRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", defaultRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", defaultRow) @@ -127,7 +127,7 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultRow, partialDbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", dbRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", dbRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", dbRow) @@ -137,17 +137,17 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultRow, partialDbRow, partialTableRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", tableRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", tableRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", tableRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", tableRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", tableRow) // Ensure an index zone config applies to that index and its partitions, but // no other zones. - sqlutils.SetZoneConfig(t, sqlDB, "INDEX d.t@primary", yamlOverride) + sqlutils.SetZoneConfig(t, sqlDB, "INDEX d.t@t_pkey", yamlOverride) sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultRow, partialDbRow, partialTableRow, partialPrimaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", tableRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", primaryRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", primaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", primaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", primaryRow) @@ -157,7 +157,7 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultRow, partialDbRow, partialTableRow, partialPrimaryRow, partialP0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", tableRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", primaryRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", primaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", p0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", primaryRow) @@ -167,7 +167,7 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultOverrideRow, partialDbRow, partialTableRow, partialPrimaryRow, partialP0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", dbRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", tableRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", primaryRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", primaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", p0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", primaryRow) @@ -176,7 +176,7 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultOverrideRow, partialTableRow, partialPrimaryRow, partialP0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", defaultOverrideRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", tableRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", primaryRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", primaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", p0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", primaryRow) @@ -184,14 +184,14 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.DeleteZoneConfig(t, sqlDB, "TABLE d.t") sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultOverrideRow, partialPrimaryRow, partialP0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", defaultOverrideRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", primaryRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", primaryRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", p0Row) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", primaryRow) // Ensure deleting an index zone leaves child overrides in place. - sqlutils.DeleteZoneConfig(t, sqlDB, "INDEX d.t@primary") + sqlutils.DeleteZoneConfig(t, sqlDB, "INDEX d.t@t_pkey") sqlutils.VerifyAllZoneConfigs(t, sqlDB, defaultOverrideRow, partialP0Row) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", defaultOverrideRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", defaultOverrideRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", p0Row) // Ensure deleting a partition zone works. @@ -211,7 +211,7 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "RANGE default", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "DATABASE d", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "TABLE d.t", defaultRow) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@primary", defaultRow) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "INDEX d.t@t_pkey", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p0 OF TABLE d.t", defaultRow) sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", defaultRow) @@ -224,8 +224,8 @@ func TestValidIndexPartitionSetShowZones(t *testing.T) { sqlutils.VerifyZoneConfigForTarget(t, sqlDB, "PARTITION p1 OF TABLE d.t", p1Row) // Ensure the shorthand index syntax works. - sqlutils.SetZoneConfig(t, sqlDB, `INDEX "primary"`, yamlOverride) - sqlutils.VerifyZoneConfigForTarget(t, sqlDB, `INDEX "primary"`, primaryRow) + sqlutils.SetZoneConfig(t, sqlDB, `INDEX "t_pkey"`, yamlOverride) + sqlutils.VerifyZoneConfigForTarget(t, sqlDB, `INDEX "t_pkey"`, primaryRow) // Ensure the session database is respected. sqlutils.SetZoneConfig(t, sqlDB, "PARTITION p0 OF TABLE t", yamlOverride) diff --git a/pkg/ccl/serverccl/admin_test.go b/pkg/ccl/serverccl/admin_test.go index 576c09a0fb6e..a0e3e063caed 100644 --- a/pkg/ccl/serverccl/admin_test.go +++ b/pkg/ccl/serverccl/admin_test.go @@ -59,8 +59,8 @@ func TestAdminAPIDataDistributionPartitioning(t *testing.T) { // Assert that we get all roachblog zone configs back. expectedZoneConfigNames := map[string]struct{}{ - "PARTITION eu OF INDEX roachblog.public.comments@primary": {}, - "PARTITION us OF INDEX roachblog.public.comments@primary": {}, + "PARTITION eu OF INDEX roachblog.public.comments@comments_pkey": {}, + "PARTITION us OF INDEX roachblog.public.comments@comments_pkey": {}, } var resp serverpb.DataDistributionResponse diff --git a/pkg/cli/clisqlexec/run_query_test.go b/pkg/cli/clisqlexec/run_query_test.go index 0ae78c47df8a..8c0218ee6be4 100644 --- a/pkg/cli/clisqlexec/run_query_test.go +++ b/pkg/cli/clisqlexec/run_query_test.go @@ -214,8 +214,8 @@ ALTER TABLE test_utf.żółw ADD CONSTRAINT żó UNIQUE (value)`)); err != nil { expected = ` table_name | constraint_name -------------+------------------ - żółw | primary żółw | żó + żółw | żółw_pkey (2 rows) ` if a, e := b.String(), expected[1:]; a != e { diff --git a/pkg/cli/clisqlshell/sql_test.go b/pkg/cli/clisqlshell/sql_test.go index 631317095062..6fb3af5c659f 100644 --- a/pkg/cli/clisqlshell/sql_test.go +++ b/pkg/cli/clisqlshell/sql_test.go @@ -223,7 +223,7 @@ func Example_misc_table() { // │ // └── • scan // missing stats - // table: t@primary + // table: t@t_pkey // spans: FULL SCAN // (9 rows) } diff --git a/pkg/server/admin_test.go b/pkg/server/admin_test.go index 8e22cda1a84c..fe964f04aa64 100644 --- a/pkg/server/admin_test.go +++ b/pkg/server/admin_test.go @@ -631,12 +631,12 @@ func TestAdminAPITableDetails(t *testing.T) { defer log.Scope(t).Close(t) for _, tc := range []struct { - name, dbName, tblName string + name, dbName, tblName, pkName string }{ - {name: "lower", dbName: "test", tblName: "tbl"}, - {name: "lower", dbName: "test", tblName: `testschema.tbl`}, - {name: "lower with space", dbName: "test test", tblName: `"tbl tbl"`}, - {name: "upper", dbName: "TEST", tblName: `"TBL"`}, // Regression test for issue #14056 + {name: "lower", dbName: "test", tblName: "tbl", pkName: "tbl_pkey"}, + {name: "lower", dbName: "test", tblName: `testschema.tbl`, pkName: "tbl_pkey"}, + {name: "lower with space", dbName: "test test", tblName: `"tbl tbl"`, pkName: "tbl tbl_pkey"}, + {name: "upper", dbName: "TEST", tblName: `"TBL"`, pkName: "TBL_pkey"}, // Regression test for issue #14056 } { t.Run(tc.name, func(t *testing.T) { s, _, _ := serverutils.StartServer(t, base.TestServerArgs{}) @@ -733,11 +733,11 @@ func TestAdminAPITableDetails(t *testing.T) { // Verify indexes. expIndexes := []serverpb.TableDetailsResponse_Index{ - {Name: "primary", Column: "string_default", Direction: "N/A", Unique: true, Seq: 5, Storing: true}, - {Name: "primary", Column: "default2", Direction: "N/A", Unique: true, Seq: 4, Storing: true}, - {Name: "primary", Column: "nulls_not_allowed", Direction: "N/A", Unique: true, Seq: 3, Storing: true}, - {Name: "primary", Column: "nulls_allowed", Direction: "N/A", Unique: true, Seq: 2, Storing: true}, - {Name: "primary", Column: "rowid", Direction: "ASC", Unique: true, Seq: 1}, + {Name: tc.pkName, Column: "string_default", Direction: "N/A", Unique: true, Seq: 5, Storing: true}, + {Name: tc.pkName, Column: "default2", Direction: "N/A", Unique: true, Seq: 4, Storing: true}, + {Name: tc.pkName, Column: "nulls_not_allowed", Direction: "N/A", Unique: true, Seq: 3, Storing: true}, + {Name: tc.pkName, Column: "nulls_allowed", Direction: "N/A", Unique: true, Seq: 2, Storing: true}, + {Name: tc.pkName, Column: "rowid", Direction: "ASC", Unique: true, Seq: 1}, {Name: "descidx", Column: "rowid", Direction: "ASC", Unique: false, Seq: 2, Implicit: true}, {Name: "descidx", Column: "default2", Direction: "DESC", Unique: false, Seq: 1}, } diff --git a/pkg/sql/alter_column_type_test.go b/pkg/sql/alter_column_type_test.go index 003e089c8384..78d70a03f510 100644 --- a/pkg/sql/alter_column_type_test.go +++ b/pkg/sql/alter_column_type_test.go @@ -230,7 +230,7 @@ INSERT INTO t.test VALUES (1), (2), (3); `CREATE TABLE public.test ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT test_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) )`}} @@ -244,7 +244,7 @@ INSERT INTO t.test VALUES (1), (2), (3); `CREATE TABLE public.test ( x STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT test_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) )`}} diff --git a/pkg/sql/comment_on_constraint_test.go b/pkg/sql/comment_on_constraint_test.go index 84da71768e35..e06653dc6ae6 100644 --- a/pkg/sql/comment_on_constraint_test.go +++ b/pkg/sql/comment_on_constraint_test.go @@ -64,8 +64,8 @@ func TestCommentOnConstraint(t *testing.T) { gosql.NullString{String: `primary_userdef_comment`, Valid: true}, }, { - `COMMENT ON CONSTRAINT "primary" ON t2 IS 'primary_comment'`, - `SELECT obj_description(oid, 'pg_constraint') FROM pg_constraint WHERE conname='primary'`, + `COMMENT ON CONSTRAINT "t2_pkey" ON t2 IS 'primary_comment'`, + `SELECT obj_description(oid, 'pg_constraint') FROM pg_constraint WHERE conname='t2_pkey'`, gosql.NullString{String: `primary_comment`, Valid: true}, }, { @@ -81,17 +81,19 @@ func TestCommentOnConstraint(t *testing.T) { } for _, tc := range testCases { - if _, err := db.Exec(tc.exec); err != nil { - t.Fatal(err) - } + t.Run(tc.exec, func(t *testing.T) { + if _, err := db.Exec(tc.exec); err != nil { + t.Fatal(err) + } - row := db.QueryRow(tc.query) - var comment gosql.NullString - if err := row.Scan(&comment); err != nil { - t.Fatal(err) - } - if tc.expect != comment { - t.Fatalf("expected comment %v, got %v", tc.expect, comment) - } + row := db.QueryRow(tc.query) + var comment gosql.NullString + if err := row.Scan(&comment); err != nil { + t.Fatal(err) + } + if tc.expect != comment { + t.Fatalf("expected comment %v, got %v", tc.expect, comment) + } + }) } } diff --git a/pkg/sql/descriptor_mutation_test.go b/pkg/sql/descriptor_mutation_test.go index 3253228d2b33..8638125374c7 100644 --- a/pkg/sql/descriptor_mutation_test.go +++ b/pkg/sql/descriptor_mutation_test.go @@ -1033,9 +1033,9 @@ CREATE TABLE t.test (a STRING PRIMARY KEY, b STRING, c STRING, INDEX foo (c)); mt.CheckQueryResults(t, "SHOW INDEXES FROM t.test", [][]string{ - {"test", "primary", "false", "1", "a", "ASC", "false", "false"}, - {"test", "primary", "false", "2", "b", "N/A", "true", "false"}, - {"test", "primary", "false", "3", "d", "N/A", "true", "false"}, + {"test", "test_pkey", "false", "1", "a", "ASC", "false", "false"}, + {"test", "test_pkey", "false", "2", "b", "N/A", "true", "false"}, + {"test", "test_pkey", "false", "3", "d", "N/A", "true", "false"}, {"test", "ufo", "true", "1", "d", "ASC", "false", "false"}, {"test", "ufo", "true", "2", "a", "ASC", "false", "true"}, }, @@ -1060,9 +1060,9 @@ CREATE TABLE t.test (a STRING PRIMARY KEY, b STRING, c STRING, INDEX foo (c)); mt.CheckQueryResults(t, "SHOW COLUMNS FROM t.test", [][]string{ - {"a", "STRING", "false", "NULL", "", "{primary,ufo}", "false"}, - {"e", "STRING", "true", "NULL", "", "{primary}", "false"}, - {"d", "STRING", "true", "NULL", "", "{primary,ufo}", "false"}, + {"a", "STRING", "false", "NULL", "", "{test_pkey,ufo}", "false"}, + {"e", "STRING", "true", "NULL", "", "{test_pkey}", "false"}, + {"d", "STRING", "true", "NULL", "", "{test_pkey,ufo}", "false"}, }, ) diff --git a/pkg/sql/logictest/testdata/logic_test/aggregate b/pkg/sql/logictest/testdata/logic_test/aggregate index 681d5a22e887..4fad0229c977 100644 --- a/pkg/sql/logictest/testdata/logic_test/aggregate +++ b/pkg/sql/logictest/testdata/logic_test/aggregate @@ -1159,7 +1159,7 @@ SELECT min(v) FROM opt_test # Cross-check against a query without this optimization. query I -SELECT min(v) FROM opt_test@primary +SELECT min(v) FROM opt_test@opt_test_pkey ---- 5 diff --git a/pkg/sql/logictest/testdata/logic_test/alias_types b/pkg/sql/logictest/testdata/logic_test/alias_types index 2fbb0c6abae2..a85ef635d85a 100644 --- a/pkg/sql/logictest/testdata/logic_test/alias_types +++ b/pkg/sql/logictest/testdata/logic_test/alias_types @@ -14,7 +14,7 @@ aliases CREATE TABLE public.aliases ( a OID NULL, b NAME NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT aliases_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid), FAMILY fam_1_b (b) ) diff --git a/pkg/sql/logictest/testdata/logic_test/alter_column_type b/pkg/sql/logictest/testdata/logic_test/alter_column_type index cfad19db8249..878b78af6bdc 100644 --- a/pkg/sql/logictest/testdata/logic_test/alter_column_type +++ b/pkg/sql/logictest/testdata/logic_test/alter_column_type @@ -22,12 +22,12 @@ ALTER TABLE t ALTER s TYPE STRING, ALTER sl TYPE STRING(6), ALTER ts TYPE TIMEST query TTBTTTB colnames SHOW COLUMNS FROM t ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -s STRING true NULL · {primary} false -sl STRING(6) true NULL · {primary} false -t TIME true NULL · {primary} false -ts TIMESTAMPTZ true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true +column_name data_type is_nullable column_default generation_expression indices is_hidden +s STRING true NULL · {t_pkey} false +sl STRING(6) true NULL · {t_pkey} false +t TIME true NULL · {t_pkey} false +ts TIMESTAMPTZ true NULL · {t_pkey} false +rowid INT8 false unique_rowid() · {t_pkey} true query TTTT SELECT * FROM t @@ -74,7 +74,7 @@ table_name create_statement t CREATE TABLE public.t ( a INT8 NOT NULL, i INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_pkey PRIMARY KEY (a ASC), INDEX idx2 (i ASC), FAMILY "primary" (a, i) ) @@ -106,9 +106,9 @@ CREATE TABLE t (a INT) query TTBTTTB colnames SHOW COLUMNS FROM t ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 true NULL · {t_pkey} false +rowid INT8 false unique_rowid() · {t_pkey} true statement ok ALTER TABLE t ALTER a TYPE INTEGER @@ -116,9 +116,9 @@ ALTER TABLE t ALTER a TYPE INTEGER query TTBTTTB colnames SHOW COLUMNS FROM t ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 true NULL · {t_pkey} false +rowid INT8 false unique_rowid() · {t_pkey} true statement ok DROP TABLE t @@ -194,8 +194,8 @@ ALTER TABLE t2 ALTER COLUMN id TYPE STRING query TTBTTTB SHOW COLUMNS FROM t2 ---- -id STRING true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true +id STRING true NULL · {t2_pkey} false +rowid INT8 false unique_rowid() · {t2_pkey} true statement ok INSERT INTO t2 VALUES ('5') @@ -214,10 +214,10 @@ ALTER TABLE t3 ALTER COLUMN id2 TYPE string query TTBTTTB SHOW COLUMNS FROM t3 ---- -id INT8 true NULL · {primary} false -id2 STRING true NULL · {primary} false -id3 INT8 true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true +id INT8 true NULL · {t3_pkey} false +id2 STRING true NULL · {t3_pkey} false +id3 INT8 true NULL · {t3_pkey} false +rowid INT8 false unique_rowid() · {t3_pkey} true statement ok INSERT INTO t3 VALUES (4,'4',4) @@ -258,7 +258,7 @@ t6 CREATE TABLE public.t6 ( id INT8 NULL, id2 STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t6_pkey PRIMARY KEY (rowid ASC), FAMILY f1 (id, rowid), FAMILY f2 (id2) ) @@ -294,7 +294,7 @@ SHOW CREATE TABLE t8 t8 CREATE TABLE public.t8 ( x STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t8_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) @@ -381,7 +381,7 @@ table_name create_statement t17 CREATE TABLE public.t17 ( x STRING NULL DEFAULT 'HELLO':::STRING, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t17_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) @@ -454,7 +454,7 @@ table_name create_statement t24 CREATE TABLE public.t24 ( x STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t24_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/alter_primary_key b/pkg/sql/logictest/testdata/logic_test/alter_primary_key index e5a76cca9eaa..ca573a0397f7 100644 --- a/pkg/sql/logictest/testdata/logic_test/alter_primary_key +++ b/pkg/sql/logictest/testdata/logic_test/alter_primary_key @@ -13,7 +13,7 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (y, z) NOTICE: primary key changes are finalized asynchronously; further schema changes on this table may be restricted until the job completes query IIII rowsort -SELECT * FROM t@primary +SELECT * FROM t@t_pkey ---- 1 2 3 4 5 6 7 8 @@ -22,7 +22,7 @@ statement ok INSERT INTO t VALUES (9, 10, 11, 12) query IIII rowsort -SELECT * from t@primary +SELECT * from t@t_pkey ---- 1 2 3 4 5 6 7 8 @@ -32,7 +32,7 @@ statement ok UPDATE t SET x = 2 WHERE z = 7 query IIII rowsort -SELECT * from t@primary +SELECT * from t@t_pkey ---- 1 2 3 4 2 6 7 8 @@ -81,7 +81,7 @@ statement ok ALTER TABLE t_composite ALTER PRIMARY KEY USING COLUMNS (y) query IT rowsort -SELECT * FROM t_composite@primary +SELECT * FROM t_composite@t_composite_pkey ---- 1 1.0 2 1.001 @@ -172,7 +172,7 @@ SHOW CREATE t t CREATE TABLE public.t ( rowid INT8 NOT NULL, y INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT t_pkey PRIMARY KEY (y ASC), UNIQUE INDEX t_rowid_key (rowid ASC), FAMILY fam_0_rowid_y (rowid, y) ) @@ -209,7 +209,7 @@ t CREATE TABLE public.t ( w INT8 NULL, v JSONB NULL, crdb_internal_z_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(z)), 4:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT t_pkey PRIMARY KEY (y ASC), UNIQUE INDEX i3 (z ASC) STORING (y), UNIQUE INDEX t_x_key (x ASC), INDEX i1 (w ASC), @@ -228,15 +228,15 @@ t CREATE TABLE public.t ( query IT SELECT index_id, index_name FROM crdb_internal.table_indexes WHERE descriptor_name = 't' ORDER BY index_id ---- -4 i3 -9 primary -10 t_x_key -11 i1 -12 i2 -13 i4 -14 i5 -15 i6 -16 i7 +4 i3 +9 t_pkey +10 t_x_key +11 i1 +12 i2 +13 i4 +14 i5 +15 i6 +16 i7 # Make sure that each index can index join against the new primary key; @@ -245,7 +245,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM t@i1] OFFSET 2 ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -262,7 +262,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM t@i2] OFFSET 2 ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -279,7 +279,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM t@i3] OFFSET 2 ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -296,7 +296,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM t@i4] OFFSET 2 ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -313,7 +313,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM t@i5] OFFSET 2 ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -330,7 +330,7 @@ SELECT * FROM [EXPLAIN SELECT * FROM t@i7] OFFSET 2 ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -365,7 +365,7 @@ t CREATE TABLE public.t ( z INT8 NULL, crdb_internal_z_shard_5 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(z)), 5:::INT8)) STORED, crdb_internal_y_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(y)), 10:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (y ASC) USING HASH WITH BUCKET_COUNT = 10, + CONSTRAINT t_pkey PRIMARY KEY (y ASC) USING HASH WITH BUCKET_COUNT = 10, UNIQUE INDEX t_x_key (x ASC), INDEX i1 (z ASC) USING HASH WITH BUCKET_COUNT = 5, FAMILY fam_0_x_y_z_crdb_internal_z_shard_5 (x, y, z, crdb_internal_z_shard_5, crdb_internal_y_shard_10), @@ -386,12 +386,12 @@ SELECT * FROM [EXPLAIN INSERT INTO t VALUES (4, 5, 6)] OFFSET 2 query IT SELECT index_id, index_name FROM crdb_internal.table_indexes WHERE descriptor_name = 't' ORDER BY index_id ---- -3 primary -4 t_x_key -5 i1 +3 t_pkey +4 t_x_key +5 i1 query III -SELECT * FROM t@primary +SELECT * FROM t@t_pkey ---- 1 2 3 @@ -426,7 +426,7 @@ t CREATE TABLE public.t ( x INT8 NOT NULL, y INT8 NOT NULL, z INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT t_pkey PRIMARY KEY (y ASC), UNIQUE INDEX t_x_key (x ASC) USING HASH WITH BUCKET_COUNT = 5, INDEX i (z ASC), FAMILY fam_0_x_y_z_crdb_internal_x_shard_5 (x, y, z, crdb_internal_x_shard_5), @@ -454,7 +454,7 @@ SHOW CREATE t t CREATE TABLE public.t ( rowid INT8 NOT NULL, rowid_1 INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid_1 ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid_1 ASC), FAMILY "primary" (rowid, rowid_1) ) @@ -467,7 +467,7 @@ SHOW CREATE t t CREATE TABLE public.t ( rowid INT8 NOT NULL, rowid_1 INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (rowid, rowid_1) ) @@ -539,7 +539,7 @@ SHOW CREATE t t CREATE TABLE public.t ( x INT8 NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t_pkey PRIMARY KEY (x ASC), FAMILY "primary" (x, rowid) ) @@ -555,7 +555,7 @@ t CREATE TABLE public.t ( x INT8 NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), crdb_internal_x_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(x)), 4:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (x ASC) USING HASH WITH BUCKET_COUNT = 4, + CONSTRAINT t_pkey PRIMARY KEY (x ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (x, rowid, crdb_internal_x_shard_4), CONSTRAINT check_crdb_internal_x_shard_4 CHECK (crdb_internal_x_shard_4 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8)) ) @@ -619,16 +619,16 @@ DROP TABLE IF EXISTS t; CREATE TABLE t (x INT PRIMARY KEY, y INT NOT NULL, FAMILY (x), FAMILY (y)) statement error pq: relation "t" \([0-9]+\): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT "t_pkey" statement error pq: multiple primary keys for table "t" are not allowed -ALTER TABLE t ADD CONSTRAINT "primary" PRIMARY KEY (y), DROP CONSTRAINT "primary" +ALTER TABLE t ADD CONSTRAINT "t_pkey" PRIMARY KEY (y), DROP CONSTRAINT "primary" statement error pq: multiple primary keys for table "t" are not allowed -ALTER TABLE t ADD CONSTRAINT "primary" PRIMARY KEY (y) +ALTER TABLE t ADD CONSTRAINT "t_pkey" PRIMARY KEY (y) statement ok -ALTER TABLE t DROP CONSTRAINT "primary", ADD CONSTRAINT "primary" PRIMARY KEY (y) +ALTER TABLE t DROP CONSTRAINT "t_pkey", ADD CONSTRAINT "t_pkey" PRIMARY KEY (y) query TT SHOW CREATE t @@ -636,7 +636,7 @@ SHOW CREATE t t CREATE TABLE public.t ( x INT8 NOT NULL, y INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT t_pkey PRIMARY KEY (y ASC), FAMILY fam_0_x (x), FAMILY fam_1_y (y) ) @@ -651,10 +651,10 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT "t_pkey" statement ok -ALTER TABLE t ADD CONSTRAINT "primary" PRIMARY KEY (y) +ALTER TABLE t ADD CONSTRAINT "t_pkey" PRIMARY KEY (y) statement ok COMMIT @@ -665,7 +665,7 @@ SHOW CREATE t t CREATE TABLE public.t ( x INT8 NOT NULL, y INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT t_pkey PRIMARY KEY (y ASC), FAMILY fam_0_x (x), FAMILY fam_1_y (y) ) @@ -680,7 +680,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 requested table does not have a primary key INSERT INTO t VALUES (1, 1) @@ -692,7 +692,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 pq: requested table does not have a primary key DELETE FROM t WHERE x = 1 @@ -704,7 +704,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 pq: requested table does not have a primary key UPDATE t SET x = 1 WHERE y = 1 @@ -716,7 +716,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 pq: requested table does not have a primary key SELECT * FROM t @@ -731,7 +731,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 pq: requested table does not have a primary key CREATE INDEX ON t(x) @@ -743,7 +743,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 pq: requested table does not have a primary key ALTER TABLE t ADD COLUMN z INT @@ -755,7 +755,7 @@ statement ok BEGIN statement ok -ALTER TABLE t DROP CONSTRAINT "primary" +ALTER TABLE t DROP CONSTRAINT t_pkey statement error pgcode 55C02 pq: requested table does not have a primary key ALTER TABLE t ADD COLUMN z INT, ADD PRIMARY KEY (x) @@ -774,7 +774,7 @@ statement ok BEGIN statement ok -ALTER TABLE t1 DROP CONSTRAINT "primary" +ALTER TABLE t1 DROP CONSTRAINT t1_pkey statement ok INSERT INTO t2 VALUES (1) @@ -791,7 +791,7 @@ DROP TABLE IF EXISTS t; CREATE TABLE t (x INT PRIMARY KEY, y INT NOT NULL) statement error pq: table "t" does not have a primary key, cannot perform ADD COLUMN z INT8 AS \(x \+ 1\) STORED -ALTER TABLE t DROP CONSTRAINT "primary", ADD COLUMN z INT AS (x + 1) STORED, ADD PRIMARY KEY (y) +ALTER TABLE t DROP CONSTRAINT t_pkey, ADD COLUMN z INT AS (x + 1) STORED, ADD PRIMARY KEY (y) subtest create_table_change_pk @@ -818,7 +818,7 @@ t CREATE TABLE public.t ( x INT8 NOT NULL, y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t_pkey PRIMARY KEY (x ASC), INDEX t_y_idx (y ASC), FAMILY fam_0_x_y_rowid (x, y, rowid) ) @@ -828,7 +828,7 @@ t CREATE TABLE public.t ( query IT SELECT index_id, index_name FROM crdb_internal.table_indexes WHERE descriptor_name = 't' ORDER BY index_id ---- -3 primary +3 t_pkey 4 t_y_idx # Repeat the above test using ALTER PRIMARY KEY. @@ -855,7 +855,7 @@ t CREATE TABLE public.t ( x INT8 NOT NULL, y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t_pkey PRIMARY KEY (x ASC), INDEX t_y_idx (y ASC), FAMILY fam_0_x_y_rowid (x, y, rowid) ) @@ -865,7 +865,7 @@ t CREATE TABLE public.t ( query IT SELECT index_id, index_name FROM crdb_internal.table_indexes WHERE descriptor_name = 't' ORDER BY index_id ---- -3 primary +3 t_pkey 4 t_y_idx # Test when multiple indexes get created and destroyed. @@ -898,7 +898,7 @@ t CREATE TABLE public.t ( z INT8 NULL, w INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t_pkey PRIMARY KEY (x ASC), INDEX i1 (y ASC), UNIQUE INDEX i2 (z ASC), INDEX i3 (w ASC) STORING (y, z), @@ -909,7 +909,7 @@ t CREATE TABLE public.t ( query IT SELECT index_id, index_name FROM crdb_internal.table_indexes WHERE descriptor_name = 't' ORDER BY index_id ---- -5 primary +5 t_pkey 6 i1 7 i2 8 i3 @@ -929,7 +929,7 @@ t CREATE TABLE public.t ( crdb_internal_x_shard_2 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(x)), 2:::INT8)) STORED, x INT8 NOT NULL, crdb_internal_x_shard_3 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(x)), 3:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (x ASC) USING HASH WITH BUCKET_COUNT = 3, + CONSTRAINT t_pkey PRIMARY KEY (x ASC) USING HASH WITH BUCKET_COUNT = 3, FAMILY "primary" (crdb_internal_x_shard_2, x, crdb_internal_x_shard_3), CONSTRAINT check_crdb_internal_x_shard_2 CHECK (crdb_internal_x_shard_2 IN (0:::INT8, 1:::INT8)), CONSTRAINT check_crdb_internal_x_shard_3 CHECK (crdb_internal_x_shard_3 IN (0:::INT8, 1:::INT8, 2:::INT8)) @@ -950,7 +950,7 @@ t CREATE TABLE public.t ( x INT8 NOT NULL, y INT8 NOT NULL, crdb_internal_y_shard_2 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(y)), 2:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (y ASC) USING HASH WITH BUCKET_COUNT = 2, + CONSTRAINT t_pkey PRIMARY KEY (y ASC) USING HASH WITH BUCKET_COUNT = 2, UNIQUE INDEX t_x_key (x ASC) USING HASH WITH BUCKET_COUNT = 2, FAMILY fam_0_x_y_crdb_internal_x_shard_2 (x, y, crdb_internal_x_shard_2, crdb_internal_y_shard_2), CONSTRAINT check_crdb_internal_x_shard_2 CHECK (crdb_internal_x_shard_2 IN (0:::INT8, 1:::INT8)), @@ -988,10 +988,6 @@ create table t1(id integer not null, id2 integer not null, name varchar(32)); query TTT select index_name,column_name,direction from [show indexes from t1] where index_name like 'primary%'; ---- -primary rowid ASC -primary id N/A -primary id2 N/A -primary name N/A statement ok alter table t1 alter primary key using columns(id, id2); @@ -1000,10 +996,10 @@ alter table t1 alter primary key using columns(id, id2); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id ASC -primary id2 ASC -primary name N/A -primary rowid N/A +t1_pkey id ASC +t1_pkey id2 ASC +t1_pkey name N/A +t1_pkey rowid N/A statement ok @@ -1013,23 +1009,22 @@ alter table t1 alter primary key using columns(id, id2); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id ASC -primary id2 ASC -primary name N/A -primary rowid N/A +t1_pkey id ASC +t1_pkey id2 ASC +t1_pkey name N/A +t1_pkey rowid N/A # Validate drop and recreate statement ok -alter table t1 drop constraint "primary", alter primary key using columns(id, id2); - +alter table t1 drop constraint t1_pkey, alter primary key using columns(id, id2); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id ASC -primary id2 ASC -primary name N/A -primary rowid N/A +t1_pkey id ASC +t1_pkey id2 ASC +t1_pkey name N/A +t1_pkey rowid N/A statement ok alter table t1 alter primary key using columns(id); @@ -1038,10 +1033,10 @@ alter table t1 alter primary key using columns(id); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id ASC -primary id2 N/A -primary name N/A -primary rowid N/A +t1_pkey id ASC +t1_pkey id2 N/A +t1_pkey name N/A +t1_pkey rowid N/A t1_id_id2_key id ASC t1_id_id2_key id2 ASC @@ -1052,10 +1047,10 @@ alter table t1 alter primary key using columns(id desc); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id DESC -primary id2 N/A -primary name N/A -primary rowid N/A +t1_pkey id DESC +t1_pkey id2 N/A +t1_pkey name N/A +t1_pkey rowid N/A t1_id_id2_key id ASC t1_id_id2_key id2 ASC t1_id_key id ASC @@ -1067,10 +1062,10 @@ alter table t1 alter primary key using columns(id desc); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id DESC -primary id2 N/A -primary name N/A -primary rowid N/A +t1_pkey id DESC +t1_pkey id2 N/A +t1_pkey name N/A +t1_pkey rowid N/A t1_id_id2_key id ASC t1_id_id2_key id2 ASC t1_id_key id ASC @@ -1081,10 +1076,10 @@ alter table t1 alter primary key using columns(id desc); query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary id DESC -primary id2 N/A -primary name N/A -primary rowid N/A +t1_pkey id DESC +t1_pkey id2 N/A +t1_pkey name N/A +t1_pkey rowid N/A t1_id_id2_key id ASC t1_id_id2_key id2 ASC t1_id_key id ASC @@ -1095,11 +1090,11 @@ alter table t1 alter primary key using columns(id) USING HASH WITH BUCKET_COUNT query TTT select index_name,column_name,direction from [show indexes from t1]; ---- -primary crdb_internal_id_shard_10 ASC -primary id ASC -primary id2 N/A -primary name N/A -primary rowid N/A +t1_pkey crdb_internal_id_shard_10 ASC +t1_pkey id ASC +t1_pkey id2 N/A +t1_pkey name N/A +t1_pkey rowid N/A t1_id_key1 id DESC t1_id_key1 crdb_internal_id_shard_10 ASC t1_id_id2_key id ASC @@ -1124,7 +1119,7 @@ table_with_virtual_cols CREATE TABLE public.table_with_virtual_cols ( id INT8 NOT NULL, new_pk INT8 NOT NULL, virtual_col INT8 NULL AS (1:::INT8) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (new_pk ASC), + CONSTRAINT table_with_virtual_cols_pkey PRIMARY KEY (new_pk ASC), UNIQUE INDEX table_with_virtual_cols_id_key (id ASC), FAMILY fam_0_id_new_pk (id, new_pk) ) @@ -1140,7 +1135,7 @@ CREATE TABLE t (i INT PRIMARY KEY) query TTT SELECT index_name,column_name,direction FROM [SHOW INDEXES FROM t] ---- -primary i ASC +t_pkey i ASC statement ok ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (i) USING HASH WITH BUCKET_COUNT = 2 @@ -1148,8 +1143,8 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (i) USING HASH WITH BUCKET_COUNT = query TTT SELECT index_name,column_name,direction FROM [SHOW INDEXES FROM t] ---- -primary crdb_internal_i_shard_2 ASC -primary i ASC +t_pkey crdb_internal_i_shard_2 ASC +t_pkey i ASC statement ok ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (i); @@ -1157,5 +1152,5 @@ ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (i); query TTT SELECT index_name,column_name,direction FROM [SHOW INDEXES FROM t] ---- -primary i ASC -primary crdb_internal_i_shard_2 N/A +t_pkey i ASC +t_pkey crdb_internal_i_shard_2 N/A diff --git a/pkg/sql/logictest/testdata/logic_test/alter_table b/pkg/sql/logictest/testdata/logic_test/alter_table index 184f4ac2c9be..3db07d50063a 100644 --- a/pkg/sql/logictest/testdata/logic_test/alter_table +++ b/pkg/sql/logictest/testdata/logic_test/alter_table @@ -20,10 +20,10 @@ ALTER TABLE t ADD b INT query TTBTTTB colnames SHOW COLUMNS FROM t ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false NULL · {primary,t_f_idx} false -f INT8 true NULL · {primary,t_f_idx} false -b INT8 true NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 false NULL · {t_f_idx,t_pkey} false +f INT8 true NULL · {t_f_idx,t_pkey} false +b INT8 true NULL · {t_pkey} false statement ok ALTER TABLE t ADD CONSTRAINT foo UNIQUE (b) @@ -49,11 +49,11 @@ SHOW INDEXES FROM t table_name index_name non_unique seq_in_index column_name direction storing implicit t foo false 1 b ASC false false t foo false 2 a ASC false true -t primary false 1 a ASC false false -t primary false 2 f N/A true false -t primary false 3 b N/A true false t t_f_idx true 1 f ASC false false t t_f_idx true 2 a ASC false true +t t_pkey false 1 a ASC false false +t t_pkey false 2 f N/A true false +t t_pkey false 3 b N/A true false query III SELECT * FROM t @@ -98,7 +98,7 @@ table_name constraint_name constraint_type details t check_a CHECK CHECK ((a > 0)) true t fk_f_ref_other FOREIGN KEY FOREIGN KEY (f) REFERENCES other(b) true t foo UNIQUE UNIQUE (b ASC) true -t primary PRIMARY KEY PRIMARY KEY (a ASC) true +t t_pkey PRIMARY KEY PRIMARY KEY (a ASC) true statement error CHECK INSERT INTO t (a, f) VALUES (-2, 9) @@ -127,7 +127,7 @@ SHOW CONSTRAINTS FROM t t check_a CHECK CHECK ((a > 0)) true t fk_f_ref_other FOREIGN KEY FOREIGN KEY (f) REFERENCES other(b) true t foo UNIQUE UNIQUE (b ASC) true -t primary PRIMARY KEY PRIMARY KEY (a ASC) true +t t_pkey PRIMARY KEY PRIMARY KEY (a ASC) true statement error duplicate constraint name ALTER TABLE t ADD CONSTRAINT check_a CHECK (a > 0) @@ -146,7 +146,7 @@ t check_a CHECK CHECK ((a > 0)) true t check_a1 CHECK CHECK ((a > 0)) true t fk_f_ref_other FOREIGN KEY FOREIGN KEY (f) REFERENCES other(b) true t foo UNIQUE UNIQUE (b ASC) true -t primary PRIMARY KEY PRIMARY KEY (a ASC) true +t t_pkey PRIMARY KEY PRIMARY KEY (a ASC) true statement error constraint "typo" of relation "t" does not exist ALTER TABLE t VALIDATE CONSTRAINT typo @@ -168,7 +168,7 @@ t check_a CHECK CHECK ((a > 0)) true t check_a1 CHECK CHECK ((a > 0)) true t fk_f_ref_other FOREIGN KEY FOREIGN KEY (f) REFERENCES other(b) true t foo UNIQUE UNIQUE (b ASC) true -t primary PRIMARY KEY PRIMARY KEY (a ASC) true +t t_pkey PRIMARY KEY PRIMARY KEY (a ASC) true statement ok ALTER TABLE t DROP CONSTRAINT check_a, DROP CONSTRAINT check_a1 @@ -208,12 +208,12 @@ query TTBITTBB colnames SHOW INDEXES FROM t ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -t primary false 1 a ASC false false -t primary false 2 f N/A true false -t primary false 3 b N/A true false -t primary false 4 c N/A true false t t_f_idx true 1 f ASC false false t t_f_idx true 2 a ASC false true +t t_pkey false 1 a ASC false false +t t_pkey false 2 f N/A true false +t t_pkey false 3 b N/A true false +t t_pkey false 4 c N/A true false statement ok ALTER TABLE t DROP b, DROP c @@ -364,11 +364,11 @@ query TTBITTBB colnames SHOW INDEXES FROM o ---- table_name index_name non_unique seq_in_index column_name direction storing implicit +o o_pkey false 1 rowid ASC false false +o o_pkey false 2 gf N/A true false +o o_pkey false 3 i N/A true false o oi true 1 i ASC false false o oi true 2 rowid ASC false true -o primary false 1 rowid ASC false false -o primary false 2 gf N/A true false -o primary false 3 i N/A true false statement ok ALTER TABLE t ADD f INT CHECK (f > 1) @@ -395,8 +395,8 @@ t check_f CHECK CHECK ((f > 1)) true t check_g CHECK CHECK ((g > 0)) true t check_h CHECK CHECK ((h > 0)) true t check_h1 CHECK CHECK ((h < 10)) true -t primary PRIMARY KEY PRIMARY KEY (a ASC) true t t_h_key UNIQUE UNIQUE (h ASC) true +t t_pkey PRIMARY KEY PRIMARY KEY (a ASC) true statement ok DROP TABLE t @@ -431,9 +431,9 @@ SHOW CONSTRAINTS FROM t ---- t check_c_b CHECK CHECK ((c > b)) true t ck CHECK CHECK ((a > 0)) true -t primary PRIMARY KEY PRIMARY KEY (a ASC) true t t_d_key UNIQUE UNIQUE (d ASC) true t t_e_key UNIQUE UNIQUE (e ASC) true +t t_pkey PRIMARY KEY PRIMARY KEY (a ASC) true t t_u_key UNIQUE UNIQUE (u ASC) true t t_v_key UNIQUE UNIQUE (v ASC) true @@ -462,11 +462,11 @@ query TTBTTTB colnames SHOW COLUMNS FROM tt ---- column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false NULL · {primary,tt_s_key,tt_t_key} false -q DECIMAL false NULL · {primary} false -r DECIMAL true NULL · {primary} false -s DECIMAL false NULL · {primary,tt_s_key} false -t DECIMAL true 4.0:::DECIMAL · {primary,tt_t_key} false +a INT8 false NULL · {tt_pkey,tt_s_key,tt_t_key} false +q DECIMAL false NULL · {tt_pkey} false +r DECIMAL true NULL · {tt_pkey} false +s DECIMAL false NULL · {tt_pkey,tt_s_key} false +t DECIMAL true 4.0:::DECIMAL · {tt_pkey,tt_t_key} false # Default values can be added and changed after table creation. statement ok @@ -665,9 +665,9 @@ user root query TTBTTTB colnames SHOW COLUMNS FROM privs ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false NULL · {primary} false -b INT8 true NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 false NULL · {privs_pkey} false +b INT8 true NULL · {privs_pkey} false statement ok GRANT CREATE ON privs TO testuser @@ -683,10 +683,10 @@ ALTER TABLE privs ADD CONSTRAINT foo UNIQUE (b) query TTBTTTB colnames SHOW COLUMNS FROM privs ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false NULL · {foo,primary} false -b INT8 true NULL · {foo,primary} false -c INT8 true NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 false NULL · {foo,privs_pkey} false +b INT8 true NULL · {foo,privs_pkey} false +c INT8 true NULL · {privs_pkey} false statement error pgcode 42P01 relation "nonexistent" does not exist ALTER TABLE nonexistent SPLIT AT VALUES (42) @@ -799,7 +799,7 @@ show create table decomputed_column decomputed_column CREATE TABLE public.decomputed_column ( a INT8 NOT NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT decomputed_column_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b) ) @@ -1136,7 +1136,7 @@ t2 CREATE TABLE public.t2 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x), FAMILY "primary" (y, rowid, x) ) @@ -1156,7 +1156,7 @@ t3 CREATE TABLE public.t3 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t3_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x), UNIQUE INDEX t3_x_key (x ASC), FAMILY "primary" (y, rowid, x) @@ -1193,7 +1193,7 @@ SHOW CREATE t1 t1 CREATE TABLE public.t1 ( x INT8 NOT NULL, x2 INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t1_pkey PRIMARY KEY (x ASC), CONSTRAINT fk_x2_ref_t1 FOREIGN KEY (x2) REFERENCES public.t1(x), FAMILY "primary" (x, x2) ) @@ -1219,7 +1219,7 @@ t2 CREATE TABLE public.t2 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x) NOT VALID, FAMILY "primary" (y, rowid, x) ) @@ -1243,7 +1243,7 @@ t2 CREATE TABLE public.t2 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x) NOT VALID, FAMILY "primary" (y, rowid, x) ) @@ -1270,7 +1270,7 @@ t2 CREATE TABLE public.t2 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x) NOT VALID, INDEX t2_x_idx (x ASC), FAMILY "primary" (y, rowid, x) @@ -1296,7 +1296,7 @@ t2 CREATE TABLE public.t2 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x), INDEX t2_x_idx (x ASC), FAMILY "primary" (y, rowid, x) @@ -1320,7 +1320,7 @@ SHOW CREATE t2 t2 CREATE TABLE public.t2 ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x), INDEX t2_x_idx (x ASC), FAMILY "primary" (x, rowid) @@ -1350,7 +1350,7 @@ t2 CREATE TABLE public.t2 ( y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), x INT8 NULL DEFAULT 1:::INT8, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_x_ref_t1 FOREIGN KEY (x) REFERENCES public.t1(x), UNIQUE INDEX t2_x_key (x ASC), FAMILY "primary" (y, rowid, x) @@ -1384,7 +1384,7 @@ SHOW CREATE child ---- child CREATE TABLE public.child ( c INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (c ASC), + CONSTRAINT child_pkey PRIMARY KEY (c ASC), FAMILY fam_0_c_p (c) ) @@ -1409,12 +1409,12 @@ query TT SELECT index_name, column_name FROM [SHOW INDEXES FROM regression_54196] ORDER BY index_name, column_name ASC ---- -primary col2 -primary col3 -primary rowid regression_54196_col2_col3_idx col2 regression_54196_col2_col3_idx col3 regression_54196_col2_col3_idx rowid +regression_54196_pkey col2 +regression_54196_pkey col3 +regression_54196_pkey rowid # Test to ensure that renaming a constraint on top of an existing index # fails with the correct error. @@ -1431,7 +1431,7 @@ statement error relation idx_v already exists ALTER TABLE t_cannot_rename_constraint_over_index RENAME CONSTRAINT v_unique TO idx_v; statement error relation idx_v already exists -ALTER TABLE t_cannot_rename_constraint_over_index RENAME CONSTRAINT "primary" TO idx_v; +ALTER TABLE t_cannot_rename_constraint_over_index RENAME CONSTRAINT "t_cannot_rename_constraint_over_index_pkey" TO idx_v; subtest unique_without_index @@ -1790,7 +1790,7 @@ SHOW CREATE TABLE visible_table ---- visible_table CREATE TABLE public.visible_table ( a INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT visible_table_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a) ) @@ -1802,7 +1802,7 @@ SHOW CREATE TABLE visible_table ---- visible_table CREATE TABLE public.visible_table ( a INT8 NOT VISIBLE NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT visible_table_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a) ) @@ -1855,7 +1855,7 @@ CREATE TABLE public.t67234 ( k INT8 NOT NULL, a INT8 NULL, b INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT t67234_pkey PRIMARY KEY (k ASC), UNIQUE INDEX t67234_c1 (a ASC) WHERE b > 0:::INT8, FAMILY fam_0_k_a_b (k, a, b), CONSTRAINT t67234_c2 UNIQUE WITHOUT INDEX (b) WHERE a > 0:::INT8 @@ -1899,7 +1899,7 @@ t CREATE TABLE public.t ( rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), b INT8 NOT NULL GENERATED ALWAYS AS IDENTITY, c INT8 NOT NULL GENERATED BY DEFAULT AS IDENTITY, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX t_a_key (a ASC), FAMILY "primary" (a, rowid, b, c) ) @@ -1963,7 +1963,7 @@ t CREATE TABLE public.t ( rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), b INT8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (START 1 INCREMENT 3), c INT8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (START 1 INCREMENT 3 CACHE 10), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX t_a_key (a ASC), FAMILY "primary" (a, rowid, b, c) ) diff --git a/pkg/sql/logictest/testdata/logic_test/array b/pkg/sql/logictest/testdata/logic_test/array index 3ef2c7786376..0ad4bc080c22 100644 --- a/pkg/sql/logictest/testdata/logic_test/array +++ b/pkg/sql/logictest/testdata/logic_test/array @@ -467,7 +467,7 @@ SHOW CREATE TABLE a a CREATE TABLE public.a ( b INT8[] NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT a_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (b, rowid) ) @@ -528,7 +528,7 @@ SHOW CREATE TABLE a a CREATE TABLE public.a ( b INT8[] NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT a_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (b, rowid) ) @@ -601,7 +601,7 @@ SHOW CREATE TABLE a a CREATE TABLE public.a ( b INT2[] NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT a_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (b, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/bit b/pkg/sql/logictest/testdata/logic_test/bit index 1384bd528a00..00a19befedc0 100644 --- a/pkg/sql/logictest/testdata/logic_test/bit +++ b/pkg/sql/logictest/testdata/logic_test/bit @@ -21,7 +21,7 @@ bits CREATE TABLE public.bits ( c VARBIT NULL, d VARBIT(4) NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT bits_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, rowid) ) @@ -269,7 +269,7 @@ SELECT create_statement FROM [SHOW CREATE obitsa] CREATE TABLE public.obitsa ( x VARBIT(20)[] NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT obitsa_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/cascade b/pkg/sql/logictest/testdata/logic_test/cascade index dc85157015d4..26eb740c3c65 100644 --- a/pkg/sql/logictest/testdata/logic_test/cascade +++ b/pkg/sql/logictest/testdata/logic_test/cascade @@ -331,7 +331,7 @@ SELECT * FROM b; 1 2 3 4 5 1006 7 8 9 10 # Also ensure that normal errors are still correctly wrapped even if cascading. -statement error pq: duplicate key value violates unique constraint "primary"\nDETAIL: Key \(id\)=\(1\) already exists\. +statement error pq: duplicate key value violates unique constraint "a_pkey"\nDETAIL: Key \(id\)=\(1\) already exists\. UPDATE a SET id = 1 WHERE id = 1006; # 7. ON DELETE SET NULL diff --git a/pkg/sql/logictest/testdata/logic_test/check_constraints b/pkg/sql/logictest/testdata/logic_test/check_constraints index 3cfb73778407..23f4cd6f07f9 100644 --- a/pkg/sql/logictest/testdata/logic_test/check_constraints +++ b/pkg/sql/logictest/testdata/logic_test/check_constraints @@ -220,7 +220,7 @@ t7 CREATE TABLE public.t7 ( y INT8 NULL, z INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t7_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, y, z, rowid), CONSTRAINT check_x CHECK (x > 0:::INT8), CONSTRAINT check_x_y CHECK ((x + y) > 0:::INT8), @@ -257,7 +257,7 @@ SHOW CREATE TABLE t8 t8 CREATE TABLE public.t8 ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t8_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid), CONSTRAINT check_a CHECK (a > 0:::INT8), CONSTRAINT check_a1 CHECK (a > 0:::INT8), diff --git a/pkg/sql/logictest/testdata/logic_test/collatedstring b/pkg/sql/logictest/testdata/logic_test/collatedstring index 79aa830dba7b..14eb1c96d702 100644 --- a/pkg/sql/logictest/testdata/logic_test/collatedstring +++ b/pkg/sql/logictest/testdata/logic_test/collatedstring @@ -218,7 +218,7 @@ SHOW CREATE TABLE t t CREATE TABLE public.t ( a STRING COLLATE en NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -368,7 +368,7 @@ quoted_coll CREATE TABLE public.quoted_coll ( d STRING COLLATE en_u_ks_level1 NULL DEFAULT 'd':::STRING COLLATE en_u_ks_level1, e STRING COLLATE en_US NULL AS (a COLLATE en_US) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT quoted_coll_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, e, rowid) ) @@ -471,7 +471,7 @@ SHOW CREATE TABLE collation_name_case collation_name_case CREATE TABLE public.collation_name_case ( s STRING COLLATE en_US_u_ks_level2 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT collation_name_case_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (s, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/collatedstring_constraint b/pkg/sql/logictest/testdata/logic_test/collatedstring_constraint index 4eb20435473e..b1f83e240a43 100644 --- a/pkg/sql/logictest/testdata/logic_test/collatedstring_constraint +++ b/pkg/sql/logictest/testdata/logic_test/collatedstring_constraint @@ -8,7 +8,7 @@ CREATE TABLE p ( statement ok INSERT INTO p VALUES ('a' COLLATE en_u_ks_level1) -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(a\)=\('a' COLLATE en_u_ks_level1\) already exists\. +statement error duplicate key value violates unique constraint "p_pkey"\nDETAIL: Key \(a\)=\('a' COLLATE en_u_ks_level1\) already exists\. INSERT INTO p VALUES ('A' COLLATE en_u_ks_level1) statement ok @@ -62,7 +62,7 @@ INSERT INTO c2 VALUES ('A' COLLATE en_u_ks_level1, 'apple' COLLATE en_u_ks_level statement ok INSERT INTO c2 VALUES ('b' COLLATE en_u_ks_level1, 'banana' COLLATE en_u_ks_level1) -statement error foreign key violation: value \['p' COLLATE en_u_ks_level1\] not found in p@primary \[a\]|insert on table "c2" violates foreign key constraint "fk_p" +statement error foreign key violation: value \['p' COLLATE en_u_ks_level1\] not found in p@p_pkey \[a\]|insert on table "c2" violates foreign key constraint "fk_p" INSERT INTO c2 VALUES ('p' COLLATE en_u_ks_level1, 'pear' COLLATE en_u_ks_level1) query T diff --git a/pkg/sql/logictest/testdata/logic_test/column_families b/pkg/sql/logictest/testdata/logic_test/column_families index fa3aed64922f..00458c80854b 100644 --- a/pkg/sql/logictest/testdata/logic_test/column_families +++ b/pkg/sql/logictest/testdata/logic_test/column_families @@ -63,9 +63,9 @@ SET tracing=off query T SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE -message LIKE 'fetched: /t/primary/%' +message LIKE 'fetched: /t/t_pkey/%' ORDER BY message ---- -fetched: /t/primary/1/2.00/x -> /1.00 -fetched: /t/primary/1/2/y -> /2.00 -fetched: /t/primary/1/2/z -> /1 +fetched: /t/t_pkey/1/2.00/x -> /1.00 +fetched: /t/t_pkey/1/2/y -> /2.00 +fetched: /t/t_pkey/1/2/z -> /1 diff --git a/pkg/sql/logictest/testdata/logic_test/computed b/pkg/sql/logictest/testdata/logic_test/computed index 8df3f2f6a214..735e8cb442ff 100644 --- a/pkg/sql/logictest/testdata/logic_test/computed +++ b/pkg/sql/logictest/testdata/logic_test/computed @@ -17,7 +17,7 @@ with_no_column_refs CREATE TABLE public.with_no_column_refs ( b INT8 NULL, c INT8 NULL AS (3:::INT8) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT with_no_column_refs_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, rowid) ) @@ -37,7 +37,7 @@ extra_parens CREATE TABLE public.extra_parens ( b INT8 NULL, c INT8 NULL AS (3:::INT8) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT extra_parens_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, rowid) ) @@ -93,19 +93,19 @@ x CREATE TABLE public.x ( c INT8 NULL AS (a) STORED, d INT8 NULL AS (a + b) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT x_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, rowid) ) query TTBTTTB colnames SHOW COLUMNS FROM x ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 true 3:::INT8 · {primary} false -b INT8 true 7:::INT8 · {primary} false -c INT8 true NULL a {primary} false -d INT8 true NULL a + b {primary} false -rowid INT8 false unique_rowid() · {primary} true +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 true 3:::INT8 · {x_pkey} false +b INT8 true 7:::INT8 · {x_pkey} false +c INT8 true NULL a {x_pkey} false +d INT8 true NULL a + b {x_pkey} false +rowid INT8 false unique_rowid() · {x_pkey} true statement error cannot write directly to computed column "c" INSERT INTO x (c) VALUES (1) @@ -721,7 +721,7 @@ x CREATE TABLE public.x ( a INT8 NULL, b INT8 NULL AS (a) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT x_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, rowid) ) @@ -746,7 +746,7 @@ x CREATE TABLE public.x ( c INT8 NULL, b INT8 NULL AS (c) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT x_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (c, b, rowid) ) @@ -788,7 +788,7 @@ x CREATE TABLE public.x ( b INT8 NULL AS (a * 2:::INT8) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), c INT8 NOT NULL AS (a + 4:::INT8) STORED, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT x_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, rowid, c) ) @@ -922,7 +922,7 @@ t42418 CREATE TABLE public.t42418 ( x INT8 NULL AS (1:::INT8) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), y INT8 NULL AS (1:::INT8) STORED, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t42418_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid, y) ) @@ -943,7 +943,7 @@ CREATE TABLE public.trewrite ( k INT8 NOT NULL, ts TIMESTAMPTZ NULL, c STRING NULL AS (timezone('utc':::STRING, ts)::STRING) STORED, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT trewrite_pkey PRIMARY KEY (k ASC), FAMILY fam_0_k_ts_c (k, ts, c) ) @@ -963,7 +963,7 @@ CREATE TABLE public.trewrite ( k INT8 NOT NULL, ts TIMESTAMPTZ NULL, c STRING NULL AS (timezone('utc':::STRING, ts)::STRING) STORED, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT trewrite_pkey PRIMARY KEY (k ASC), FAMILY fam_0_k_ts (k, ts, c) ) @@ -980,7 +980,7 @@ CREATE TABLE public.trewrite_copy ( k INT8 NOT NULL, ts TIMESTAMPTZ NULL, c STRING NULL AS (timezone('utc':::STRING, ts)::STRING) STORED, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT trewrite_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, ts, c) ) @@ -1021,7 +1021,7 @@ CREATE TABLE public.trewrite2 ( c1 STRING NULL AS (timezone('utc':::STRING, ts)::STRING) STORED, c2 TIMESTAMP NULL AS (parse_timestamp(str)) STORED, c3 INT8 NULL AS (mod(fnv32(b), 4:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT trewrite2_pkey PRIMARY KEY (k ASC), FAMILY fam_0_k_ts_b_str_c1_c2_c3 (k, ts, b, str, c1, c2, c3) ) diff --git a/pkg/sql/logictest/testdata/logic_test/create_as b/pkg/sql/logictest/testdata/logic_test/create_as index 135fcc49e5d9..9f086c78d969 100644 --- a/pkg/sql/logictest/testdata/logic_test/create_as +++ b/pkg/sql/logictest/testdata/logic_test/create_as @@ -158,7 +158,7 @@ foo5 CREATE TABLE public.foo5 ( a INT8 NULL, b INT8 NOT NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (b ASC), + CONSTRAINT foo5_pkey PRIMARY KEY (b ASC), FAMILY "primary" (a, b, c) ) @@ -176,7 +176,7 @@ foo6 CREATE TABLE public.foo6 ( a INT8 NOT NULL, b INT8 NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT foo6_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b, c) ) @@ -192,7 +192,7 @@ SHOW CREATE TABLE foo8 foo8 CREATE TABLE public.foo8 ( item STRING NOT NULL, qty INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (item ASC), + CONSTRAINT foo8_pkey PRIMARY KEY (item ASC), FAMILY "primary" (item, qty) ) @@ -212,7 +212,7 @@ foo9 CREATE TABLE public.foo9 ( a INT8 NOT NULL, b INT8 NULL, c INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, c ASC), + CONSTRAINT foo9_pkey PRIMARY KEY (a ASC, c ASC), FAMILY "primary" (a, b, c) ) @@ -226,7 +226,7 @@ foo10 CREATE TABLE public.foo10 ( a INT8 NOT NULL, b INT8 NOT NULL, c INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (c ASC, b ASC, a ASC), + CONSTRAINT foo10_pkey PRIMARY KEY (c ASC, b ASC, a ASC), FAMILY "primary" (a, b, c) ) @@ -245,7 +245,7 @@ foo11 CREATE TABLE public.foo11 ( x INT8 NOT NULL, y INT8 NULL, z INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC, z ASC), + CONSTRAINT foo11_pkey PRIMARY KEY (x ASC, z ASC), FAMILY "primary" (x, y, z) ) @@ -273,7 +273,7 @@ foo12 CREATE TABLE public.foo12 ( b INT8 NULL, c INT8 NULL, d INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT foo12_pkey PRIMARY KEY (a ASC), FAMILY f1 (a, b, d), FAMILY fam_1_c (c) ) @@ -290,7 +290,7 @@ foo13 CREATE TABLE public.foo13 ( b INT8 NOT NULL, c INT8 NULL, d INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT foo13_pkey PRIMARY KEY (a ASC, b ASC), FAMILY pk (a, b), FAMILY fam_1_c_d (c, d) ) @@ -310,7 +310,7 @@ foo13 CREATE TABLE public.foo13 ( b INT8 NOT NULL, e INT8 NULL, z INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT foo13_pkey PRIMARY KEY (a ASC, b ASC), FAMILY pk (a, b), FAMILY fam_1_c_d (e, z) ) diff --git a/pkg/sql/logictest/testdata/logic_test/create_index b/pkg/sql/logictest/testdata/logic_test/create_index index b6b841346795..22b8a05b0e65 100644 --- a/pkg/sql/logictest/testdata/logic_test/create_index +++ b/pkg/sql/logictest/testdata/logic_test/create_index @@ -29,8 +29,8 @@ SHOW INDEXES FROM t table_name index_name non_unique seq_in_index column_name direction storing implicit t foo true 1 b ASC false false t foo true 2 a ASC false true -t primary false 1 a ASC false false -t primary false 2 b N/A true false +t t_pkey false 1 a ASC false false +t t_pkey false 2 b N/A true false statement ok INSERT INTO t VALUES (2,1) @@ -44,8 +44,8 @@ SHOW INDEXES FROM t table_name index_name non_unique seq_in_index column_name direction storing implicit t foo true 1 b ASC false false t foo true 2 a ASC false true -t primary false 1 a ASC false false -t primary false 2 b N/A true false +t t_pkey false 1 a ASC false false +t t_pkey false 2 b N/A true false # test for DESC index @@ -77,9 +77,9 @@ t b_asc true 2 c DESC false t b_asc true 3 a ASC false true t b_desc true 1 b DESC false false t b_desc true 2 a ASC false true -t primary false 1 a ASC false false -t primary false 2 b N/A true false -t primary false 3 c N/A true false +t t_pkey false 1 a ASC false false +t t_pkey false 2 b N/A true false +t t_pkey false 3 c N/A true false statement error pgcode 42P01 relation "foo" does not exist CREATE INDEX fail ON foo (b DESC) @@ -104,8 +104,8 @@ query TTBITTBB colnames SHOW INDEXES FROM privs ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -privs primary false 1 a ASC false false -privs primary false 2 b N/A true false +privs privs_pkey false 1 a ASC false false +privs privs_pkey false 2 b N/A true false statement ok GRANT CREATE ON privs TO testuser @@ -121,8 +121,8 @@ SHOW INDEXES FROM privs table_name index_name non_unique seq_in_index column_name direction storing implicit privs foo true 1 b ASC false false privs foo true 2 a ASC false true -privs primary false 1 a ASC false false -privs primary false 2 b N/A true false +privs privs_pkey false 1 a ASC false false +privs privs_pkey false 2 b N/A true false user root @@ -169,7 +169,7 @@ SHOW CREATE TABLE create_index_concurrently_tbl create_index_concurrently_tbl CREATE TABLE public.create_index_concurrently_tbl ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT create_index_concurrently_tbl_pkey PRIMARY KEY (rowid ASC), INDEX create_index_concurrently_idx (a ASC), FAMILY "primary" (a, rowid) ) @@ -192,7 +192,7 @@ SHOW CREATE TABLE create_index_concurrently_tbl create_index_concurrently_tbl CREATE TABLE public.create_index_concurrently_tbl ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT create_index_concurrently_tbl_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/create_statements b/pkg/sql/logictest/testdata/logic_test/create_statements index 5463129b4b61..41f5d88657ed 100644 --- a/pkg/sql/logictest/testdata/logic_test/create_statements +++ b/pkg/sql/logictest/testdata/logic_test/create_statements @@ -6103,20 +6103,20 @@ CREATE TABLE pg_extension.spatial_ref_sys ( CREATE TABLE public.t ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_a_ref_t FOREIGN KEY (a) REFERENCES public.t(rowid), FAMILY "primary" (a, rowid) ) CREATE TABLE public.t ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) {"ALTER TABLE public.t ADD CONSTRAINT fk_a_ref_t FOREIGN KEY (a) REFERENCES public.t(rowid)"} {"ALTER TABLE public.t VALIDATE CONSTRAINT fk_a_ref_t"} CREATE TABLE public.v ( "'" INT8 NULL, s STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT v_pkey PRIMARY KEY (rowid ASC), CONSTRAINT "fk_'_ref_t" FOREIGN KEY ("'") REFERENCES public.t(rowid), CONSTRAINT fk_s_ref_v FOREIGN KEY (s) REFERENCES public.v(s), UNIQUE INDEX v_s_key (s ASC), @@ -6125,7 +6125,7 @@ CREATE TABLE public.v ( "'" INT8 NULL, s STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT v_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX v_s_key (s ASC), FAMILY "primary" ("'", s, rowid) ) {"ALTER TABLE public.v ADD CONSTRAINT \"fk_'_ref_t\" FOREIGN KEY (\"'\") REFERENCES public.t(rowid)","ALTER TABLE public.v ADD CONSTRAINT fk_s_ref_v FOREIGN KEY (s) REFERENCES public.v(s)"} {"ALTER TABLE public.v VALIDATE CONSTRAINT \"fk_'_ref_t\"","ALTER TABLE public.v VALIDATE CONSTRAINT fk_s_ref_v"} @@ -6133,7 +6133,7 @@ CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), INDEX c_a_b_idx (a ASC, b ASC), FAMILY fam_0_a_rowid (a, rowid), FAMILY fam_1_b (b) @@ -6144,7 +6144,7 @@ COMMENT ON INDEX public.c@c_a_b_idx IS 'index' CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), INDEX c_a_b_idx (a ASC, b ASC), FAMILY fam_0_a_rowid (a, rowid), FAMILY fam_1_b (b) @@ -6163,7 +6163,7 @@ SHOW CREATE TABLE unlogged_tbl ---- unlogged_tbl CREATE TABLE public.unlogged_tbl ( col INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (col ASC), + CONSTRAINT unlogged_tbl_pkey PRIMARY KEY (col ASC), FAMILY "primary" (col) ) diff --git a/pkg/sql/logictest/testdata/logic_test/create_table b/pkg/sql/logictest/testdata/logic_test/create_table index 957a49e207a1..9baa725b60df 100644 --- a/pkg/sql/logictest/testdata/logic_test/create_table +++ b/pkg/sql/logictest/testdata/logic_test/create_table @@ -60,9 +60,9 @@ rowid_2 query TT SELECT index_name, column_name FROM [SHOW INDEXES FROM t] ---- -primary rowid_2 -primary rowid -primary rowid_1 +t_pkey rowid_2 +t_pkey rowid +t_pkey rowid_1 query TT SHOW CREATE t @@ -71,7 +71,7 @@ t CREATE TABLE public.t ( rowid INT8 NULL, rowid_1 INT8 NULL, rowid_2 INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid_2 ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid_2 ASC), FAMILY fam_0_rowid_rowid_1_rowid_2 (rowid, rowid_1, rowid_2) ) @@ -154,7 +154,7 @@ like_none CREATE TABLE public.like_none ( k INT8 NULL, t TIMESTAMPTZ NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_none_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, h, j, k, t, rowid) ) @@ -173,7 +173,7 @@ like_constraints CREATE TABLE public.like_constraints ( k INT8 NULL, t TIMESTAMPTZ NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_constraints_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, h, j, k, t, rowid), CONSTRAINT check_a CHECK (a > 3:::INT8), CONSTRAINT unique_k UNIQUE WITHOUT INDEX (k), @@ -195,7 +195,7 @@ like_indexes CREATE TABLE public.like_indexes ( j JSONB NULL, k INT8 NULL, t TIMESTAMPTZ NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT like_table_pkey PRIMARY KEY (a ASC, b ASC), UNIQUE INDEX foo (b DESC, c ASC), INDEX like_table_c_idx (c ASC) STORING (j), INVERTED INDEX like_table_j_idx (j), @@ -218,7 +218,7 @@ like_generated CREATE TABLE public.like_generated ( k INT8 NULL, t TIMESTAMPTZ NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_generated_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, h, j, k, t, rowid) ) @@ -237,7 +237,7 @@ like_defaults CREATE TABLE public.like_defaults ( k INT8 NULL, t TIMESTAMPTZ NULL DEFAULT current_timestamp():::TIMESTAMPTZ - '00:00:05':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_defaults_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, h, j, k, t, rowid) ) @@ -255,7 +255,7 @@ like_all CREATE TABLE public.like_all ( j JSONB NULL, k INT8 NULL, t TIMESTAMPTZ NULL DEFAULT current_timestamp():::TIMESTAMPTZ - '00:00:05':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT like_table_pkey PRIMARY KEY (a ASC, b ASC), UNIQUE INDEX foo (b DESC, c ASC), INDEX like_table_c_idx (c ASC) STORING (j), INVERTED INDEX like_table_j_idx (j), @@ -282,7 +282,7 @@ like_mixed CREATE TABLE public.like_mixed ( j JSONB NULL, k INT8 NULL, t TIMESTAMPTZ NULL DEFAULT current_timestamp():::TIMESTAMPTZ - '00:00:05':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ, - CONSTRAINT "primary" PRIMARY KEY (a ASC, b ASC), + CONSTRAINT like_table_pkey PRIMARY KEY (a ASC, b ASC), UNIQUE INDEX foo (b DESC, c ASC), INDEX like_table_c_idx (c ASC) STORING (j), INVERTED INDEX like_table_j_idx (j), @@ -304,7 +304,7 @@ like_no_pk_rowid_hidden CREATE TABLE public.like_no_pk_rowid_hidden ( a INT8 NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_no_pk_table_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, rowid) ) @@ -334,7 +334,7 @@ like_more_specifiers CREATE TABLE public.like_more_specifiers ( blah INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL, rowid_1 INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid_1 ASC), + CONSTRAINT like_more_specifiers_pkey PRIMARY KEY (rowid_1 ASC), INDEX like_more_specifiers_a_blah_z_idx (a ASC, blah ASC, z ASC), FAMILY "primary" (a, b, c, h, j, k, t, z, blah, rowid, rowid_1) ) @@ -352,7 +352,7 @@ like_hash CREATE TABLE public.like_hash ( a INT8 NULL, crdb_internal_a_shard_4 INT4 NOT VISIBLE NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_hash_base_pkey PRIMARY KEY (rowid ASC), INDEX like_hash_base_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (a, crdb_internal_a_shard_4, rowid) ) @@ -367,7 +367,7 @@ like_hash CREATE TABLE public.like_hash ( a INT8 NULL, crdb_internal_a_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 4:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT like_hash_base_pkey PRIMARY KEY (rowid ASC), INDEX like_hash_base_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (a, crdb_internal_a_shard_4, rowid), CONSTRAINT check_crdb_internal_a_shard_4 CHECK (crdb_internal_a_shard_4 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8)) @@ -384,7 +384,7 @@ regression_67196_like CREATE TABLE public.regression_67196_like ( pk INT8 NOT NULL, hidden INT8 NOT VISIBLE NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT regression_67196_like_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (pk, hidden, rowid) ) @@ -501,7 +501,7 @@ generated_always_t CREATE TABLE public.generated_always_t ( a INT8 NULL, b INT8 NOT NULL GENERATED ALWAYS AS IDENTITY, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT generated_always_t_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX generated_always_t_a_key (a ASC), FAMILY f1 (a, b, rowid) ) @@ -520,7 +520,7 @@ generated_by_default_t CREATE TABLE public.generated_by_default_t ( a INT8 NULL, b INT8 NOT NULL GENERATED BY DEFAULT AS IDENTITY, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT generated_by_default_t_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX generated_by_default_t_a_key (a ASC), FAMILY f1 (a, b, rowid) ) @@ -546,7 +546,7 @@ gen_always_as_id_seqopt CREATE TABLE public.gen_always_as_id_seqopt ( a INT8 NULL, b INT8 NOT NULL GENERATED ALWAYS AS IDENTITY (START 2 INCREMENT 3), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT gen_always_as_id_seqopt_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX gen_always_as_id_seqopt_a_key (a ASC), FAMILY f1 (a, b, rowid) ) @@ -565,7 +565,7 @@ gen_always_as_id_seqopt_cache CREATE TABLE public.gen_always_as_id_seqopt_cache a INT8 NULL, b INT8 NOT NULL GENERATED ALWAYS AS IDENTITY (START 2 INCREMENT 3 CACHE 10), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT gen_always_as_id_seqopt_cache_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX gen_always_as_id_seqopt_cache_a_key (a ASC), FAMILY f1 (a, b, rowid) ) @@ -584,7 +584,7 @@ gen_by_default_as_id_seqopt CREATE TABLE public.gen_by_default_as_id_seqopt ( a INT8 NULL, b INT8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (START 2 INCREMENT 3), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT gen_by_default_as_id_seqopt_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX gen_by_default_as_id_seqopt_a_key (a ASC), FAMILY f1 (a, b, rowid) ) @@ -603,7 +603,7 @@ gen_by_default_as_id_seqopt_cache CREATE TABLE public.gen_by_default_as_id_seqo a INT8 NULL, b INT8 NOT NULL GENERATED BY DEFAULT AS IDENTITY (START 2 INCREMENT 3 CACHE 10), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT gen_by_default_as_id_seqopt_cache_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX gen_by_default_as_id_seqopt_cache_a_key (a ASC), FAMILY f1 (a, b, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/datetime b/pkg/sql/logictest/testdata/logic_test/datetime index de70c3a1c7aa..a7f7f279ce05 100644 --- a/pkg/sql/logictest/testdata/logic_test/datetime +++ b/pkg/sql/logictest/testdata/logic_test/datetime @@ -30,7 +30,7 @@ SELECT * FROM t WHERE a = '2015-08-25 04:45:45.53453+01:00'::timestamp 2015-08-25 04:45:45.53453 +0000 +0000 2015-08-25 00:00:00 +0000 +0000 02:45:02.234 # insert duplicate value with different time zone offset -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(a\)=\('2015-08-30 03:34:45\.34567'\) already exists\. +statement error duplicate key value violates unique constraint "t_pkey"\nDETAIL: Key \(a\)=\('2015-08-30 03:34:45\.34567'\) already exists\. INSERT INTO t VALUES ('2015-08-30 03:34:45.34567-07:00', '2015-08-31', '35h2s') @@ -1093,10 +1093,10 @@ CREATE TABLE tz ( query TTBTTTB SHOW COLUMNS FROM tz ---- -a INT8 false NULL · {primary} false -b TIMESTAMP true NULL · {primary} false -c TIMESTAMPTZ true NULL · {primary} false -d TIMESTAMPTZ true NULL · {primary} false +a INT8 false NULL · {tz_pkey} false +b TIMESTAMP true NULL · {tz_pkey} false +c TIMESTAMPTZ true NULL · {tz_pkey} false +d TIMESTAMPTZ true NULL · {tz_pkey} false statement ok INSERT INTO tz VALUES diff --git a/pkg/sql/logictest/testdata/logic_test/decimal b/pkg/sql/logictest/testdata/logic_test/decimal index 8d9f11f26bc7..a5e7d3169baf 100644 --- a/pkg/sql/logictest/testdata/logic_test/decimal +++ b/pkg/sql/logictest/testdata/logic_test/decimal @@ -205,7 +205,7 @@ Infinity # Just test the NaN-ness of the values. query RBBB -SELECT d, d IS NaN, d = 'NaN', isnan(d) FROM s@{FORCE_INDEX=primary} ORDER BY d, d::TEXT +SELECT d, d IS NaN, d = 'NaN', isnan(d) FROM s@{FORCE_INDEX=s_pkey} ORDER BY d, d::TEXT ---- NULL NULL NULL NULL NaN true true true @@ -240,7 +240,7 @@ NaN true true true Infinity false false false query RB -select d, d > 'NaN' from s@{FORCE_INDEX=primary} where d > 'NaN' ORDER BY d, d::TEXT +select d, d > 'NaN' from s@{FORCE_INDEX=s_pkey} where d > 'NaN' ORDER BY d, d::TEXT ---- -Infinity true -1 true @@ -292,7 +292,7 @@ INSERT INTO s VALUES ('1.0000000E+1'::decimal) query R rowsort -SELECT * FROM s@primary WHERE d = 10 +SELECT * FROM s@s_pkey WHERE d = 10 ---- 10 10.0 diff --git a/pkg/sql/logictest/testdata/logic_test/default b/pkg/sql/logictest/testdata/logic_test/default index fc871764768c..1e24e1314555 100644 --- a/pkg/sql/logictest/testdata/logic_test/default +++ b/pkg/sql/logictest/testdata/logic_test/default @@ -30,11 +30,11 @@ CREATE TABLE t ( query TTBTTTB colnames SHOW COLUMNS FROM t ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false 42:::INT8 · {primary} false -b TIMESTAMP true now():::TIMESTAMP · {primary} false -c FLOAT8 true random() · {primary} false -d DATE true now():::DATE · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 false 42:::INT8 · {t_pkey} false +b TIMESTAMP true now():::TIMESTAMP · {t_pkey} false +c FLOAT8 true random() · {t_pkey} false +d DATE true now():::DATE · {t_pkey} false statement ok COMMENT ON COLUMN t.a IS 'a' @@ -42,11 +42,11 @@ COMMENT ON COLUMN t.a IS 'a' query TTBTTTBT colnames SHOW COLUMNS FROM t WITH COMMENT ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden comment -a INT8 false 42:::INT8 · {primary} false a -b TIMESTAMP true now():::TIMESTAMP · {primary} false NULL -c FLOAT8 true random() · {primary} false NULL -d DATE true now():::DATE · {primary} false NULL +column_name data_type is_nullable column_default generation_expression indices is_hidden comment +a INT8 false 42:::INT8 · {t_pkey} false a +b TIMESTAMP true now():::TIMESTAMP · {t_pkey} false NULL +c FLOAT8 true random() · {t_pkey} false NULL +d DATE true now():::DATE · {t_pkey} false NULL statement ok INSERT INTO t VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT) @@ -125,10 +125,10 @@ UPDATE v SET (a, c) = (DEFAULT, DEFAULT) query TTBTTTB colnames SHOW COLUMNS FROM v ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false NULL · {primary} false -b TIMESTAMP true NULL · {primary} false -c INT8 true NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 false NULL · {v_pkey} false +b TIMESTAMP true NULL · {v_pkey} false +c INT8 true NULL · {v_pkey} false # Regression test for #34901: verify that builtins can be used in default value # expressions without a "memory budget exceeded" error while backfilling diff --git a/pkg/sql/logictest/testdata/logic_test/delete b/pkg/sql/logictest/testdata/logic_test/delete index 46f27c812c37..d77de50a637d 100644 --- a/pkg/sql/logictest/testdata/logic_test/delete +++ b/pkg/sql/logictest/testdata/logic_test/delete @@ -239,7 +239,7 @@ SELECT create_statement FROM [SHOW CREATE t29494] ---- CREATE TABLE public.t29494 ( x INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t29494_pkey PRIMARY KEY (x ASC), FAMILY "primary" (x) ) diff --git a/pkg/sql/logictest/testdata/logic_test/dependencies b/pkg/sql/logictest/testdata/logic_test/dependencies index 943f43d05388..99481b8b7999 100644 --- a/pkg/sql/logictest/testdata/logic_test/dependencies +++ b/pkg/sql/logictest/testdata/logic_test/dependencies @@ -44,51 +44,51 @@ descriptor_id descriptor_name column_id column_name column_type query ITITTBB colnames SELECT * FROM crdb_internal.table_indexes WHERE descriptor_name LIKE 'test_%' ORDER BY descriptor_id, index_id ---- -descriptor_id descriptor_name index_id index_name index_type is_unique is_inverted -53 test_kv 1 primary primary true false -53 test_kv 2 test_v_idx secondary true false -53 test_kv 3 test_v_idx2 secondary false false -53 test_kv 4 test_v_idx3 secondary false false -54 test_kvr1 1 primary primary true false -55 test_kvr2 1 primary primary true false -55 test_kvr2 2 test_kvr2_v_key secondary true false -56 test_kvr3 1 primary primary true false -56 test_kvr3 2 test_kvr3_v_key secondary true false -57 test_kvi1 1 primary primary true false -58 test_kvi2 1 primary primary true false -58 test_kvi2 2 test_kvi2_idx secondary true false -59 test_v1 0 · primary false false -60 test_v2 0 · primary false false -61 test_uwi_parent 1 primary primary true false -62 test_uwi_child 1 primary primary true false +descriptor_id descriptor_name index_id index_name index_type is_unique is_inverted +53 test_kv 1 test_kv_pkey primary true false +53 test_kv 2 test_v_idx secondary true false +53 test_kv 3 test_v_idx2 secondary false false +53 test_kv 4 test_v_idx3 secondary false false +54 test_kvr1 1 test_kvr1_pkey primary true false +55 test_kvr2 1 test_kvr2_pkey primary true false +55 test_kvr2 2 test_kvr2_v_key secondary true false +56 test_kvr3 1 test_kvr3_pkey primary true false +56 test_kvr3 2 test_kvr3_v_key secondary true false +57 test_kvi1 1 test_kvi1_pkey primary true false +58 test_kvi2 1 test_kvi2_pkey primary true false +58 test_kvi2 2 test_kvi2_idx secondary true false +59 test_v1 0 · primary false false +60 test_v2 0 · primary false false +61 test_uwi_parent 1 test_uwi_parent_pkey primary true false +62 test_uwi_child 1 test_uwi_child_pkey primary true false query ITITTITTB colnames SELECT * FROM crdb_internal.index_columns WHERE descriptor_name LIKE 'test_%' ORDER BY descriptor_id, index_id, column_type, column_id ---- -descriptor_id descriptor_name index_id index_name column_type column_id column_name column_direction implicit -53 test_kv 1 primary key 1 k ASC false -53 test_kv 2 test_v_idx extra 1 NULL NULL false -53 test_kv 2 test_v_idx key 2 v ASC false -53 test_kv 3 test_v_idx2 extra 1 NULL NULL false -53 test_kv 3 test_v_idx2 key 2 v DESC false -53 test_kv 3 test_v_idx2 storing 3 NULL NULL false -53 test_kv 4 test_v_idx3 composite 3 NULL NULL false -53 test_kv 4 test_v_idx3 extra 1 NULL NULL false -53 test_kv 4 test_v_idx3 key 3 w ASC false -53 test_kv 4 test_v_idx3 storing 2 NULL NULL false -54 test_kvr1 1 primary key 1 k ASC false -55 test_kvr2 1 primary key 3 rowid ASC false -55 test_kvr2 2 test_kvr2_v_key extra 3 NULL NULL false -55 test_kvr2 2 test_kvr2_v_key key 2 v ASC false -56 test_kvr3 1 primary key 3 rowid ASC false -56 test_kvr3 2 test_kvr3_v_key extra 3 NULL NULL false -56 test_kvr3 2 test_kvr3_v_key key 2 v ASC false -57 test_kvi1 1 primary key 1 k ASC false -58 test_kvi2 1 primary key 1 k ASC false -58 test_kvi2 2 test_kvi2_idx extra 1 NULL NULL false -58 test_kvi2 2 test_kvi2_idx key 2 v ASC false -61 test_uwi_parent 1 primary key 2 rowid ASC false -62 test_uwi_child 1 primary key 2 rowid ASC false +descriptor_id descriptor_name index_id index_name column_type column_id column_name column_direction implicit +53 test_kv 1 test_kv_pkey key 1 k ASC false +53 test_kv 2 test_v_idx extra 1 NULL NULL false +53 test_kv 2 test_v_idx key 2 v ASC false +53 test_kv 3 test_v_idx2 extra 1 NULL NULL false +53 test_kv 3 test_v_idx2 key 2 v DESC false +53 test_kv 3 test_v_idx2 storing 3 NULL NULL false +53 test_kv 4 test_v_idx3 composite 3 NULL NULL false +53 test_kv 4 test_v_idx3 extra 1 NULL NULL false +53 test_kv 4 test_v_idx3 key 3 w ASC false +53 test_kv 4 test_v_idx3 storing 2 NULL NULL false +54 test_kvr1 1 test_kvr1_pkey key 1 k ASC false +55 test_kvr2 1 test_kvr2_pkey key 3 rowid ASC false +55 test_kvr2 2 test_kvr2_v_key extra 3 NULL NULL false +55 test_kvr2 2 test_kvr2_v_key key 2 v ASC false +56 test_kvr3 1 test_kvr3_pkey key 3 rowid ASC false +56 test_kvr3 2 test_kvr3_v_key extra 3 NULL NULL false +56 test_kvr3 2 test_kvr3_v_key key 2 v ASC false +57 test_kvi1 1 test_kvi1_pkey key 1 k ASC false +58 test_kvi2 1 test_kvi2_pkey key 1 k ASC false +58 test_kvi2 2 test_kvi2_idx extra 1 NULL NULL false +58 test_kvi2 2 test_kvi2_idx key 2 v ASC false +61 test_uwi_parent 1 test_uwi_parent_pkey key 2 rowid ASC false +62 test_uwi_child 1 test_uwi_child_pkey key 2 rowid ASC false query ITIIITITT colnames SELECT * FROM crdb_internal.backward_dependencies WHERE descriptor_name LIKE 'test_%' ORDER BY descriptor_id, index_id, dependson_type, dependson_id, dependson_index_id diff --git a/pkg/sql/logictest/testdata/logic_test/drop_index b/pkg/sql/logictest/testdata/logic_test/drop_index index fb2a42e2f482..2439f8206e71 100644 --- a/pkg/sql/logictest/testdata/logic_test/drop_index +++ b/pkg/sql/logictest/testdata/logic_test/drop_index @@ -60,9 +60,9 @@ users bar false 1 id ASC false users bar false 2 name ASC false false users foo true 1 name ASC false false users foo true 2 id ASC false true -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false statement error index "zap" does not exist DROP INDEX users@zap @@ -78,9 +78,9 @@ users bar false 1 id ASC false users bar false 2 name ASC false false users foo true 1 name ASC false false users foo true 2 id ASC false true -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false # Also test that dropping with a non-existing index still drops 'foo'. @@ -93,9 +93,9 @@ SHOW INDEXES FROM users table_name index_name non_unique seq_in_index column_name direction storing implicit users bar false 1 id ASC false false users bar false 2 name ASC false false -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false user testuser @@ -122,9 +122,9 @@ query TTBITTBB colnames SHOW INDEXES FROM users ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false user root @@ -154,9 +154,9 @@ users bar true 1 title ASC false users bar true 2 id ASC false true users foo true 1 name ASC false false users foo true 2 id ASC false true -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false statement ok CREATE VIEW v AS SELECT name FROM users@{FORCE_INDEX=foo} @@ -173,9 +173,9 @@ SHOW INDEXES FROM users table_name index_name non_unique seq_in_index column_name direction storing implicit users foo true 1 name ASC false false users foo true 2 id ASC false true -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false statement ok CREATE VIEW v2 AS SELECT name FROM v @@ -207,9 +207,9 @@ query TTBITTBB colnames SHOW INDEXES FROM users ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false query TTTTIT SHOW TABLES @@ -230,9 +230,9 @@ query TTBITTBB colnames SHOW INDEXES FROM users ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false # Test that it still succeeds when an index does not exist. @@ -299,7 +299,7 @@ SHOW CREATE fk1 fk1 CREATE TABLE public.fk1 ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT fk1_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk1 FOREIGN KEY (x) REFERENCES public.fk2(x), INDEX i2 (x ASC), FAMILY "primary" (x, rowid) @@ -337,4 +337,4 @@ COMMIT; subtest drop_primary_key statement error pgcode 0A000 cannot drop the primary index of a table using DROP INDEX -CREATE TABLE drop_primary(); DROP INDEX drop_primary@primary CASCADE; +CREATE TABLE drop_primary(); DROP INDEX drop_primary@drop_primary_pkey CASCADE; diff --git a/pkg/sql/logictest/testdata/logic_test/drop_sequence b/pkg/sql/logictest/testdata/logic_test/drop_sequence index 225c76d87e8c..cea0078cc0a6 100644 --- a/pkg/sql/logictest/testdata/logic_test/drop_sequence +++ b/pkg/sql/logictest/testdata/logic_test/drop_sequence @@ -36,7 +36,7 @@ SHOW CREATE TABLE t1 t1 CREATE TABLE public.t1 ( i INT8 NOT NULL DEFAULT nextval('public.drop_test'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t1_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) @@ -57,7 +57,7 @@ SHOW CREATE TABLE t1 t1 CREATE TABLE public.t1 ( i INT8 NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t1_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) @@ -98,7 +98,7 @@ foo CREATE TABLE public.foo ( i INT8 NOT NULL DEFAULT nextval('other_db.public.s'::REGCLASS), j INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT foo_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) ) @@ -120,7 +120,7 @@ foo CREATE TABLE public.foo ( i INT8 NOT NULL, j INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT foo_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) ) @@ -157,7 +157,7 @@ bar CREATE TABLE public.bar ( i INT8 NOT NULL DEFAULT nextval('other_sc.s'::REGCLASS), j INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT bar_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) ) @@ -179,7 +179,7 @@ bar CREATE TABLE public.bar ( i INT8 NOT NULL, j INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT bar_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) ) @@ -222,7 +222,7 @@ SHOW CREATE TABLE t3 t3 CREATE TABLE public.t3 ( i INT8 NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t3_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) @@ -257,7 +257,7 @@ SHOW CREATE TABLE t4 t4 CREATE TABLE public.t4 ( i INT8 NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t4_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) @@ -303,7 +303,7 @@ SHOW CREATE TABLE t6 t6 CREATE TABLE public.t6 ( i INT8 NOT NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t6_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/enums b/pkg/sql/logictest/testdata/logic_test/enums index 70e1a907672c..460d7942fc0d 100644 --- a/pkg/sql/logictest/testdata/logic_test/enums +++ b/pkg/sql/logictest/testdata/logic_test/enums @@ -376,7 +376,7 @@ SHOW CREATE t1 t1 CREATE TABLE public.t1 ( x public.greeting NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t1_pkey PRIMARY KEY (rowid ASC), INDEX i (x ASC), FAMILY "primary" (x, rowid) ) @@ -389,7 +389,7 @@ SELECT create_statement FROM crdb_internal.create_statements WHERE descriptor_na CREATE TABLE public.t1 ( x public.greeting NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t1_pkey PRIMARY KEY (rowid ASC), INDEX i (x ASC), FAMILY "primary" (x, rowid) ) @@ -494,7 +494,7 @@ enum_default CREATE TABLE public.enum_default ( y public.greeting NULL DEFAULT 'hello':::public.greeting, z BOOL NULL DEFAULT 'hello':::public.greeting IS OF (public.greeting, public.greeting), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT enum_default_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_x_y_z_rowid (x, y, z, rowid) ) @@ -552,7 +552,7 @@ enum_computed CREATE TABLE public.enum_computed ( z BOOL NULL AS (w = 'howdy':::public.greeting) STORED, w public.greeting NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT enum_computed_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_x_y_z_w_rowid (x, y, z, w, rowid) ) @@ -586,7 +586,7 @@ SHOW CREATE enum_checks enum_checks CREATE TABLE public.enum_checks ( x public.greeting NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT enum_checks_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid), CONSTRAINT check_x CHECK (x = 'hello':::public.greeting), CONSTRAINT "check" CHECK ('hello':::public.greeting = 'hello':::public.greeting) @@ -1480,7 +1480,7 @@ arr_t6 CREATE TABLE public.arr_t6 ( j public.arr_typ2 NULL DEFAULT (ARRAY['b':::public.arr_typ2]:::public.arr_typ2[])[1:::INT8], k public.arr_typ2[] NULL DEFAULT ARRAY['c':::public.arr_typ2]:::public.arr_typ2[], rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT arr_t6_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_k_rowid (i, j, k, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/explain b/pkg/sql/logictest/testdata/logic_test/explain index 09f79daf5361..5fda6a24b216 100644 --- a/pkg/sql/logictest/testdata/logic_test/explain +++ b/pkg/sql/logictest/testdata/logic_test/explain @@ -13,7 +13,7 @@ distribution: local │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkF1L8zAUx--fTxEOPKyVyNZd5mpDqxbrOtuyCaMXsTmOQpfUJJ0vo99d1gx0wkQvz__tF7ID81wDgyyMw4ucVPJJkas0uSOr8GEeT6MZ8S6jLM_uY58cMmcu4B1Ovl173CfJIkyJ5zvP-gVZ3oRp6AZnSU7i6DYkgy2WVunqHcX_AVCQSuCMb9AAW0EABYVGqxKNUXov7fpAJF6BjShUsmntXi4olEojsB3YytYIDHL-WGOKXKAejoCCQMurup-1k0ZXG67fgELWcGkYOYeio6Ba-zloLF8jsKCjv4cuKynUC-phcEycLq69SeADhaS1jEzGJ3Hjv-BSNI2SBo9gp5ZHXUEBxRrdPxrV6hLnWpU9xp1J3-sFgcY6N3BHJJ21f-DXcvBjefytXHT_PgIAAP__H3zBmg== diff --git a/pkg/sql/logictest/testdata/logic_test/expression_index b/pkg/sql/logictest/testdata/logic_test/expression_index index 18e27b2229f3..813fc13fbe57 100644 --- a/pkg/sql/logictest/testdata/logic_test/expression_index +++ b/pkg/sql/logictest/testdata/logic_test/expression_index @@ -21,7 +21,7 @@ CREATE TABLE public.t ( c STRING NULL, j JSONB NULL, comp INT8 NULL AS (a + 10:::INT8) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT t_pkey PRIMARY KEY (k ASC), INDEX t_a_plus_b_idx ((a + b) ASC), INDEX t_lower_c_a_plus_b_idx (lower(c) ASC, (a + b) ASC), FAMILY fam_0_k_a_b_c_j (k, a, b, c, j) @@ -156,7 +156,7 @@ CREATE TABLE public.t ( c STRING NULL, j JSONB NULL, comp INT8 NULL AS (a + 10:::INT8) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT t_pkey PRIMARY KEY (k ASC), INDEX t_a_plus_b_idx ((a + b) ASC), INDEX t_lower_c_idx (lower(c) ASC), INDEX t_lower_c_a_plus_b_idx (lower(c) ASC, (a + b) ASC), @@ -351,7 +351,7 @@ CREATE TABLE public.copy ( j JSONB NULL, comp INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT copy_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (k, a, b, j, comp, rowid) ) @@ -376,7 +376,7 @@ CREATE TABLE public.copy_generated ( j JSONB NULL, comp INT8 NULL AS (1:::INT8 + 10:::INT8) VIRTUAL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT copy_generated_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (k, a, b, j, rowid) ) @@ -400,7 +400,7 @@ CREATE TABLE public.copy_indexes ( b INT8 NULL, j JSONB NULL, comp INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT src_pkey PRIMARY KEY (k ASC), INDEX src_expr_idx ((a + b) ASC), INDEX named_idx ((a + 1:::INT8) ASC), UNIQUE INDEX src_expr_key ((a + 10:::INT8) ASC), @@ -428,7 +428,7 @@ CREATE TABLE public.copy_all ( b INT8 NULL, j JSONB NULL, comp INT8 NULL AS (1:::INT8 + 10:::INT8) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT src_pkey PRIMARY KEY (k ASC), INDEX src_expr_idx ((a + b) ASC), INDEX named_idx ((a + 1:::INT8) ASC), UNIQUE INDEX src_expr_key ((a + 10:::INT8) ASC), @@ -471,7 +471,7 @@ CREATE TABLE public.anon ( a INT8 NULL, b INT8 NULL, c STRING NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT anon_pkey PRIMARY KEY (k ASC), INDEX anon_expr_idx ((a + b) ASC), INDEX anon_expr_b_idx ((a + 10:::INT8) ASC, b ASC), UNIQUE INDEX anon_expr_b_key (lower(c) ASC, b ASC), @@ -503,7 +503,7 @@ CREATE TABLE public.anon ( a INT8 NULL, b INT8 NULL, c STRING NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT anon_pkey PRIMARY KEY (k ASC), INDEX anon_expr_idx ((a + b) ASC), INDEX anon_expr_b_idx ((a + 10:::INT8) ASC, b ASC), UNIQUE INDEX anon_expr_b_key (lower(c) ASC, b ASC), diff --git a/pkg/sql/logictest/testdata/logic_test/family b/pkg/sql/logictest/testdata/logic_test/family index 2e8414a26aa5..43db81ea42af 100644 --- a/pkg/sql/logictest/testdata/logic_test/family +++ b/pkg/sql/logictest/testdata/logic_test/family @@ -18,7 +18,7 @@ abcd CREATE TABLE public.abcd ( b INT8 NULL, c INT8 NULL, d INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT abcd_pkey PRIMARY KEY (a ASC), FAMILY f1 (a, b), FAMILY fam_1_c_d (c, d) ) @@ -158,7 +158,7 @@ abcd CREATE TABLE public.abcd ( h INT8 NULL, i INT8 NULL, j INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT abcd_pkey PRIMARY KEY (a ASC), INDEX d_idx (d ASC), FAMILY f1 (a, b, e, f), FAMILY fam_1_c_d (c, d), @@ -178,7 +178,7 @@ abcd CREATE TABLE public.abcd ( b INT8 NULL, f DECIMAL NULL, g INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT abcd_pkey PRIMARY KEY (a ASC), FAMILY f1 (a, b, f), FAMILY fam_2_g (g) ) @@ -196,7 +196,7 @@ f1 CREATE TABLE public.f1 ( a INT8 NOT NULL, b STRING NULL, c STRING NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT f1_pkey PRIMARY KEY (a ASC), FAMILY "primary" (a, b, c) ) @@ -210,7 +210,7 @@ assign_at_create CREATE TABLE public.assign_at_create ( a INT8 NOT NULL, b INT8 NULL, c INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT assign_at_create_pkey PRIMARY KEY (a ASC), FAMILY pri (a), FAMILY foo (b), FAMILY fam_2_c (c) @@ -248,7 +248,7 @@ rename_col CREATE TABLE public.rename_col ( a INT8 NOT NULL, d INT8 NULL, e STRING NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT rename_col_pkey PRIMARY KEY (a ASC), FAMILY fam_0_a_b (a, d), FAMILY fam_1_c (e) ) @@ -297,7 +297,7 @@ SELECT a FROM t1 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT a FROM t1 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t1@primary + table: t1@t1_pkey spans: [/10 - /10] # A point lookup on a non-nullable column allows us to scan only that column @@ -310,7 +310,7 @@ SELECT b FROM t1 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT b FROM t1 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t1@primary + table: t1@t1_pkey spans: [/10 - /10] # Even if we also select the primary key column, we can still scan the single @@ -323,7 +323,7 @@ SELECT a, b FROM t1 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT a, b FROM t1 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t1@primary + table: t1@t1_pkey spans: [/10 - /10] # A point lookup on a nullable column requires also scanning column family 0 as @@ -336,7 +336,7 @@ SELECT c FROM t1 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT c FROM t1 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t1@primary + table: t1@t1_pkey spans: [/10 - /10] # A point lookup on two columns in non-adjacent column families results in two @@ -349,7 +349,7 @@ SELECT b, d FROM t1 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT b, d FROM t1 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t1@primary + table: t1@t1_pkey spans: [/10 - /10] # Unique secondary indexes store non-indexed primary key columns in column @@ -386,7 +386,7 @@ SELECT a FROM t2 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT a FROM t2 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t2@primary + table: t2@t2_pkey spans: [/10 - /10] # A point lookup on `a` and `b` should scan both of their families. @@ -398,7 +398,7 @@ SELECT a, b FROM t2 WHERE a = 10 query T SELECT info FROM [EXPLAIN SELECT a, b FROM t2 WHERE a = 10] WHERE info LIKE '%table%' OR info LIKE '%spans%' ---- - table: t2@primary + table: t2@t2_pkey spans: [/10 - /10] # Secondary indexes always store their composite values in column family 0. diff --git a/pkg/sql/logictest/testdata/logic_test/fk b/pkg/sql/logictest/testdata/logic_test/fk index 77c26f40b1c9..e98bb6dc3bbc 100644 --- a/pkg/sql/logictest/testdata/logic_test/fk +++ b/pkg/sql/logictest/testdata/logic_test/fk @@ -300,9 +300,9 @@ CREATE TABLE unindexed (customer INT REFERENCES customers) query TTBITTBB colnames SHOW INDEXES FROM unindexed ---- -table_name index_name non_unique seq_in_index column_name direction storing implicit -unindexed primary false 1 rowid ASC false false -unindexed primary false 2 customer N/A true false +table_name index_name non_unique seq_in_index column_name direction storing implicit +unindexed unindexed_pkey false 1 rowid ASC false false +unindexed unindexed_pkey false 2 customer N/A true false statement error there is no unique constraint matching given keys for referenced table products CREATE TABLE non_unique (product STRING REFERENCES products (vendor)) @@ -433,8 +433,8 @@ CREATE TABLE "user content".review_stats ( query TTTTB SHOW CONSTRAINTS FROM "user content".review_stats ---- -review_stats primary PRIMARY KEY PRIMARY KEY (id ASC) true -review_stats reviewfk FOREIGN KEY FOREIGN KEY (id) REFERENCES "customer reviews"(id) true +review_stats review_stats_pkey PRIMARY KEY PRIMARY KEY (id ASC) true +review_stats reviewfk FOREIGN KEY FOREIGN KEY (id) REFERENCES "customer reviews"(id) true statement error pgcode 23503 insert on table "review_stats" violates foreign key constraint "reviewfk"\nDETAIL: Key \(id\)=\(5\) is not present in table "customer reviews" INSERT INTO "user content".review_stats (id, upvotes) VALUES (5, 1) @@ -451,7 +451,7 @@ ALTER TABLE "user content".review_stats DROP CONSTRAINT reviewfk query TTTTB SHOW CONSTRAINTS FROM "user content".review_stats ---- -review_stats primary PRIMARY KEY PRIMARY KEY (id ASC) true +review_stats review_stats_pkey PRIMARY KEY PRIMARY KEY (id ASC) true statement ok DELETE FROM "user content"."customer reviews" @@ -505,7 +505,7 @@ delivery CREATE TABLE public.delivery ( shipment INT8 NULL, item STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT delivery_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_order_ref_orders FOREIGN KEY ("order", shipment) REFERENCES public.orders(id, shipment), CONSTRAINT fk_item_ref_products FOREIGN KEY (item) REFERENCES public.products(upc), INDEX delivery_item_idx (item ASC), @@ -640,7 +640,7 @@ SHOW CONSTRAINTS FROM orders ---- table_name constraint_name constraint_type details validated orders fk_product_ref_products FOREIGN KEY FOREIGN KEY (product) REFERENCES products(sku) ON DELETE RESTRICT ON UPDATE RESTRICT true -orders primary PRIMARY KEY PRIMARY KEY (id ASC, shipment ASC) true +orders orders_pkey PRIMARY KEY PRIMARY KEY (id ASC, shipment ASC) true orders valid_customer FOREIGN KEY FOREIGN KEY (customer) REFERENCES customers(id) true statement error pq: index "products_upc_key" is in use as unique constraint @@ -774,12 +774,12 @@ query TTBITTBB colnames SHOW INDEXES FROM refpairs_wrong_order ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -refpairs_wrong_order primary false 1 rowid ASC false false -refpairs_wrong_order primary false 2 a N/A true false -refpairs_wrong_order primary false 3 b N/A true false refpairs_wrong_order refpairs_wrong_order_b_a_idx true 1 b ASC false false refpairs_wrong_order refpairs_wrong_order_b_a_idx true 2 a ASC false false refpairs_wrong_order refpairs_wrong_order_b_a_idx true 3 rowid ASC false true +refpairs_wrong_order refpairs_wrong_order_pkey false 1 rowid ASC false false +refpairs_wrong_order refpairs_wrong_order_pkey false 2 a N/A true false +refpairs_wrong_order refpairs_wrong_order_pkey false 3 b N/A true false statement ok CREATE TABLE refpairs_c_between (a INT, b STRING, c INT, FOREIGN KEY (a, b) REFERENCES pairs (src, dest), INDEX (a, c, b)) @@ -788,14 +788,14 @@ query TTBITTBB colnames SHOW INDEXES FROM refpairs_c_between ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -refpairs_c_between primary false 1 rowid ASC false false -refpairs_c_between primary false 2 a N/A true false -refpairs_c_between primary false 3 b N/A true false -refpairs_c_between primary false 4 c N/A true false refpairs_c_between refpairs_c_between_a_c_b_idx true 1 a ASC false false refpairs_c_between refpairs_c_between_a_c_b_idx true 2 c ASC false false refpairs_c_between refpairs_c_between_a_c_b_idx true 3 b ASC false false refpairs_c_between refpairs_c_between_a_c_b_idx true 4 rowid ASC false true +refpairs_c_between refpairs_c_between_pkey false 1 rowid ASC false false +refpairs_c_between refpairs_c_between_pkey false 2 a N/A true false +refpairs_c_between refpairs_c_between_pkey false 3 b N/A true false +refpairs_c_between refpairs_c_between_pkey false 4 c N/A true false statement ok CREATE TABLE refpairs ( @@ -811,14 +811,14 @@ query TTBITTBB colnames SHOW INDEXES FROM refpairs ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -refpairs primary false 1 rowid ASC false false -refpairs primary false 2 a N/A true false -refpairs primary false 3 b N/A true false -refpairs primary false 4 c N/A true false refpairs refpairs_a_b_c_idx true 1 a ASC false false refpairs refpairs_a_b_c_idx true 2 b ASC false false refpairs refpairs_a_b_c_idx true 3 c ASC false false refpairs refpairs_a_b_c_idx true 4 rowid ASC false true +refpairs refpairs_pkey false 1 rowid ASC false false +refpairs refpairs_pkey false 2 a N/A true false +refpairs refpairs_pkey false 3 b N/A true false +refpairs refpairs_pkey false 4 c N/A true false query TT SHOW CREATE TABLE refpairs @@ -828,7 +828,7 @@ refpairs CREATE TABLE public.refpairs ( b STRING NULL, c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT refpairs_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_a_ref_pairs FOREIGN KEY (a, b) REFERENCES public.pairs(src, dest) ON UPDATE RESTRICT, INDEX refpairs_a_b_c_idx (a ASC, b ASC, c ASC), FAMILY "primary" (a, b, c, rowid) @@ -916,8 +916,8 @@ SHOW CONSTRAINTS FROM domain_modules ---- domain_modules domain_modules_domain_id_fk FOREIGN KEY FOREIGN KEY (domain_id) REFERENCES domains(id) true domain_modules domain_modules_module_id_fk FOREIGN KEY FOREIGN KEY (module_id) REFERENCES modules(id) true +domain_modules domain_modules_pkey PRIMARY KEY PRIMARY KEY (id ASC) true domain_modules domain_modules_uq UNIQUE UNIQUE (domain_id ASC, module_id ASC) true -domain_modules primary PRIMARY KEY PRIMARY KEY (id ASC) true statement ok INSERT INTO modules VALUES(3) @@ -1037,7 +1037,7 @@ refers CREATE TABLE public.refers ( a INT8 NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT refers_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_a_ref_referee FOREIGN KEY (a) REFERENCES public.referee(id), INDEX another_idx (b ASC), INDEX foo (a ASC), @@ -1119,7 +1119,7 @@ SHOW CREATE TABLE pkref_b ---- pkref_b CREATE TABLE public.pkref_b ( b INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (b ASC), + CONSTRAINT pkref_b_pkey PRIMARY KEY (b ASC), CONSTRAINT fk_b_ref_pkref_a FOREIGN KEY (b) REFERENCES public.pkref_a(a) ON DELETE RESTRICT, FAMILY "primary" (b) ) @@ -2773,7 +2773,7 @@ query TTTTB SHOW CONSTRAINTS FROM pet ---- pet fk_constraint FOREIGN KEY FOREIGN KEY (id) REFERENCES person(id) NOT VALID false -pet primary PRIMARY KEY PRIMARY KEY (id ASC) true +pet pet_pkey PRIMARY KEY PRIMARY KEY (id ASC) true statement error pq: foreign key violation: "pet" row id=0 has no match in "person" ALTER TABLE pet VALIDATE CONSTRAINT fk_constraint @@ -2788,7 +2788,7 @@ query TTTTB SHOW CONSTRAINTS FROM pet ---- pet fk_constraint FOREIGN KEY FOREIGN KEY (id) REFERENCES person(id) true -pet primary PRIMARY KEY PRIMARY KEY (id ASC) true +pet pet_pkey PRIMARY KEY PRIMARY KEY (id ASC) true statement ok DROP TABLE person, pet @@ -2839,7 +2839,7 @@ INSERT INTO child (c, p) VALUES (200, 2) # These two test cases are sort of undefined behavior, since their # success/failure depends on the order in which the updates are performed. -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(p\)=\(3\) already exists\. +statement error duplicate key value violates unique constraint "parent_pkey"\nDETAIL: Key \(p\)=\(3\) already exists\. UPDATE parent SET p = p + 1 statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/float b/pkg/sql/logictest/testdata/logic_test/float index 7ec53f1b5c35..19a31e4d2121 100644 --- a/pkg/sql/logictest/testdata/logic_test/float +++ b/pkg/sql/logictest/testdata/logic_test/float @@ -17,7 +17,7 @@ SELECT * FROM p WHERE f = 'NaN' NaN query RBBB -SELECT f, f IS NaN, f = 'NaN', isnan(f) FROM p@{FORCE_INDEX=primary} ORDER BY 1 +SELECT f, f IS NaN, f = 'NaN', isnan(f) FROM p@{FORCE_INDEX=p_pkey} ORDER BY 1 ---- NULL NULL NULL NULL NaN true true true @@ -39,7 +39,7 @@ NaN true true true +Inf false false false query RB -select f, f > 'NaN' from p@{FORCE_INDEX=primary} where f > 'NaN' ORDER BY f +select f, f > 'NaN' from p@{FORCE_INDEX=p_pkey} where f > 'NaN' ORDER BY f ---- -Inf true -1 true diff --git a/pkg/sql/logictest/testdata/logic_test/geospatial b/pkg/sql/logictest/testdata/logic_test/geospatial index 9fd5edd268ec..7aad2fda1876 100644 --- a/pkg/sql/logictest/testdata/logic_test/geospatial +++ b/pkg/sql/logictest/testdata/logic_test/geospatial @@ -77,7 +77,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE geom_table_negative_values] CREATE TABLE public.geom_table_negative_values ( a GEOMETRY(GEOMETRY) NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT geom_table_negative_values_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -92,7 +92,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE geog_table_negative_values] CREATE TABLE public.geog_table_negative_values ( a GEOGRAPHY(GEOMETRY) NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT geog_table_negative_values_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -114,10 +114,10 @@ SELECT orphan FROM geo_table query TTBTTTB rowsort SHOW COLUMNS FROM geo_table ---- -id INT8 false NULL · {geo_table_geog_idx,geo_table_geom_idx,primary} false -geog GEOGRAPHY(GEOMETRY,4326) true NULL · {geo_table_geog_idx,primary} false -geom GEOMETRY(POINT) true NULL · {geo_table_geom_idx,primary} false -orphan GEOGRAPHY true NULL · {primary} false +id INT8 false NULL · {geo_table_geog_idx,geo_table_geom_idx,geo_table_pkey} false +geog GEOGRAPHY(GEOMETRY,4326) true NULL · {geo_table_geog_idx,geo_table_pkey} false +geom GEOMETRY(POINT) true NULL · {geo_table_geom_idx,geo_table_pkey} false +orphan GEOGRAPHY true NULL · {geo_table_pkey} false statement error column bad_pk is of type geography and thus is not indexable CREATE TABLE bad_geog_table(bad_pk geography primary key) diff --git a/pkg/sql/logictest/testdata/logic_test/geospatial_index b/pkg/sql/logictest/testdata/logic_test/geospatial_index index 38526c5c4267..6e694986bfc6 100644 --- a/pkg/sql/logictest/testdata/logic_test/geospatial_index +++ b/pkg/sql/logictest/testdata/logic_test/geospatial_index @@ -51,7 +51,7 @@ CREATE TABLE public.geo_table ( id INT8 NOT NULL, geog GEOGRAPHY(GEOMETRY,4326) NULL, geom GEOMETRY(GEOMETRY,3857) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT geo_table_pkey PRIMARY KEY (id ASC), INVERTED INDEX geom_idx_1 (geom) WITH (s2_max_level=15, geometry_min_x=0), INVERTED INDEX geom_idx_2 (geom) WITH (geometry_min_x=0), INVERTED INDEX geom_idx_3 (geom) WITH (s2_max_level=10), @@ -76,7 +76,7 @@ CREATE TABLE public.geo_table ( id INT8 NOT NULL, geog GEOGRAPHY(GEOMETRY,4326) NULL, geom GEOMETRY(GEOMETRY,3857) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT geo_table_pkey PRIMARY KEY (id ASC), INVERTED INDEX geom_idx_1 (geom) WITH (s2_max_level=15, geometry_min_x=0), INVERTED INDEX geom_idx_2 (geom) WITH (geometry_min_x=0), INVERTED INDEX geom_idx_3 (geom) WITH (s2_max_level=10), diff --git a/pkg/sql/logictest/testdata/logic_test/hash_sharded_index b/pkg/sql/logictest/testdata/logic_test/hash_sharded_index index 21281deddf6b..b7643eff838f 100644 --- a/pkg/sql/logictest/testdata/logic_test/hash_sharded_index +++ b/pkg/sql/logictest/testdata/logic_test/hash_sharded_index @@ -11,7 +11,7 @@ SHOW CREATE TABLE sharded_primary sharded_primary CREATE TABLE public.sharded_primary ( crdb_internal_a_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 10:::INT8)) STORED, a INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (a ASC) USING HASH WITH BUCKET_COUNT = 10, + CONSTRAINT sharded_primary_pkey PRIMARY KEY (a ASC) USING HASH WITH BUCKET_COUNT = 10, FAMILY "primary" (crdb_internal_a_shard_10, a), CONSTRAINT check_crdb_internal_a_shard_10 CHECK (crdb_internal_a_shard_10 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8)) ) @@ -104,7 +104,7 @@ specific_family CREATE TABLE public.specific_family ( b INT8 NULL, crdb_internal_b_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(b)), 10:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT specific_family_pkey PRIMARY KEY (rowid ASC), INDEX specific_family_b_idx (b ASC) USING HASH WITH BUCKET_COUNT = 10, FAMILY a_family (a, rowid), FAMILY b_family (b, crdb_internal_b_shard_10), @@ -122,7 +122,7 @@ sharded_secondary CREATE TABLE public.sharded_secondary ( a INT8 NULL, crdb_internal_a_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 4:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), INDEX sharded_secondary_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (a, crdb_internal_a_shard_4, rowid), CONSTRAINT check_crdb_internal_a_shard_4 CHECK (crdb_internal_a_shard_4 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8)) @@ -145,7 +145,7 @@ sharded_secondary CREATE TABLE public.sharded_secondary ( a INT8 NULL, crdb_internal_a_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 4:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), INDEX sharded_secondary_crdb_internal_a_shard_4_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (a, crdb_internal_a_shard_4, rowid), CONSTRAINT check_crdb_internal_a_shard_4 CHECK (crdb_internal_a_shard_4 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8)) @@ -175,7 +175,7 @@ sharded_secondary CREATE TABLE public.sharded_secondary ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), crdb_internal_a_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 10:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), INDEX sharded_secondary_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 10, FAMILY "primary" (a, rowid, crdb_internal_a_shard_10), CONSTRAINT check_crdb_internal_a_shard_10 CHECK (crdb_internal_a_shard_10 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8)) @@ -196,7 +196,7 @@ sharded_secondary CREATE TABLE public.sharded_secondary ( rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), crdb_internal_a_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 10:::INT8)) STORED, crdb_internal_a_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 4:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), INDEX sharded_secondary_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 10, INDEX sharded_secondary_a_idx1 (a ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (a, rowid, crdb_internal_a_shard_10, crdb_internal_a_shard_4), @@ -215,7 +215,7 @@ sharded_secondary CREATE TABLE public.sharded_secondary ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), crdb_internal_a_shard_4 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 4:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), INDEX sharded_secondary_a_idx1 (a ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" (a, rowid, crdb_internal_a_shard_4), CONSTRAINT check_crdb_internal_a_shard_4 CHECK (crdb_internal_a_shard_4 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8)) @@ -231,7 +231,7 @@ SHOW CREATE TABLE sharded_secondary sharded_secondary CREATE TABLE public.sharded_secondary ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -275,7 +275,7 @@ sharded_secondary CREATE TABLE public.sharded_secondary ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), crdb_internal_a_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 10:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sharded_secondary_pkey PRIMARY KEY (rowid ASC), INDEX sharded_secondary_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 10, INDEX sharded_secondary_a_idx1 (a ASC) USING HASH WITH BUCKET_COUNT = 10, INDEX sharded_secondary_a_idx2 (a ASC) USING HASH WITH BUCKET_COUNT = 10, @@ -414,7 +414,7 @@ column_used_on_unsharded CREATE TABLE public.column_used_on_unsharded ( a INT8 NULL, crdb_internal_a_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 10:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT column_used_on_unsharded_pkey PRIMARY KEY (rowid ASC), INDEX column_used_on_unsharded_crdb_internal_a_shard_10_idx (crdb_internal_a_shard_10 ASC), FAMILY "primary" (a, crdb_internal_a_shard_10, rowid), CONSTRAINT check_crdb_internal_a_shard_10 CHECK (crdb_internal_a_shard_10 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8)) @@ -440,7 +440,7 @@ column_used_on_unsharded_create_table CREATE TABLE public.column_used_on_unshar a INT8 NULL, crdb_internal_a_shard_10 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 10:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT column_used_on_unsharded_create_table_pkey PRIMARY KEY (rowid ASC), INDEX column_used_on_unsharded_create_table_crdb_internal_a_shard_10_idx (crdb_internal_a_shard_10 ASC), FAMILY "primary" (a, crdb_internal_a_shard_10, rowid), CONSTRAINT check_crdb_internal_a_shard_10 CHECK (crdb_internal_a_shard_10 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8)) @@ -497,7 +497,7 @@ weird_names CREATE TABLE public.weird_names ( "I am a column with spaces" INT8 NOT NULL, "'quotes' in the column's name" INT8 NULL, "crdb_internal_'quotes' in the column's name_shard_4" INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes("'quotes' in the column's name")), 4:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY ("I am a column with spaces" ASC) USING HASH WITH BUCKET_COUNT = 12, + CONSTRAINT weird_names_pkey PRIMARY KEY ("I am a column with spaces" ASC) USING HASH WITH BUCKET_COUNT = 12, INDEX foo ("'quotes' in the column's name" ASC) USING HASH WITH BUCKET_COUNT = 4, FAMILY "primary" ("I am a column with spaces", "'quotes' in the column's name", "crdb_internal_I am a column with spaces_shard_12", "crdb_internal_'quotes' in the column's name_shard_4"), CONSTRAINT "check_crdb_internal_I am a column with spaces_shard_12" CHECK ("crdb_internal_I am a column with spaces_shard_12" IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8, 8:::INT8, 9:::INT8, 10:::INT8, 11:::INT8)), @@ -575,7 +575,7 @@ rename_column CREATE TABLE public.rename_column ( c2 INT8 NULL, crdb_internal_c0_c1_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(c0, c1)), 8:::INT8)) STORED, crdb_internal_c2_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(c2)), 8:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (c0 ASC, c1 ASC) USING HASH WITH BUCKET_COUNT = 8, + CONSTRAINT rename_column_pkey PRIMARY KEY (c0 ASC, c1 ASC) USING HASH WITH BUCKET_COUNT = 8, INDEX rename_column_c2_idx (c2 ASC) USING HASH WITH BUCKET_COUNT = 8, FAMILY "primary" (c0, c1, c2, crdb_internal_c0_c1_shard_8, crdb_internal_c2_shard_8), CONSTRAINT check_crdb_internal_c0_c1_shard_8 CHECK (crdb_internal_c0_c1_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)), @@ -601,7 +601,7 @@ rename_column CREATE TABLE public.rename_column ( c3 INT8 NULL, crdb_internal_c1_c2_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(c1, c2)), 8:::INT8)) STORED, crdb_internal_c3_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(c3)), 8:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (c1 ASC, c2 ASC) USING HASH WITH BUCKET_COUNT = 8, + CONSTRAINT rename_column_pkey PRIMARY KEY (c1 ASC, c2 ASC) USING HASH WITH BUCKET_COUNT = 8, INDEX rename_column_c2_idx (c3 ASC) USING HASH WITH BUCKET_COUNT = 8, FAMILY "primary" (c1, c2, c3, crdb_internal_c1_c2_shard_8, crdb_internal_c3_shard_8), CONSTRAINT check_crdb_internal_c0_c1_shard_8 CHECK (crdb_internal_c1_c2_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)), @@ -626,7 +626,7 @@ rename_column CREATE TABLE public.rename_column ( c2 INT8 NULL, crdb_internal_c0_c1_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(c0, c1)), 8:::INT8)) STORED, crdb_internal_c2_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(c2)), 8:::INT8)) STORED, - CONSTRAINT "primary" PRIMARY KEY (c0 ASC, c1 ASC) USING HASH WITH BUCKET_COUNT = 8, + CONSTRAINT rename_column_pkey PRIMARY KEY (c0 ASC, c1 ASC) USING HASH WITH BUCKET_COUNT = 8, INDEX rename_column_c2_idx (c2 ASC) USING HASH WITH BUCKET_COUNT = 8, FAMILY "primary" (c0, c1, c2, crdb_internal_c0_c1_shard_8, crdb_internal_c2_shard_8), CONSTRAINT check_crdb_internal_c0_c1_shard_8 CHECK (crdb_internal_c0_c1_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)), diff --git a/pkg/sql/logictest/testdata/logic_test/hidden_columns b/pkg/sql/logictest/testdata/logic_test/hidden_columns index 2deb3288bfca..20221057cacf 100644 --- a/pkg/sql/logictest/testdata/logic_test/hidden_columns +++ b/pkg/sql/logictest/testdata/logic_test/hidden_columns @@ -29,7 +29,7 @@ SHOW CREATE TABLE t t CREATE TABLE public.t ( x INT8 NOT VISIBLE NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) @@ -85,7 +85,7 @@ CREATE TABLE t5(b INT NOT VISIBLE, c INT, d INT, PRIMARY KEY (d), FOREIGN KEY(b) query TTTTB SHOW CONSTRAINTS FROM t2 ---- -t2 primary PRIMARY KEY PRIMARY KEY (d ASC) true +t2 t2_pkey PRIMARY KEY PRIMARY KEY (d ASC) true statement ok ALTER TABLE t2 ADD FOREIGN KEY (b) REFERENCES t2 @@ -93,8 +93,8 @@ ALTER TABLE t2 ADD FOREIGN KEY (b) REFERENCES t2 query TTTTB SHOW CONSTRAINTS FROM t2 ---- -t2 fk_b_ref_t2 FOREIGN KEY FOREIGN KEY (b) REFERENCES t2(d) true -t2 primary PRIMARY KEY PRIMARY KEY (d ASC) true +t2 fk_b_ref_t2 FOREIGN KEY FOREIGN KEY (b) REFERENCES t2(d) true +t2 t2_pkey PRIMARY KEY PRIMARY KEY (d ASC) true # adding a foreign key constraint that references a hidden column @@ -111,12 +111,12 @@ ALTER TABLE t3 ALTER PRIMARY KEY USING COLUMNS(b); query TTTTB SHOW CONSTRAINTS FROM t3 ---- -t3 primary PRIMARY KEY PRIMARY KEY (b ASC) true +t3 t3_pkey PRIMARY KEY PRIMARY KEY (b ASC) true query TTTTB SHOW CONSTRAINTS FROM t4 ---- -t4 primary PRIMARY KEY PRIMARY KEY (d ASC) true +t4 t4_pkey PRIMARY KEY PRIMARY KEY (d ASC) true statement ok ALTER TABLE t4 ALTER PRIMARY KEY USING COLUMNS(e); diff --git a/pkg/sql/logictest/testdata/logic_test/information_schema b/pkg/sql/logictest/testdata/logic_test/information_schema index c97c518da29d..2deb664f62ab 100644 --- a/pkg/sql/logictest/testdata/logic_test/information_schema +++ b/pkg/sql/logictest/testdata/logic_test/information_schema @@ -1904,7 +1904,7 @@ constraint_catalog constraint_schema constraint_name table_catalog constraint_db public 3753077756_62_1_not_null constraint_db public t1 CHECK NO NO constraint_db public c2 constraint_db public t1 CHECK NO NO constraint_db public check_a constraint_db public t1 CHECK NO NO -constraint_db public primary constraint_db public t1 PRIMARY KEY NO NO +constraint_db public t1_pkey constraint_db public t1 PRIMARY KEY NO NO constraint_db public t1_a_key constraint_db public t1 UNIQUE NO NO constraint_db public 3753077756_63_2_not_null constraint_db public t2 CHECK NO NO constraint_db public fk constraint_db public t2 FOREIGN KEY NO NO @@ -1930,7 +1930,7 @@ constraint_db public t1 a constraint_db public constraint_db public t1 a constraint_db public check_a constraint_db public t1 a constraint_db public fk constraint_db public t1 a constraint_db public t1_a_key -constraint_db public t1 p constraint_db public primary +constraint_db public t1 p constraint_db public t1_pkey # Query issued by jOOQ in PostgresDatabase.loadCheckConstraints. query TTTT colnames @@ -2538,10 +2538,10 @@ SELECT * FROM information_schema.key_column_usage WHERE constraint_schema = 'pub constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name ordinal_position position_in_unique_constraint constraint_column public index_key constraint_column public t1 b 1 NULL constraint_column public index_key constraint_column public t1 c 2 NULL -constraint_column public primary constraint_column public t1 p 1 NULL constraint_column public t1_a_key constraint_column public t1 a 1 NULL +constraint_column public t1_pkey constraint_column public t1 p 1 NULL constraint_column public fk constraint_column public t2 t1_id 1 1 -constraint_column public primary constraint_column public t2 t1_id 1 NULL +constraint_column public t2_pkey constraint_column public t2 t1_id 1 NULL constraint_column public fk2 constraint_column public t3 a 1 1 constraint_column public fk2 constraint_column public t3 b 2 2 constraint_column public unique_a constraint_column public t4 a 1 NULL @@ -3942,16 +3942,16 @@ CREATE TABLE other_db.teststatics(id INT PRIMARY KEY, c INT, d INT, e STRING, IN query TTTTTTITIITTT colnames SELECT * FROM other_db.information_schema.statistics WHERE table_schema='public' AND table_name='teststatics' ORDER BY INDEX_SCHEMA,INDEX_NAME,SEQ_IN_INDEX ---- -table_catalog table_schema table_name non_unique index_schema index_name seq_in_index column_name COLLATION cardinality direction storing implicit -other_db public teststatics YES public idx_c 1 c NULL NULL ASC NO NO -other_db public teststatics YES public idx_c 2 id NULL NULL ASC NO YES -other_db public teststatics NO public idx_cd 1 c NULL NULL ASC NO NO -other_db public teststatics NO public idx_cd 2 d NULL NULL ASC NO NO -other_db public teststatics NO public idx_cd 3 id NULL NULL ASC NO YES -other_db public teststatics NO public primary 1 id NULL NULL ASC NO NO -other_db public teststatics NO public primary 2 c NULL NULL N/A YES NO -other_db public teststatics NO public primary 3 d NULL NULL N/A YES NO -other_db public teststatics NO public primary 4 e NULL NULL N/A YES NO +table_catalog table_schema table_name non_unique index_schema index_name seq_in_index column_name COLLATION cardinality direction storing implicit +other_db public teststatics YES public idx_c 1 c NULL NULL ASC NO NO +other_db public teststatics YES public idx_c 2 id NULL NULL ASC NO YES +other_db public teststatics NO public idx_cd 1 c NULL NULL ASC NO NO +other_db public teststatics NO public idx_cd 2 d NULL NULL ASC NO NO +other_db public teststatics NO public idx_cd 3 id NULL NULL ASC NO YES +other_db public teststatics NO public teststatics_pkey 1 id NULL NULL ASC NO NO +other_db public teststatics NO public teststatics_pkey 2 c NULL NULL N/A YES NO +other_db public teststatics NO public teststatics_pkey 3 d NULL NULL N/A YES NO +other_db public teststatics NO public teststatics_pkey 4 e NULL NULL N/A YES NO # Verify information_schema.views statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/insert b/pkg/sql/logictest/testdata/logic_test/insert index 72cf0b24293a..bdcd76dcfa8b 100644 --- a/pkg/sql/logictest/testdata/logic_test/insert +++ b/pkg/sql/logictest/testdata/logic_test/insert @@ -335,7 +335,7 @@ INSERT INTO abc VALUES (1, 2, 10) # Verify we get the correct message, even though internally the ConditionalPut # for the index key will also fail. -statement error pgcode 23505 duplicate key value violates unique constraint "primary"\nDETAIL: Key \(a,b\)=\(1,2\) already exists\. +statement error pgcode 23505 duplicate key value violates unique constraint "abc_pkey"\nDETAIL: Key \(a,b\)=\(1,2\) already exists\. INSERT INTO abc VALUES (1, 2, 20) statement ok @@ -357,7 +357,7 @@ CREATE TABLE blindcput ( # The optimization thresholds at 10 k/v operations, so we need at least that # many in one batch to trigger it. -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(x\)=\(1\) already exists\. +statement error duplicate key value violates unique constraint "blindcput_pkey"\nDETAIL: Key \(x\)=\(1\) already exists\. INSERT INTO blindcput values (1, 1), (2, 2), (3, 3), (4, 4), (1, 5) statement ok @@ -492,7 +492,7 @@ CREATE TABLE public.sw ( ec STRING COLLATE en NULL, fc STRING(3) COLLATE en NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT sw_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, e, f, g, ac, bc, cc, dc, ec, fc, rowid) ) @@ -605,7 +605,7 @@ SELECT create_statement FROM [SHOW CREATE t29494] CREATE TABLE public.t29494 ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t29494_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) @@ -646,7 +646,7 @@ CREATE TABLE public.t32759 ( x INT8 NULL, z INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t32759_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, z, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/int_size b/pkg/sql/logictest/testdata/logic_test/int_size index 10efa53dc0f0..c925d29cbd95 100644 --- a/pkg/sql/logictest/testdata/logic_test/int_size +++ b/pkg/sql/logictest/testdata/logic_test/int_size @@ -24,7 +24,7 @@ SHOW CREATE TABLE i4 i4 CREATE TABLE public.i4 ( i4 INT4 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i4_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i4, rowid) ) @@ -47,7 +47,7 @@ SHOW CREATE TABLE i8 i8 CREATE TABLE public.i8 ( i8 INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i8_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i8, rowid) ) @@ -68,7 +68,7 @@ SHOW CREATE TABLE late4 late4 CREATE TABLE public.late4 ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT late4_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -101,7 +101,7 @@ SHOW CREATE TABLE i4_rowid i4_rowid CREATE TABLE public.i4_rowid ( a INT8 NOT NULL DEFAULT unique_rowid(), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i4_rowid_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -117,7 +117,7 @@ SHOW CREATE TABLE i8_rowid i8_rowid CREATE TABLE public.i8_rowid ( a INT8 NOT NULL DEFAULT unique_rowid(), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i8_rowid_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -136,7 +136,7 @@ SHOW CREATE TABLE i4_sql_sequence i4_sql_sequence CREATE TABLE public.i4_sql_sequence ( a INT4 NOT NULL DEFAULT nextval('public.i4_sql_sequence_a_seq'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i4_sql_sequence_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -152,7 +152,7 @@ SHOW CREATE TABLE i8_sql_sequence i8_sql_sequence CREATE TABLE public.i8_sql_sequence ( a INT8 NOT NULL DEFAULT nextval('public.i8_sql_sequence_a_seq'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i8_sql_sequence_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -172,7 +172,7 @@ SHOW CREATE TABLE i4_virtual_sequence i4_virtual_sequence CREATE TABLE public.i4_virtual_sequence ( a INT8 NOT NULL DEFAULT nextval('public.i4_virtual_sequence_a_seq'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i4_virtual_sequence_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) @@ -188,6 +188,6 @@ SHOW CREATE TABLE i8_virtual_sequence i8_virtual_sequence CREATE TABLE public.i8_virtual_sequence ( a INT8 NOT NULL DEFAULT nextval('public.i8_virtual_sequence_a_seq'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT i8_virtual_sequence_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/inverted_index b/pkg/sql/logictest/testdata/logic_test/inverted_index index 1ec1b12110db..1cd6051dc751 100644 --- a/pkg/sql/logictest/testdata/logic_test/inverted_index +++ b/pkg/sql/logictest/testdata/logic_test/inverted_index @@ -41,7 +41,7 @@ c CREATE TABLE public.c ( foo JSONB NULL, "bAr" JSONB NULL, "qUuX" JSONB NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT c_pkey PRIMARY KEY (id ASC), INVERTED INDEX c_foo_idx (foo), INVERTED INDEX "c_bAr_idx" ("bAr"), FAMILY "primary" (id, foo, "bAr", "qUuX") @@ -1116,7 +1116,7 @@ c CREATE TABLE public.c ( id INT8 NOT NULL, foo INT8[] NULL, bar STRING[] NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT c_pkey PRIMARY KEY (id ASC), INVERTED INDEX c_foo_idx (foo), INVERTED INDEX c_bar_idx (bar), FAMILY "primary" (id, foo, bar) diff --git a/pkg/sql/logictest/testdata/logic_test/inverted_index_multi_column b/pkg/sql/logictest/testdata/logic_test/inverted_index_multi_column index be4bdd80a7cd..4b23a14f93fa 100644 --- a/pkg/sql/logictest/testdata/logic_test/inverted_index_multi_column +++ b/pkg/sql/logictest/testdata/logic_test/inverted_index_multi_column @@ -37,7 +37,7 @@ CREATE TABLE public.s ( k INT8 NOT NULL, a INT8 NULL, geom GEOMETRY NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT s_pkey PRIMARY KEY (k ASC), INVERTED INDEX s_a_geom_idx (a, geom) WITH (geometry_min_x=0), FAMILY fam_0_k (k), FAMILY fam_1_a (a), @@ -63,7 +63,7 @@ CREATE TABLE public.drop_j ( a INT8 NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT drop_j_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_a_b_j_rowid (a, b, rowid) ) @@ -86,7 +86,7 @@ CREATE TABLE public.drop_a ( b INT8 NULL, j JSONB NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT drop_a_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_a_b_j_rowid (b, j, rowid) ) @@ -103,7 +103,7 @@ CREATE TABLE public.dst ( b INT8 NULL, j JSONB NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT src_pkey PRIMARY KEY (rowid ASC), INVERTED INDEX src_a_j_idx (a, j), INVERTED INDEX src_a_b_j_idx (a, b, j), FAMILY "primary" (a, b, j, rowid) diff --git a/pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial b/pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial index 997e60ad0aaa..dfc1b987c481 100644 --- a/pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial +++ b/pkg/sql/logictest/testdata/logic_test/inverted_join_geospatial @@ -125,7 +125,7 @@ ON ST_Intersects(ltable.geom1, rtable.geom) OR ST_DWithin(rtable.geom, ltable.ge # Run the same two queries with the primary index to verify that we get the # same results. query II -SELECT lk, rk FROM ltable JOIN rtable@primary +SELECT lk, rk FROM ltable JOIN rtable@rtable_pkey ON ST_Intersects(ltable.geom1, rtable.geom) AND ST_DWithin(rtable.geom, ltable.geom2, 2) ORDER BY (lk, rk) ---- 1 13 @@ -136,7 +136,7 @@ ON ST_Intersects(ltable.geom1, rtable.geom) AND ST_DWithin(rtable.geom, ltable.g 3 16 query II -SELECT lk, rk FROM ltable JOIN rtable@primary +SELECT lk, rk FROM ltable JOIN rtable@rtable_pkey ON ST_Intersects(ltable.geom1, rtable.geom) OR ST_DWithin(rtable.geom, ltable.geom2, 2) ORDER BY (lk, rk) ---- 1 12 @@ -409,7 +409,7 @@ INSERT INTO g VALUES # This query performs an inverted join. query II -SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k +SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k ---- 1 1 1 2 @@ -417,7 +417,7 @@ SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 WHERE ST_Contains(g1.geo # This query performs a cross join followed by a filter. query II -SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k +SELECT g1.k, g2.k FROM g@g_pkey AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k ---- 1 1 1 2 @@ -427,9 +427,9 @@ SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 WHERE ST_Contains(g1.geo # There should be no rows output. query IIII SELECT * FROM -(SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 WHERE ST_Contains(g1.geom, g2.geom)) AS inv_join(k1, k2) +(SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom)) AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 WHERE ST_Contains(g1.geom, g2.geom)) AS cross_join(k1, k2) +(SELECT g1.k, g2.k FROM g@g_pkey AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom)) AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- @@ -437,7 +437,7 @@ WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL # Regression test for #55648. # This query performs an inverted join with an additional filter. query II -SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 +SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)'::geometry)) AND g2.k < 20 @@ -448,7 +448,7 @@ ORDER BY g1.k, g2.k # This query performs a cross join followed by a filter. query II -SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 +SELECT g1.k, g2.k FROM g@g_pkey AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)'::geometry)) AND g2.k < 20 @@ -462,14 +462,14 @@ ORDER BY g1.k, g2.k query IIII SELECT * FROM ( - SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 + SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)'::geometry)) AND g2.k < 20 ) AS inv_join(k1, k2) FULL OUTER JOIN ( - SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 + SELECT g1.k, g2.k FROM g@g_pkey AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)'::geometry)) AND g2.k < 20 diff --git a/pkg/sql/logictest/testdata/logic_test/inverted_join_json_array b/pkg/sql/logictest/testdata/logic_test/inverted_join_json_array index ff6cf7c555f6..044b9c0f8dfe 100644 --- a/pkg/sql/logictest/testdata/logic_test/inverted_join_json_array +++ b/pkg/sql/logictest/testdata/logic_test/inverted_join_json_array @@ -191,7 +191,7 @@ SELECT * FROM json_tab@foo_inv AS j1, json_tab AS j2 WHERE j1.b @> j2.b ORDER BY # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM json_tab@primary AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b @> j2.b ORDER BY j1.a, j2.a +SELECT * FROM json_tab@json_tab_pkey AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b @> j2.b ORDER BY j1.a, j2.a ---- 1 {"a": "b"} 1 {"a": "b"} 1 {"a": "b"} 17 {} @@ -321,7 +321,7 @@ query IIII SELECT * FROM (SELECT j1.a, j2.a FROM json_tab@foo_inv AS j1, json_tab AS j2 WHERE j1.b @> j2.b) AS inv_join(a1, a2) FULL OUTER JOIN -(SELECT j1.a, j2.a FROM json_tab@primary AS j1, json_tab AS j2 WHERE j1.b @> j2.b) AS cross_join(a1, a2) +(SELECT j1.a, j2.a FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b @> j2.b) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 WHERE inv_join.a1 IS NULL OR cross_join.a1 IS NULL ---- @@ -454,7 +454,7 @@ SELECT * FROM json_tab@foo_inv AS j1, json_tab AS j2 WHERE j1.b <@ j2.b ORDER BY # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM json_tab@primary AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b <@ j2.b ORDER BY j1.a, j2.a +SELECT * FROM json_tab@json_tab_pkey AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b <@ j2.b ORDER BY j1.a, j2.a ---- 1 {"a": "b"} 1 {"a": "b"} 1 {"a": "b"} 7 {"a": "b", "c": "d"} @@ -584,7 +584,7 @@ query IIII SELECT * FROM (SELECT j1.a, j2.a FROM json_tab@foo_inv AS j1, json_tab AS j2 WHERE j1.b <@ j2.b) AS inv_join(a1, a2) FULL OUTER JOIN -(SELECT j1.a, j2.a FROM json_tab@primary AS j1, json_tab AS j2 WHERE j1.b <@ j2.b) AS cross_join(a1, a2) +(SELECT j1.a, j2.a FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b <@ j2.b) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 WHERE inv_join.a1 IS NULL OR cross_join.a1 IS NULL ---- @@ -615,7 +615,7 @@ ORDER BY j1.a, j2.a # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM json_tab@primary AS j1 CROSS HASH JOIN json_tab AS j2 +SELECT * FROM json_tab@json_tab_pkey AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b @> j2.b AND j1.b @> '{"a": {}}' AND j2.a < 20 ORDER BY j1.a, j2.a ---- @@ -647,7 +647,7 @@ SELECT * FROM ) AS inv_join(a1, a2) FULL OUTER JOIN ( - SELECT j1.a, j2.a FROM json_tab@primary AS j1, json_tab AS j2 + SELECT j1.a, j2.a FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b @> j2.b AND j1.b @> '{"a": {}}' AND j2.a < 20 ) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 @@ -678,7 +678,7 @@ ORDER BY j1.a, j2.a # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM json_tab@primary AS j1 CROSS HASH JOIN json_tab AS j2 +SELECT * FROM json_tab@json_tab_pkey AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b <@ j2.b AND j1.b <@ '{"a": {}}' AND j2.a < 20 ORDER BY j1.a, j2.a ---- @@ -708,7 +708,7 @@ SELECT * FROM ) AS inv_join(a1, a2) FULL OUTER JOIN ( - SELECT j1.a, j2.a FROM json_tab@primary AS j1, json_tab AS j2 + SELECT j1.a, j2.a FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b <@ j2.b AND j1.b <@ '{"a": {}}' AND j2.a < 20 ) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 @@ -994,7 +994,7 @@ SELECT * FROM array_tab@foo_inv AS a1, array_tab AS a2 WHERE a1.b @> a2.b ORDER # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM array_tab@primary AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b @> a2.b ORDER BY a1.a, a2.a +SELECT * FROM array_tab@array_tab_pkey AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b @> a2.b ORDER BY a1.a, a2.a ---- 1 {} 1 {} 2 {1} 1 {} @@ -1022,7 +1022,7 @@ query IIII SELECT * FROM (SELECT a1.a, a2.a FROM array_tab@foo_inv AS a1, array_tab AS a2 WHERE a1.b @> a2.b) AS inv_join(a1, a2) FULL OUTER JOIN -(SELECT a1.a, a2.a FROM array_tab@primary AS a1, array_tab AS a2 WHERE a1.b @> a2.b) AS cross_join(a1, a2) +(SELECT a1.a, a2.a FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b @> a2.b) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 WHERE inv_join.a1 IS NULL OR cross_join.a1 IS NULL ---- @@ -1053,7 +1053,7 @@ SELECT * FROM array_tab@foo_inv AS a1, array_tab AS a2 WHERE a1.b <@ a2.b ORDER # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM array_tab@primary AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b <@ a2.b ORDER BY a1.a, a2.a +SELECT * FROM array_tab@array_tab_pkey AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b <@ a2.b ORDER BY a1.a, a2.a ---- 1 {} 1 {} 1 {} 2 {1} @@ -1081,14 +1081,14 @@ query IIII SELECT * FROM (SELECT a1.a, a2.a FROM array_tab@foo_inv AS a1, array_tab AS a2 WHERE a1.b <@ a2.b) AS inv_join(a1, a2) FULL OUTER JOIN -(SELECT a1.a, a2.a FROM array_tab@primary AS a1, array_tab AS a2 WHERE a1.b <@ a2.b) AS cross_join(a1, a2) +(SELECT a1.a, a2.a FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b <@ a2.b) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 WHERE inv_join.a1 IS NULL OR cross_join.a1 IS NULL ---- # This query performs an inverted join with an additional filter. query ITIT -SELECT a1.*, a2.* FROM array_tab@primary AS a2 +SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -1108,7 +1108,7 @@ ORDER BY a1.a, a2.a # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM array_tab@primary AS a1 CROSS HASH JOIN array_tab AS a2 +SELECT * FROM array_tab@array_tab_pkey AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a ---- @@ -1130,13 +1130,13 @@ ORDER BY a1.a, a2.a query IIII SELECT * FROM ( - SELECT a1.a, a2.a FROM array_tab@primary AS a2 + SELECT a1.a, a2.a FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ) AS inv_join(a1, a2) FULL OUTER JOIN ( - SELECT a1.a, a2.a FROM array_tab@primary AS a1, array_tab AS a2 + SELECT a1.a, a2.a FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 @@ -1145,7 +1145,7 @@ WHERE inv_join.a1 IS NULL OR cross_join.a1 IS NULL # This query performs an inverted join with an additional filter. query ITIT -SELECT a1.*, a2.* FROM array_tab@primary AS a2 +SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -1159,7 +1159,7 @@ ORDER BY a1.a, a2.a # This query performs a cross join followed by a filter. query ITIT -SELECT * FROM array_tab@primary AS a1 CROSS HASH JOIN array_tab AS a2 +SELECT * FROM array_tab@array_tab_pkey AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a ---- @@ -1175,13 +1175,13 @@ ORDER BY a1.a, a2.a query IIII SELECT * FROM ( - SELECT a1.a, a2.a FROM array_tab@primary AS a2 + SELECT a1.a, a2.a FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ) AS inv_join(a1, a2) FULL OUTER JOIN ( - SELECT a1.a, a2.a FROM array_tab@primary AS a1, array_tab AS a2 + SELECT a1.a, a2.a FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ) AS cross_join(a1, a2) ON inv_join.a1 = cross_join.a1 AND inv_join.a2 = cross_join.a2 @@ -1190,7 +1190,7 @@ WHERE inv_join.a1 IS NULL OR cross_join.a1 IS NULL # This query performs a left inverted join with an additional filter. query ITIT -SELECT a1.*, a2.* FROM array_tab@primary AS a2 +SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 LEFT INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -1214,7 +1214,7 @@ NULL NULL 8 NULL # This query performs a left inverted join with an additional filter. query ITIT -SELECT a1.*, a2.* FROM array_tab@primary AS a2 +SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 LEFT INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -1232,7 +1232,7 @@ NULL NULL 8 NULL # This query performs a semi inverted join. query IT -SELECT a2.* FROM array_tab@primary AS a2 WHERE EXISTS ( +SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b @> a2.b ) @@ -1247,7 +1247,7 @@ ORDER BY a2.a # This query performs a semi inverted join. query IT -SELECT a2.* FROM array_tab@primary AS a2 WHERE EXISTS ( +SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b <@ a2.b ) @@ -1263,7 +1263,7 @@ ORDER BY a2.a # This query performs an anti inverted join. query IT -SELECT a2.* FROM array_tab@primary AS a2 WHERE NOT EXISTS ( +SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE NOT EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b @> a2.b ) @@ -1274,7 +1274,7 @@ ORDER BY a2.a # This query performs an anti inverted join. query IT -SELECT a2.* FROM array_tab@primary AS a2 WHERE NOT EXISTS ( +SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE NOT EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b <@ a2.b ) diff --git a/pkg/sql/logictest/testdata/logic_test/inverted_join_multi_column b/pkg/sql/logictest/testdata/logic_test/inverted_join_multi_column index 80805d271fc9..5068deac13e4 100644 --- a/pkg/sql/logictest/testdata/logic_test/inverted_join_multi_column +++ b/pkg/sql/logictest/testdata/logic_test/inverted_join_multi_column @@ -78,7 +78,7 @@ query IIII SELECT * FROM (SELECT j1.k, j2.rowid FROM j1, j2@ij_idx WHERE i IN (10, 20) AND j2.j @> j1.j) AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT j1.k, j2.rowid FROM j1, j2@primary WHERE i IN (10, 20) AND j2.j @> j1.j) AS cross_join(k1, k2) +(SELECT j1.k, j2.rowid FROM j1, j2@j2_pkey WHERE i IN (10, 20) AND j2.j @> j1.j) AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- @@ -90,7 +90,7 @@ query IIII SELECT * FROM (SELECT j1.k, j2.rowid FROM j1, j2@isj_idx WHERE i IN (10, 20) AND s IN ('foo', 'bar') AND j2.j @> j1.j) AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT j1.k, j2.rowid FROM j1, j2@primary WHERE i IN (10, 20) AND s IN ('foo', 'bar') AND j2.j @> j1.j) AS cross_join(k1, k2) +(SELECT j1.k, j2.rowid FROM j1, j2@j2_pkey WHERE i IN (10, 20) AND s IN ('foo', 'bar') AND j2.j @> j1.j) AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- @@ -102,7 +102,7 @@ query IIII SELECT * FROM (SELECT j1.k, j2.rowid FROM j1 INNER INVERTED JOIN j2@ij_idx ON i IN (10, 20) AND j2.j @> j1.j AND j2.j @> '{"a": {}}') AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT j1.k, j2.rowid FROM j1, j2@primary WHERE i IN (10, 20) AND j2.j @> j1.j AND j2.j @> '{"a": {}}') AS cross_join(k1, k2) +(SELECT j1.k, j2.rowid FROM j1, j2@j2_pkey WHERE i IN (10, 20) AND j2.j @> j1.j AND j2.j @> '{"a": {}}') AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- @@ -266,7 +266,7 @@ query IIII SELECT * FROM (SELECT a1.k, a2.rowid FROM a1, a2@ia_idx WHERE i IN (10, 20) AND a2.a @> a1.a) AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT a1.k, a2.rowid FROM a1, a2@primary WHERE i IN (10, 20) AND a2.a @> a1.a) AS cross_join(k1, k2) +(SELECT a1.k, a2.rowid FROM a1, a2@a2_pkey WHERE i IN (10, 20) AND a2.a @> a1.a) AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- @@ -278,14 +278,14 @@ query IIII SELECT * FROM (SELECT a1.k, a2.rowid FROM a1, a2@ia_idx WHERE i IN (10, 20) AND a2.a @> a1.a AND a1.a @> '{1}') AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT a1.k, a2.rowid FROM a1, a2@primary WHERE i IN (10, 20) AND a2.a @> a1.a AND a1.a @> '{1}') AS cross_join(k1, k2) +(SELECT a1.k, a2.rowid FROM a1, a2@a2_pkey WHERE i IN (10, 20) AND a2.a @> a1.a AND a1.a @> '{1}') AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- # This query performs a left inverted join with an additional filter. query ITIT -SELECT a1.*, a2.* FROM a1@primary +SELECT a1.*, a2.* FROM a1@a1_pkey LEFT INVERTED JOIN a2@ia_idx ON a2.a @> a1.a AND a2.a @> '{1}' AND a2.i = 10 ORDER BY a1.a, a2.a @@ -311,7 +311,7 @@ ORDER BY a1.a, a2.a # This query performs a left inverted join on ij_idx with no matching rows on # the right. query ITIT -SELECT a1.*, a2.* FROM a1@primary +SELECT a1.*, a2.* FROM a1@a1_pkey LEFT INVERTED JOIN a2@ia_idx ON a2.a @> a1.a AND a2.a = '{100}' AND a2.i = 10 ORDER BY a1.a, a2.a @@ -327,7 +327,7 @@ ORDER BY a1.a, a2.a # This query performs a semi inverted join. query IT -SELECT a1.* FROM a1@primary WHERE EXISTS ( +SELECT a1.* FROM a1@a1_pkey WHERE EXISTS ( SELECT * FROM a2@ia_idx WHERE a2.a @> a1.a AND a2.i = 10 ) @@ -342,7 +342,7 @@ ORDER BY a1.k # This query performs an anti inverted join. query IT -SELECT a1.* FROM a1@primary WHERE NOT EXISTS ( +SELECT a1.* FROM a1@a1_pkey WHERE NOT EXISTS ( SELECT * FROM a2@ia_idx WHERE a2.a @> a1.a AND a2.i = 10 ) @@ -382,7 +382,7 @@ query IIII SELECT * FROM (SELECT g1.k, g2.rowid FROM g1, g2@igeom_idx WHERE i IN (10, 20) AND ST_Contains(g2.geom, g1.geom)) AS inv_join(k1, k2) FULL OUTER JOIN -(SELECT g1.k, g2.rowid FROM g1, g2@primary WHERE i IN (10, 20) AND ST_Contains(g2.geom, g1.geom)) AS cross_join(k1, k2) +(SELECT g1.k, g2.rowid FROM g1, g2@g2_pkey WHERE i IN (10, 20) AND ST_Contains(g2.geom, g1.geom)) AS cross_join(k1, k2) ON inv_join.k1 = cross_join.k1 AND inv_join.k2 = cross_join.k2 WHERE inv_join.k1 IS NULL OR cross_join.k1 IS NULL ---- diff --git a/pkg/sql/logictest/testdata/logic_test/join b/pkg/sql/logictest/testdata/logic_test/join index 26ab251b67ea..c23a56b5af6e 100644 --- a/pkg/sql/logictest/testdata/logic_test/join +++ b/pkg/sql/logictest/testdata/logic_test/join @@ -558,7 +558,7 @@ SELECT NULL::text AS pktable_cat, con.conname, pos.n ---- -NULL public customers id NULL public orders cust 1 3 3 fk_cust_ref_customers primary 7 +NULL public customers id NULL public orders cust 1 3 3 fk_cust_ref_customers customers_pkey 7 # Tests for filter propagation through joins. diff --git a/pkg/sql/logictest/testdata/logic_test/lock_timeout b/pkg/sql/logictest/testdata/logic_test/lock_timeout index a260d6532054..ddba4a4a37ae 100644 --- a/pkg/sql/logictest/testdata/logic_test/lock_timeout +++ b/pkg/sql/logictest/testdata/logic_test/lock_timeout @@ -18,22 +18,22 @@ user testuser statement ok SET lock_timeout = '1ms' -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t FOR UPDATE -statement error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t FOR UPDATE NOWAIT -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t WHERE k = 1 -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t WHERE k = 1 FOR UPDATE -statement error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t WHERE k = 1 FOR UPDATE NOWAIT statement ok @@ -45,47 +45,47 @@ SELECT * FROM t WHERE k = 2 FOR UPDATE statement ok SELECT * FROM t WHERE k = 2 FOR UPDATE NOWAIT -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t WHERE v = 9 -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t WHERE v = 9 FOR UPDATE -statement error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t WHERE v = 9 FOR UPDATE NOWAIT -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey INSERT INTO t VALUES (1, 3) statement ok INSERT INTO t VALUES (2, 3) -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey UPSERT INTO t VALUES (1, 3) statement ok UPSERT INTO t VALUES (2, 3) -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey UPDATE t SET v = 4 -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey UPDATE t SET v = 4 WHERE k = 1 statement ok UPDATE t SET v = 4 WHERE k = 2 -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey UPDATE t SET v = 4 WHERE v = 9 -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey DELETE FROM t -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey DELETE FROM t WHERE k = 1 statement ok DELETE FROM t WHERE k = 2 -statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@primary +statement error pgcode 55P03 canceling statement due to lock timeout on row \(k\)=\(1\) in t@t_pkey DELETE FROM t WHERE v = 9 diff --git a/pkg/sql/logictest/testdata/logic_test/multi_statement b/pkg/sql/logictest/testdata/logic_test/multi_statement index 40270962ca33..08a4a289f13d 100644 --- a/pkg/sql/logictest/testdata/logic_test/multi_statement +++ b/pkg/sql/logictest/testdata/logic_test/multi_statement @@ -19,7 +19,7 @@ c d # error if either statement returns an error # first statement returns an error. Second stmt shouldn't execute. -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\('a'\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\('a'\) already exists\. INSERT INTO kv (k,v) VALUES ('a', 'b'); INSERT INTO kv (k,v) VALUES ('e', 'f') query TT rowsort @@ -29,7 +29,7 @@ a b c d # second statement returns an error -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\('a'\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\('a'\) already exists\. INSERT INTO kv (k,v) VALUES ('g', 'h'); INSERT INTO kv (k,v) VALUES ('a', 'b') query TT rowsort diff --git a/pkg/sql/logictest/testdata/logic_test/name_escapes b/pkg/sql/logictest/testdata/logic_test/name_escapes index 3314fe8607de..b2eb99a74fc0 100644 --- a/pkg/sql/logictest/testdata/logic_test/name_escapes +++ b/pkg/sql/logictest/testdata/logic_test/name_escapes @@ -60,6 +60,6 @@ SHOW CREATE TABLE ";--dontask" b INT8 NULL, c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT ";--dontask_pkey" PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/namespace b/pkg/sql/logictest/testdata/logic_test/namespace index 87220bfccb1f..794f7b688d05 100644 --- a/pkg/sql/logictest/testdata/logic_test/namespace +++ b/pkg/sql/logictest/testdata/logic_test/namespace @@ -77,7 +77,7 @@ DROP TABLE pg_type; RESET search_path; SET database = test # Unqualified index name resolution. statement ok -ALTER INDEX "primary" RENAME TO a_pk +ALTER INDEX a_pkey RENAME TO a_pk # Schema-qualified index name resolution. statement ok @@ -91,12 +91,12 @@ statement ok CREATE DATABASE public; CREATE TABLE public.public.t(a INT) # We can't see the DB "public" with DB-qualified index name resolution. -statement error index "primary" does not exist -ALTER INDEX public."primary" RENAME TO t_pk +statement error index "t_pkey" does not exist +ALTER INDEX public.t_pkey RENAME TO t_pk # But we can see it with sufficient qualification. statement ok -ALTER INDEX public.public."primary" RENAME TO t_pk +ALTER INDEX public.public.t_pkey RENAME TO t_pk # If the search path is invalid, we get a special error. statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/no_primary_key b/pkg/sql/logictest/testdata/logic_test/no_primary_key index 7c5d06bf7701..2d355e5cd691 100644 --- a/pkg/sql/logictest/testdata/logic_test/no_primary_key +++ b/pkg/sql/logictest/testdata/logic_test/no_primary_key @@ -55,10 +55,10 @@ SELECT rowid FROM t WHERE a = 10 query TTBTTTB SHOW COLUMNS FROM t ---- -a INT8 true NULL · {primary} false -b INT8 true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true -c STRING true NULL · {primary} false +a INT8 true NULL · {t_pkey} false +b INT8 true NULL · {t_pkey} false +rowid INT8 false unique_rowid() · {t_pkey} true +c STRING true NULL · {t_pkey} false statement ok CREATE INDEX a_idx ON t (a) diff --git a/pkg/sql/logictest/testdata/logic_test/on_update b/pkg/sql/logictest/testdata/logic_test/on_update index ff397748bc52..79a60acc978a 100644 --- a/pkg/sql/logictest/testdata/logic_test/on_update +++ b/pkg/sql/logictest/testdata/logic_test/on_update @@ -205,7 +205,7 @@ test_show_fk CREATE TABLE public.test_show_fk ( p STRING NOT NULL, j STRING NULL, k STRING NULL ON UPDATE 'regress':::STRING, - CONSTRAINT "primary" PRIMARY KEY (p ASC), + CONSTRAINT test_show_fk_pkey PRIMARY KEY (p ASC), CONSTRAINT fk_j_ref_test_fk_base FOREIGN KEY (j) REFERENCES public.test_fk_base(j) ON UPDATE CASCADE, FAMILY fam_0_p (p), FAMILY fam_1_j (j), diff --git a/pkg/sql/logictest/testdata/logic_test/orms b/pkg/sql/logictest/testdata/logic_test/orms index cbad1d07cc0b..9811decdac14 100644 --- a/pkg/sql/logictest/testdata/logic_test/orms +++ b/pkg/sql/logictest/testdata/logic_test/orms @@ -73,7 +73,7 @@ ORDER BY i.relname ---- name primary unique indkey column_indexes column_names definition customers_id_idx false false 2 {1,2} {name,id} CREATE INDEX customers_id_idx ON test.public.customers USING btree (id ASC) -primary true true 1 {1,2} {name,id} CREATE UNIQUE INDEX "primary" ON test.public.customers USING btree (name ASC) +customers_pkey true true 1 {1,2} {name,id} CREATE UNIQUE INDEX customers_pkey ON test.public.customers USING btree (name ASC) query TT colnames diff --git a/pkg/sql/logictest/testdata/logic_test/parallel_stmts_compat b/pkg/sql/logictest/testdata/logic_test/parallel_stmts_compat index ec95a771de25..50cf73d1276d 100644 --- a/pkg/sql/logictest/testdata/logic_test/parallel_stmts_compat +++ b/pkg/sql/logictest/testdata/logic_test/parallel_stmts_compat @@ -21,7 +21,7 @@ CREATE TABLE fk( statement ok INSERT INTO kv VALUES (1, 2) RETURNING NOTHING -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(1\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(1\) already exists\. INSERT INTO kv VALUES (1, 2) RETURNING NOTHING statement ok @@ -33,7 +33,7 @@ UPSERT INTO kv VALUES (2, 500) RETURNING NOTHING statement ok UPDATE kv SET v = k WHERE k = 3 RETURNING NOTHING -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(1\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(1\) already exists\. UPDATE kv SET k = 1 WHERE k = 2 RETURNING NOTHING statement ok @@ -84,7 +84,7 @@ BEGIN statement ok INSERT INTO kv VALUES (4, 5) RETURNING NOTHING -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(2\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(2\) already exists\. INSERT INTO kv VALUES (2, 3) RETURNING NOTHING statement error current transaction is aborted, commands ignored until end of transaction block @@ -190,7 +190,7 @@ BEGIN statement ok UPDATE kv SET k = 9 WHERE k = 1 RETURNING NOTHING -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(3\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(3\) already exists\. UPDATE kv SET k = 3 WHERE k = 2 RETURNING NOTHING statement error current transaction is aborted, commands ignored until end of transaction block @@ -316,7 +316,7 @@ SELECT k, v FROM kv ORDER BY k statement ok BEGIN -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(1\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(1\) already exists\. INSERT INTO kv VALUES (1, 2) RETURNING NOTHING statement error current transaction is aborted, commands ignored until end of transaction block @@ -361,7 +361,7 @@ BEGIN statement ok EXECUTE x(1, 2) -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(1\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(1\) already exists\. EXECUTE x(1, 2) statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/partial_index b/pkg/sql/logictest/testdata/logic_test/partial_index index a5a6c4260cf3..00ccc847d7fc 100644 --- a/pkg/sql/logictest/testdata/logic_test/partial_index +++ b/pkg/sql/logictest/testdata/logic_test/partial_index @@ -116,7 +116,7 @@ SHOW CREATE TABLE t6 t6 CREATE TABLE public.t6 ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t6_pkey PRIMARY KEY (rowid ASC), INDEX t6_a_idx (a ASC) WHERE a > 0:::INT8, INDEX t6_a_idx1 (a ASC) WHERE a > 1:::INT8, INDEX t6_a_idx2 (a DESC) WHERE a > 2:::INT8, @@ -140,7 +140,7 @@ SHOW CREATE TABLE t6 t6 CREATE TABLE public.t6 ( b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t6_pkey PRIMARY KEY (rowid ASC), INDEX t6_a_idx (b ASC) WHERE b > 0:::INT8, INDEX t6_a_idx1 (b ASC) WHERE b > 1:::INT8, INDEX t6_a_idx2 (b DESC) WHERE b > 2:::INT8, @@ -164,7 +164,7 @@ SHOW CREATE TABLE t7 t7 CREATE TABLE public.t7 ( b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t6_pkey PRIMARY KEY (rowid ASC), INDEX t6_a_idx (b ASC) WHERE b > 0:::INT8, INDEX t6_a_idx1 (b ASC) WHERE b > 1:::INT8, INDEX t6_a_idx2 (b DESC) WHERE b > 2:::INT8, @@ -199,7 +199,7 @@ t8 CREATE TABLE public.t8 ( a INT8 NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t8_pkey PRIMARY KEY (rowid ASC), INDEX t8_a_idx (a ASC) WHERE b > 0:::INT8, FAMILY fam_0_a_b_c_rowid (a, b, rowid) ) @@ -220,7 +220,7 @@ t10 CREATE TABLE public.t10 ( a INT8 NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t9_pkey PRIMARY KEY (rowid ASC), INDEX t9_a_idx (a ASC) WHERE b > 1:::INT8, FAMILY "primary" (a, b, rowid) ) @@ -1152,7 +1152,7 @@ enum_table_show CREATE TABLE public.enum_table_show ( a INT8 NULL, b public.enum_type NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT enum_table_show_pkey PRIMARY KEY (rowid ASC), INDEX i (a ASC) WHERE b IN ('foo':::public.enum_type, 'bar':::public.enum_type), FAMILY fam_0_a_b_rowid (a, b, rowid) ) @@ -1459,7 +1459,7 @@ statement error duplicate key value violates unique constraint "idx"\nDETAIL: Ke INSERT INTO virt (a, b) VALUES (1, 2), (6, 6) ON CONFLICT (b) WHERE c > 10 DO UPDATE SET b = 5 # Conflict with PK a=1 and no conflict with b. -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(a\)=\(1\) already exists\. +statement error duplicate key value violates unique constraint "virt_pkey"\nDETAIL: Key \(a\)=\(1\) already exists\. INSERT INTO virt (a, b) VALUES (1, 3), (7, 7) ON CONFLICT (b) WHERE c > 10 DO UPDATE SET b = 8 statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/partial_txn_commit b/pkg/sql/logictest/testdata/logic_test/partial_txn_commit index 10376dab91ef..363df6a1fd94 100644 --- a/pkg/sql/logictest/testdata/logic_test/partial_txn_commit +++ b/pkg/sql/logictest/testdata/logic_test/partial_txn_commit @@ -33,6 +33,6 @@ SHOW CREATE t t CREATE TABLE public.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/pg_builtins b/pkg/sql/logictest/testdata/logic_test/pg_builtins index 20a04ad6f89e..b7a9fd3917d3 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_builtins +++ b/pkg/sql/logictest/testdata/logic_test/pg_builtins @@ -513,7 +513,7 @@ ORDER BY i.relname query TT SELECT relname, indkey FROM indexes ORDER BY relname DESC ---- -primary {1} +indexed_pkey {1} indexed_c_a_idx {3,1} indexed_b_d_idx {2,4} @@ -525,10 +525,10 @@ SELECT relname, FROM indexes ORDER BY relname DESC, input ---- -primary {1} 1 1 -primary {1} 2 NULL -primary {1} 3 NULL -primary {1} 4 NULL +indexed_pkey {1} 1 1 +indexed_pkey {1} 2 NULL +indexed_pkey {1} 3 NULL +indexed_pkey {1} 4 NULL indexed_c_a_idx {3,1} 1 2 indexed_c_a_idx {3,1} 2 NULL indexed_c_a_idx {3,1} 3 1 diff --git a/pkg/sql/logictest/testdata/logic_test/pg_catalog b/pkg/sql/logictest/testdata/logic_test/pg_catalog index c87890512e56..f794187b4640 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_catalog +++ b/pkg/sql/logictest/testdata/logic_test/pg_catalog @@ -534,29 +534,29 @@ WHERE n.nspname = 'public' ---- oid relname relnamespace reltype reloftype relowner relam relfilenode reltablespace 55 t1 2332901747 100055 0 1546506610 2631952481 0 0 -450499963 primary 2332901747 0 0 1546506610 2631952481 0 0 +450499963 t1_pkey 2332901747 0 0 1546506610 2631952481 0 0 450499960 t1_a_key 2332901747 0 0 1546506610 2631952481 0 0 450499961 index_key 2332901747 0 0 1546506610 2631952481 0 0 56 t1_m_seq 2332901747 100056 0 1546506610 0 0 0 57 t1_n_seq 2332901747 100057 0 1546506610 0 0 0 58 t2 2332901747 100058 0 1546506610 2631952481 0 0 -710236230 primary 2332901747 0 0 1546506610 2631952481 0 0 +710236230 t2_pkey 2332901747 0 0 1546506610 2631952481 0 0 710236229 t2_t1_id_idx 2332901747 0 0 1546506610 2631952481 0 0 59 t3 2332901747 100059 0 1546506610 2631952481 0 0 -3660126519 primary 2332901747 0 0 1546506610 2631952481 0 0 +3660126519 t3_pkey 2332901747 0 0 1546506610 2631952481 0 0 3660126516 t3_a_b_idx 2332901747 0 0 1546506610 2631952481 0 0 60 v1 2332901747 100060 0 1546506610 0 0 0 61 t4 2332901747 100061 0 1546506610 2631952481 0 0 -4179599057 primary 2332901747 0 0 1546506610 2631952481 0 0 +4179599057 t4_pkey 2332901747 0 0 1546506610 2631952481 0 0 62 t5 2332901747 100062 0 1546506610 2631952481 0 0 -3919862786 primary 2332901747 0 0 1546506610 2631952481 0 0 +3919862786 t5_pkey 2332901747 0 0 1546506610 2631952481 0 0 63 t6 2332901747 100063 0 1546506610 2631952481 0 0 -2574785779 primary 2332901747 0 0 1546506610 2631952481 0 0 +2574785779 t6_pkey 2332901747 0 0 1546506610 2631952481 0 0 2574785776 t6_expr_idx 2332901747 0 0 1546506610 2631952481 0 0 2574785777 t6_expr_expr1_idx 2332901747 0 0 1546506610 2631952481 0 0 2574785782 t6_expr_key 2332901747 0 0 1546506610 2631952481 0 0 64 mv1 2332901747 100064 0 1546506610 0 0 0 -51576700 primary 2332901747 0 0 1546506610 2631952481 0 0 +51576700 mv1_pkey 2332901747 0 0 1546506610 2631952481 0 0 query TIRIOBBT colnames SELECT relname, relpages, reltuples, relallvisible, reltoastrelid, relhasindex, relisshared, relpersistence @@ -566,29 +566,29 @@ WHERE n.nspname = 'public' ---- relname relpages reltuples relallvisible reltoastrelid relhasindex relisshared relpersistence t1 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +t1_pkey NULL NULL 0 0 false false p t1_a_key NULL NULL 0 0 false false p index_key NULL NULL 0 0 false false p t1_m_seq NULL NULL 0 0 true false p t1_n_seq NULL NULL 0 0 true false p t2 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +t2_pkey NULL NULL 0 0 false false p t2_t1_id_idx NULL NULL 0 0 false false p t3 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +t3_pkey NULL NULL 0 0 false false p t3_a_b_idx NULL NULL 0 0 false false p v1 NULL NULL 0 0 false false p t4 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +t4_pkey NULL NULL 0 0 false false p t5 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +t5_pkey NULL NULL 0 0 false false p t6 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +t6_pkey NULL NULL 0 0 false false p t6_expr_idx NULL NULL 0 0 false false p t6_expr_expr1_idx NULL NULL 0 0 false false p t6_expr_key NULL NULL 0 0 false false p mv1 NULL NULL 0 0 true false p -primary NULL NULL 0 0 false false p +mv1_pkey NULL NULL 0 0 false false p query TBTIIBB colnames SELECT relname, relistemp, relkind, relnatts, relchecks, relhasoids, relhaspkey @@ -598,29 +598,29 @@ WHERE n.nspname = 'public' ---- relname relistemp relkind relnatts relchecks relhasoids relhaspkey t1 false r 15 0 false true -primary false i 1 0 false false +t1_pkey false i 1 0 false false t1_a_key false i 1 0 false false index_key false i 2 0 false false t1_m_seq false S 1 0 false true t1_n_seq false S 1 0 false true t2 false r 2 0 false true -primary false i 1 0 false false +t2_pkey false i 1 0 false false t2_t1_id_idx false i 1 0 false false t3 false r 4 2 false true -primary false i 1 0 false false +t3_pkey false i 1 0 false false t3_a_b_idx false i 2 0 false false v1 false v 4 0 false false t4 false r 4 0 false true -primary false i 1 0 false false +t4_pkey false i 1 0 false false t5 false r 4 0 false true -primary false i 1 0 false false +t5_pkey false i 1 0 false false t6 false r 4 0 false true -primary false i 1 0 false false +t6_pkey false i 1 0 false false t6_expr_idx false i 1 0 false false t6_expr_expr1_idx false i 2 0 false false t6_expr_key false i 1 0 false false mv1 false m 2 0 false true -primary false i 1 0 false false +mv1_pkey false i 1 0 false false query TBBBITT colnames SELECT relname, relhasrules, relhastriggers, relhassubclass, relfrozenxid, relacl, reloptions @@ -630,29 +630,29 @@ WHERE n.nspname = 'public' ---- relname relhasrules relhastriggers relhassubclass relfrozenxid relacl reloptions t1 false false false 0 NULL NULL -primary false false false 0 NULL NULL +t1_pkey false false false 0 NULL NULL t1_a_key false false false 0 NULL NULL index_key false false false 0 NULL NULL t1_m_seq false false false 0 NULL NULL t1_n_seq false false false 0 NULL NULL t2 false false false 0 NULL NULL -primary false false false 0 NULL NULL +t2_pkey false false false 0 NULL NULL t2_t1_id_idx false false false 0 NULL NULL t3 false false false 0 NULL NULL -primary false false false 0 NULL NULL +t3_pkey false false false 0 NULL NULL t3_a_b_idx false false false 0 NULL NULL v1 false false false 0 NULL NULL t4 false false false 0 NULL NULL -primary false false false 0 NULL NULL +t4_pkey false false false 0 NULL NULL t5 false false false 0 NULL NULL -primary false false false 0 NULL NULL +t5_pkey false false false 0 NULL NULL t6 false false false 0 NULL NULL -primary false false false 0 NULL NULL +t6_pkey false false false 0 NULL NULL t6_expr_idx false false false 0 NULL NULL t6_expr_expr1_idx false false false 0 NULL NULL t6_expr_key false false false 0 NULL NULL mv1 false false false 0 NULL NULL -primary false false false 0 NULL NULL +mv1_pkey false false false 0 NULL NULL ## pg_catalog.pg_attribute @@ -679,7 +679,7 @@ attrelid relname attname atttypid attstattarget 55 t1 l 20 0 8 13 0 -1 55 t1 m 20 0 8 14 0 -1 55 t1 n 20 0 8 15 0 -1 -450499963 primary p 701 0 8 1 0 -1 +450499963 t1_pkey p 701 0 8 1 0 -1 450499960 t1_a_key a 20 0 8 2 0 -1 450499961 index_key b 20 0 8 3 0 -1 450499961 index_key c 20 0 8 4 0 -1 @@ -687,13 +687,13 @@ attrelid relname attname atttypid attstattarget 57 t1_n_seq value 20 0 8 1 0 -1 58 t2 t1_id 20 0 8 1 0 -1 58 t2 rowid 20 0 8 2 0 -1 -710236230 primary rowid 20 0 8 2 0 -1 +710236230 t2_pkey rowid 20 0 8 2 0 -1 710236229 t2_t1_id_idx t1_id 20 0 8 1 0 -1 59 t3 a 20 0 8 1 0 -1 59 t3 b 20 0 8 2 0 -1 59 t3 c 25 0 -1 3 0 -1 59 t3 rowid 20 0 8 4 0 -1 -3660126519 primary rowid 20 0 8 4 0 -1 +3660126519 t3_pkey rowid 20 0 8 4 0 -1 3660126516 t3_a_b_idx a 20 0 8 1 0 -1 3660126516 t3_a_b_idx b 20 0 8 2 0 -1 60 v1 p 701 0 8 1 0 -1 @@ -704,24 +704,24 @@ attrelid relname attname atttypid attstattarget 61 t4 b 701 0 8 2 0 -1 61 t4 c 25 0 -1 3 0 -1 61 t4 rowid 20 0 8 4 0 -1 -4179599057 primary rowid 20 0 8 4 0 -1 +4179599057 t4_pkey rowid 20 0 8 4 0 -1 62 t5 a 20 0 8 1 0 -1 62 t5 b 701 0 8 2 0 -1 62 t5 c 25 0 -1 3 0 -1 62 t5 rowid 20 0 8 4 0 -1 -3919862786 primary rowid 20 0 8 4 0 -1 +3919862786 t5_pkey rowid 20 0 8 4 0 -1 63 t6 a 20 0 8 1 0 -1 63 t6 b 20 0 8 2 0 -1 63 t6 c 25 0 -1 3 0 -1 63 t6 rowid 20 0 8 5 0 -1 -2574785779 primary rowid 20 0 8 5 0 -1 +2574785779 t6_pkey rowid 20 0 8 5 0 -1 2574785776 t6_expr_idx crdb_internal_idx_expr 20 0 8 4 0 -1 2574785777 t6_expr_expr1_idx crdb_internal_idx_expr_1 25 0 -1 6 0 -1 2574785777 t6_expr_expr1_idx crdb_internal_idx_expr_2 20 0 8 7 0 -1 2574785782 t6_expr_key crdb_internal_idx_expr_3 25 0 -1 8 0 -1 64 mv1 ?column? 20 0 8 1 0 -1 64 mv1 rowid 20 0 8 2 0 -1 -51576700 primary rowid 20 0 8 2 0 -1 +51576700 mv1_pkey rowid 20 0 8 2 0 -1 query TTIBTTBBTT colnames SELECT c.relname, attname, atttypmod, attbyval, attstorage, attalign, attnotnull, atthasdef, attidentity, attgenerated @@ -746,7 +746,7 @@ t1 k 14 NULL NULL NU t1 l -1 NULL NULL NULL false false · v t1 m -1 NULL NULL NULL true true a · t1 n -1 NULL NULL NULL true true b · -primary p -1 NULL NULL NULL true false · · +t1_pkey p -1 NULL NULL NULL true false · · t1_a_key a -1 NULL NULL NULL false false · · index_key b -1 NULL NULL NULL false false · · index_key c -1 NULL NULL NULL false true · · @@ -754,13 +754,13 @@ t1_m_seq value -1 NULL NULL NU t1_n_seq value -1 NULL NULL NULL true false · · t2 t1_id -1 NULL NULL NULL false false · · t2 rowid -1 NULL NULL NULL true true · · -primary rowid -1 NULL NULL NULL true true · · +t2_pkey rowid -1 NULL NULL NULL true true · · t2_t1_id_idx t1_id -1 NULL NULL NULL false false · · t3 a -1 NULL NULL NULL false false · · t3 b -1 NULL NULL NULL false false · · t3 c -1 NULL NULL NULL false true · · t3 rowid -1 NULL NULL NULL true true · · -primary rowid -1 NULL NULL NULL true true · · +t3_pkey rowid -1 NULL NULL NULL true true · · t3_a_b_idx a -1 NULL NULL NULL false false · · t3_a_b_idx b -1 NULL NULL NULL false false · · v1 p -1 NULL NULL NULL false false · · @@ -771,24 +771,24 @@ t4 a -1 NULL NULL NU t4 b -1 NULL NULL NULL false false · · t4 c -1 NULL NULL NULL false false · · t4 rowid -1 NULL NULL NULL true true · · -primary rowid -1 NULL NULL NULL true true · · +t4_pkey rowid -1 NULL NULL NULL true true · · t5 a -1 NULL NULL NULL false false · · t5 b -1 NULL NULL NULL false false · · t5 c -1 NULL NULL NULL false false · · t5 rowid -1 NULL NULL NULL true true · · -primary rowid -1 NULL NULL NULL true true · · +t5_pkey rowid -1 NULL NULL NULL true true · · t6 a -1 NULL NULL NULL false false · · t6 b -1 NULL NULL NULL false false · · t6 c -1 NULL NULL NULL false false · · t6 rowid -1 NULL NULL NULL true true · · -primary rowid -1 NULL NULL NULL true true · · +t6_pkey rowid -1 NULL NULL NULL true true · · t6_expr_idx crdb_internal_idx_expr -1 NULL NULL NULL false false · v t6_expr_expr1_idx crdb_internal_idx_expr_1 -1 NULL NULL NULL false false · v t6_expr_expr1_idx crdb_internal_idx_expr_2 -1 NULL NULL NULL false false · v t6_expr_key crdb_internal_idx_expr_3 -1 NULL NULL NULL false false · v mv1 ?column? -1 NULL NULL NULL false false · · mv1 rowid -1 NULL NULL NULL true true · · -primary rowid -1 NULL NULL NULL true true · · +mv1_pkey rowid -1 NULL NULL NULL true true · · query TTBBITTT colnames SELECT c.relname, attname, attisdropped, attislocal, attinhcount, attacl, attoptions, attfdwoptions @@ -813,7 +813,7 @@ t1 k false true 0 t1 l false true 0 NULL NULL NULL t1 m false true 0 NULL NULL NULL t1 n false true 0 NULL NULL NULL -primary p false true 0 NULL NULL NULL +t1_pkey p false true 0 NULL NULL NULL t1_a_key a false true 0 NULL NULL NULL index_key b false true 0 NULL NULL NULL index_key c false true 0 NULL NULL NULL @@ -821,13 +821,13 @@ t1_m_seq value false true 0 t1_n_seq value false true 0 NULL NULL NULL t2 t1_id false true 0 NULL NULL NULL t2 rowid false true 0 NULL NULL NULL -primary rowid false true 0 NULL NULL NULL +t2_pkey rowid false true 0 NULL NULL NULL t2_t1_id_idx t1_id false true 0 NULL NULL NULL t3 a false true 0 NULL NULL NULL t3 b false true 0 NULL NULL NULL t3 c false true 0 NULL NULL NULL t3 rowid false true 0 NULL NULL NULL -primary rowid false true 0 NULL NULL NULL +t3_pkey rowid false true 0 NULL NULL NULL t3_a_b_idx a false true 0 NULL NULL NULL t3_a_b_idx b false true 0 NULL NULL NULL v1 p false true 0 NULL NULL NULL @@ -838,24 +838,24 @@ t4 a false true 0 t4 b false true 0 NULL NULL NULL t4 c false true 0 NULL NULL NULL t4 rowid false true 0 NULL NULL NULL -primary rowid false true 0 NULL NULL NULL +t4_pkey rowid false true 0 NULL NULL NULL t5 a false true 0 NULL NULL NULL t5 b false true 0 NULL NULL NULL t5 c false true 0 NULL NULL NULL t5 rowid false true 0 NULL NULL NULL -primary rowid false true 0 NULL NULL NULL +t5_pkey rowid false true 0 NULL NULL NULL t6 a false true 0 NULL NULL NULL t6 b false true 0 NULL NULL NULL t6 c false true 0 NULL NULL NULL t6 rowid false true 0 NULL NULL NULL -primary rowid false true 0 NULL NULL NULL +t6_pkey rowid false true 0 NULL NULL NULL t6_expr_idx crdb_internal_idx_expr false true 0 NULL NULL NULL t6_expr_expr1_idx crdb_internal_idx_expr_1 false true 0 NULL NULL NULL t6_expr_expr1_idx crdb_internal_idx_expr_2 false true 0 NULL NULL NULL t6_expr_key crdb_internal_idx_expr_3 false true 0 NULL NULL NULL mv1 ?column? false true 0 NULL NULL NULL mv1 rowid false true 0 NULL NULL NULL -primary rowid false true 0 NULL NULL NULL +mv1_pkey rowid false true 0 NULL NULL NULL # Check relkind codes. statement ok @@ -887,10 +887,10 @@ WHERE n.nspname = 'public' ORDER BY relname ---- mv_test m -primary i -primary i +mv_test_pkey i seq_test S tbl_test r +tbl_test_pkey i tbl_test_v_idx i view_test v @@ -963,22 +963,22 @@ FROM pg_catalog.pg_indexes WHERE schemaname = 'public' ---- crdb_oid schemaname tablename indexname tablespace -450499963 public t1 primary NULL +450499963 public t1 t1_pkey NULL 450499960 public t1 t1_a_key NULL 450499961 public t1 index_key NULL 2315049508 public t1_m_seq primary NULL 969972501 public t1_n_seq primary NULL -710236230 public t2 primary NULL +710236230 public t2 t2_pkey NULL 710236229 public t2 t2_t1_id_idx NULL -3660126519 public t3 primary NULL +3660126519 public t3 t3_pkey NULL 3660126516 public t3 t3_a_b_idx NULL -4179599057 public t4 primary NULL -3919862786 public t5 primary NULL -2574785779 public t6 primary NULL +4179599057 public t4 t4_pkey NULL +3919862786 public t5 t5_pkey NULL +2574785779 public t6 t6_pkey NULL 2574785776 public t6 t6_expr_idx NULL 2574785777 public t6 t6_expr_expr1_idx NULL 2574785782 public t6 t6_expr_key NULL -51576700 public mv1 primary NULL +51576700 public mv1 mv1_pkey NULL query OTTT colnames SELECT crdb_oid, tablename, indexname, indexdef @@ -986,22 +986,22 @@ FROM pg_catalog.pg_indexes WHERE schemaname = 'public' ---- crdb_oid tablename indexname indexdef -450499963 t1 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.t1 USING btree (p ASC) +450499963 t1 t1_pkey CREATE UNIQUE INDEX t1_pkey ON constraint_db.public.t1 USING btree (p ASC) 450499960 t1 t1_a_key CREATE UNIQUE INDEX t1_a_key ON constraint_db.public.t1 USING btree (a ASC) 450499961 t1 index_key CREATE UNIQUE INDEX index_key ON constraint_db.public.t1 USING btree (b ASC, c ASC) 2315049508 t1_m_seq primary CREATE INDEX "primary" ON constraint_db.public.t1_m_seq USING btree (value ASC) 969972501 t1_n_seq primary CREATE INDEX "primary" ON constraint_db.public.t1_n_seq USING btree (value ASC) -710236230 t2 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.t2 USING btree (rowid ASC) +710236230 t2 t2_pkey CREATE UNIQUE INDEX t2_pkey ON constraint_db.public.t2 USING btree (rowid ASC) 710236229 t2 t2_t1_id_idx CREATE INDEX t2_t1_id_idx ON constraint_db.public.t2 USING btree (t1_id ASC) -3660126519 t3 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.t3 USING btree (rowid ASC) +3660126519 t3 t3_pkey CREATE UNIQUE INDEX t3_pkey ON constraint_db.public.t3 USING btree (rowid ASC) 3660126516 t3 t3_a_b_idx CREATE INDEX t3_a_b_idx ON constraint_db.public.t3 USING btree (a ASC, b DESC) STORING (c) -4179599057 t4 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.t4 USING btree (rowid ASC) -3919862786 t5 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.t5 USING btree (rowid ASC) -2574785779 t6 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.t6 USING btree (rowid ASC) +4179599057 t4 t4_pkey CREATE UNIQUE INDEX t4_pkey ON constraint_db.public.t4 USING btree (rowid ASC) +3919862786 t5 t5_pkey CREATE UNIQUE INDEX t5_pkey ON constraint_db.public.t5 USING btree (rowid ASC) +2574785779 t6 t6_pkey CREATE UNIQUE INDEX t6_pkey ON constraint_db.public.t6 USING btree (rowid ASC) 2574785776 t6 t6_expr_idx CREATE INDEX t6_expr_idx ON constraint_db.public.t6 USING btree ((a + b) ASC) 2574785777 t6 t6_expr_expr1_idx CREATE INDEX t6_expr_expr1_idx ON constraint_db.public.t6 USING btree (lower(c) ASC, (a + b) ASC) 2574785782 t6 t6_expr_key CREATE UNIQUE INDEX t6_expr_key ON constraint_db.public.t6 USING btree (lower(c) ASC) -51576700 mv1 primary CREATE UNIQUE INDEX "primary" ON constraint_db.public.mv1 USING btree (rowid ASC) +51576700 mv1 mv1_pkey CREATE UNIQUE INDEX mv1_pkey ON constraint_db.public.mv1 USING btree (rowid ASC) ## pg_catalog.pg_index @@ -1238,7 +1238,7 @@ oid conname connamespace contype condef 2119068666 t6_expr_key 2332901747 u UNIQUE (lower(c) ASC) 2897367075 uwi_b_partial 2332901747 u UNIQUE WITHOUT INDEX (b) WHERE (c = 'foo'::STRING) 3173756726 fk_a_ref_t4 2332901747 f FOREIGN KEY (a) REFERENCES t4(a) ON DELETE CASCADE -3572320190 primary 2332901747 p PRIMARY KEY (p ASC) +3572320190 t1_pkey 2332901747 p PRIMARY KEY (p ASC) 3989820597 check_b 2332901747 c CHECK ((b > 11)) 4243354484 t1_a_key 2332901747 u UNIQUE (a ASC) 4243354485 index_key 2332901747 u UNIQUE (b ASC, c ASC) @@ -1262,7 +1262,7 @@ primary p false false true 57 0 t6_expr_key u false false true 63 0 2574785782 uwi_b_partial u false false true 61 0 0 fk_a_ref_t4 f false false true 62 0 0 -primary p false false true 55 0 450499963 +t1_pkey p false false true 55 0 450499963 check_b c false false true 59 0 0 t1_a_key u false false true 55 0 450499960 index_key u false false true 55 0 450499961 @@ -1290,7 +1290,7 @@ uwi_b_c 0 NULL NULL NULL primary 0 NULL NULL NULL t6_expr_key 0 NULL NULL NULL uwi_b_partial 0 NULL NULL NULL -primary 0 NULL NULL NULL +t1_pkey 0 NULL NULL NULL check_b 0 NULL NULL NULL t1_a_key 0 NULL NULL NULL index_key 0 NULL NULL NULL @@ -1327,7 +1327,7 @@ primary true 0 true {1} t6_expr_key true 0 true {8} uwi_b_partial true 0 true NULL fk_a_ref_t4 true 0 true {1} -primary true 0 true {1} +t1_pkey true 0 true {1} check_b true 0 true {2} t1_a_key true 0 true {2} index_key true 0 true {3,4} @@ -1347,7 +1347,7 @@ uwi_b_c NULL NULL NULL NULL NULL NULL primary NULL NULL NULL NULL NULL NULL NULL PRIMARY KEY (value ASC) t6_expr_key NULL NULL NULL NULL NULL NULL NULL UNIQUE (lower(c) ASC) uwi_b_partial NULL NULL NULL NULL NULL NULL NULL UNIQUE WITHOUT INDEX (b) WHERE (c = 'foo'::STRING) -primary NULL NULL NULL NULL NULL NULL NULL PRIMARY KEY (p ASC) +t1_pkey NULL NULL NULL NULL NULL NULL NULL PRIMARY KEY (p ASC) check_b NULL NULL NULL NULL NULL (b > 11) (b > 11) CHECK ((b > 11)) t1_a_key NULL NULL NULL NULL NULL NULL NULL UNIQUE (a ASC) index_key NULL NULL NULL NULL NULL NULL NULL UNIQUE (b ASC, c ASC) @@ -4677,7 +4677,7 @@ SELECT schemaname, tablename, indexname, indexdef FROM pg_indexes WHERE schemaname='test_schema' and tablename='test' ---- schemaname tablename indexname indexdef -test_schema test primary CREATE UNIQUE INDEX "primary" ON test.test_schema.test USING btree (a ASC) +test_schema test test_pkey CREATE UNIQUE INDEX test_pkey ON test.test_schema.test USING btree (a ASC) test_schema test test_b_idx CREATE INDEX test_b_idx ON test.test_schema.test USING btree (b ASC) # Make sure that selecting from vtables with indexes in other dbs properly @@ -4717,10 +4717,10 @@ SELECT indexname, indexdef FROM pg_catalog.pg_indexes WHERE tablename = 'geospatial_table' ---- -indexname indexdef -primary CREATE UNIQUE INDEX "primary" ON test.public.geospatial_table USING btree (id ASC) -idxa CREATE INDEX idxa ON test.public.geospatial_table USING gin (a ASC) -idxb CREATE INDEX idxb ON test.public.geospatial_table USING gin (b ASC) +indexname indexdef +geospatial_table_pkey CREATE UNIQUE INDEX geospatial_table_pkey ON test.public.geospatial_table USING btree (id ASC) +idxa CREATE INDEX idxa ON test.public.geospatial_table USING gin (a ASC) +idxb CREATE INDEX idxb ON test.public.geospatial_table USING gin (b ASC) subtest partial_index @@ -4746,7 +4746,7 @@ FROM pg_catalog.pg_indexes WHERE tablename = 'partial_index_table' ---- indexname indexdef -primary CREATE UNIQUE INDEX "primary" ON test.public.partial_index_table USING btree (rowid ASC) +partial_index_table_pkey CREATE UNIQUE INDEX partial_index_table_pkey ON test.public.partial_index_table USING btree (rowid ASC) partial_index_table_a_key CREATE UNIQUE INDEX partial_index_table_a_key ON test.public.partial_index_table USING btree (a ASC) WHERE (a > 0) partial_index_table_a_key1 CREATE UNIQUE INDEX partial_index_table_a_key1 ON test.public.partial_index_table USING btree (a ASC) WHERE (b IN ('foo'::public.testenum, 'bar'::public.testenum)) @@ -5126,7 +5126,7 @@ GROUP BY indexname, indisunique, indisprimary, amname, exprdef, attoptions ---- indexname array_agg indisunique indisprimary array_agg amname exprdef attoptions indexes_include_idx {a,c,d} false false {ASC,ASC,ASC} prefix NULL NULL -primary {id} true true {ASC} prefix NULL NULL +indexes_table_pkey {id} true true {ASC} prefix NULL NULL statement ok SET stub_catalog_tables=false diff --git a/pkg/sql/logictest/testdata/logic_test/privileges_comments b/pkg/sql/logictest/testdata/logic_test/privileges_comments index d4138e7b34ce..f9d4e4e0d806 100644 --- a/pkg/sql/logictest/testdata/logic_test/privileges_comments +++ b/pkg/sql/logictest/testdata/logic_test/privileges_comments @@ -15,7 +15,7 @@ statement ok COMMENT ON DATABASE d45707 IS 'd45707'; COMMENT ON TABLE d45707.t45707 IS 't45707'; COMMENT ON COLUMN d45707.t45707.x IS 'x45707'; -COMMENT ON INDEX d45707.t45707@primary IS 'p45707' +COMMENT ON INDEX d45707.t45707@t45707_pkey IS 'p45707' user testuser @@ -34,7 +34,7 @@ statement error user testuser does not have CREATE privilege on relation t45707 COMMENT ON COLUMN d45707.t45707.x IS 'x45707' statement error user testuser does not have CREATE privilege on relation t45707 -COMMENT ON INDEX d45707.t45707@primary IS 'p45707' +COMMENT ON INDEX d45707.t45707@t45707_pkey IS 'p45707' # Verify that the user can view the comments @@ -79,4 +79,4 @@ statement ok COMMENT ON DATABASE d45707 IS 'd45707_2'; COMMENT ON TABLE d45707.t45707 IS 't45707_2'; COMMENT ON COLUMN d45707.t45707.x IS 'x45707_2'; -COMMENT ON INDEX d45707.t45707@primary IS 'p45707_2' +COMMENT ON INDEX d45707.t45707@t45707_pkey IS 'p45707_2' diff --git a/pkg/sql/logictest/testdata/logic_test/privileges_table b/pkg/sql/logictest/testdata/logic_test/privileges_table index e8f50cce31a2..48a79e613606 100644 --- a/pkg/sql/logictest/testdata/logic_test/privileges_table +++ b/pkg/sql/logictest/testdata/logic_test/privileges_table @@ -118,8 +118,8 @@ user testuser query TTBTTTB SHOW COLUMNS FROM t ---- -k INT8 false NULL · {primary} false -v INT8 true NULL · {primary} false +k INT8 false NULL · {t_pkey} false +v INT8 true NULL · {t_pkey} false statement error user testuser does not have GRANT privilege on relation t GRANT ALL ON t TO bar diff --git a/pkg/sql/logictest/testdata/logic_test/ranges b/pkg/sql/logictest/testdata/logic_test/ranges index 4463d92fbdf3..99b4c04046c6 100644 Binary files a/pkg/sql/logictest/testdata/logic_test/ranges and b/pkg/sql/logictest/testdata/logic_test/ranges differ diff --git a/pkg/sql/logictest/testdata/logic_test/rename_column b/pkg/sql/logictest/testdata/logic_test/rename_column index 156da0d742f3..992601351f2d 100644 --- a/pkg/sql/logictest/testdata/logic_test/rename_column +++ b/pkg/sql/logictest/testdata/logic_test/rename_column @@ -81,9 +81,9 @@ users bar false 2 username ASC false users foo true 1 username ASC false false users foo true 2 species N/A true false users foo true 3 id ASC false true -users primary false 1 id ASC false false -users primary false 2 username N/A true false -users primary false 3 species N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 username N/A true false +users users_pkey false 3 species N/A true false statement ok CREATE VIEW v1 AS SELECT id FROM users WHERE username = 'tom' diff --git a/pkg/sql/logictest/testdata/logic_test/rename_constraint b/pkg/sql/logictest/testdata/logic_test/rename_constraint index c89972d0663b..99acdef07ea7 100644 --- a/pkg/sql/logictest/testdata/logic_test/rename_constraint +++ b/pkg/sql/logictest/testdata/logic_test/rename_constraint @@ -14,7 +14,7 @@ CREATE TABLE public.t ( x INT8 NULL, y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), CONSTRAINT cf FOREIGN KEY (x) REFERENCES public.t(x), UNIQUE INDEX cu (x ASC), FAMILY "primary" (x, y, rowid), @@ -42,7 +42,7 @@ CREATE TABLE public.t ( x INT8 NULL, y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), CONSTRAINT cf2 FOREIGN KEY (x) REFERENCES public.t(x), UNIQUE INDEX cu2 (x ASC), FAMILY "primary" (x, y, rowid), @@ -94,7 +94,7 @@ CREATE TABLE public.t ( x INT8 NULL, y INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), CONSTRAINT cf4 FOREIGN KEY (x) REFERENCES public.t(x), UNIQUE INDEX cu4 (x ASC), FAMILY "primary" (x, y, rowid), diff --git a/pkg/sql/logictest/testdata/logic_test/rename_index b/pkg/sql/logictest/testdata/logic_test/rename_index index 78a9bb405be6..34c187d93810 100644 --- a/pkg/sql/logictest/testdata/logic_test/rename_index +++ b/pkg/sql/logictest/testdata/logic_test/rename_index @@ -32,21 +32,21 @@ users bar false 1 id ASC false users bar false 2 name ASC false false users foo true 1 name ASC false false users foo true 2 id ASC false true -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false query TTBITTBB colnames SHOW INDEXES FROM users_dupe ---- -table_name index_name non_unique seq_in_index column_name direction storing implicit -users_dupe bar false 1 id ASC false false -users_dupe bar false 2 name ASC false false -users_dupe foo true 1 name ASC false false -users_dupe foo true 2 id ASC false true -users_dupe primary false 1 id ASC false false -users_dupe primary false 2 name N/A true false -users_dupe primary false 3 title N/A true false +table_name index_name non_unique seq_in_index column_name direction storing implicit +users_dupe bar false 1 id ASC false false +users_dupe bar false 2 name ASC false false +users_dupe foo true 1 name ASC false false +users_dupe foo true 2 id ASC false true +users_dupe users_dupe_pkey false 1 id ASC false false +users_dupe users_dupe_pkey false 2 name N/A true false +users_dupe users_dupe_pkey false 3 title N/A true false statement error pgcode 42P07 index name "bar" already exists ALTER INDEX users@foo RENAME TO bar @@ -88,11 +88,11 @@ SHOW INDEXES FROM users table_name index_name non_unique seq_in_index column_name direction storing implicit users bar false 1 id ASC false false users bar false 2 name ASC false false -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false users ufo true 1 name ASC false false users ufo true 2 id ASC false true +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false user testuser @@ -113,13 +113,13 @@ query TTBITTBB colnames SHOW INDEXES FROM users ---- table_name index_name non_unique seq_in_index column_name direction storing implicit -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false users rar false 1 id ASC false false users rar false 2 name ASC false false users ufo true 1 name ASC false false users ufo true 2 id ASC false true +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false user root @@ -140,7 +140,7 @@ ALTER INDEX users@rar RENAME TO bar # Regression test for #24774 statement ok -ALTER INDEX users@"primary" RENAME TO pk +ALTER INDEX users@users_pkey RENAME TO pk query ITT rowsort SELECT * FROM users@pk diff --git a/pkg/sql/logictest/testdata/logic_test/schema_change_in_txn b/pkg/sql/logictest/testdata/logic_test/schema_change_in_txn index 35d1f7e9fd87..20a05b48b31f 100644 --- a/pkg/sql/logictest/testdata/logic_test/schema_change_in_txn +++ b/pkg/sql/logictest/testdata/logic_test/schema_change_in_txn @@ -37,8 +37,8 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM test.child ---- +child child_pkey PRIMARY KEY PRIMARY KEY (id ASC) true child fk_child_parent_id FOREIGN KEY FOREIGN KEY (parent_id) REFERENCES parent(id) NOT VALID false -child primary PRIMARY KEY PRIMARY KEY (id ASC) true statement ok ALTER TABLE test.child VALIDATE CONSTRAINT fk_child_parent_id @@ -46,8 +46,8 @@ ALTER TABLE test.child VALIDATE CONSTRAINT fk_child_parent_id query TTTTB SHOW CONSTRAINTS FROM test.child ---- +child child_pkey PRIMARY KEY PRIMARY KEY (id ASC) true child fk_child_parent_id FOREIGN KEY FOREIGN KEY (parent_id) REFERENCES parent(id) true -child primary PRIMARY KEY PRIMARY KEY (id ASC) true statement ok DROP TABLE test.child, test.parent @@ -79,8 +79,8 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM test.child ---- +child child_pkey PRIMARY KEY PRIMARY KEY (id ASC) true child fk_child_parent_id FOREIGN KEY FOREIGN KEY (parent_id) REFERENCES parent(id) true -child primary PRIMARY KEY PRIMARY KEY (id ASC) true statement ok DROP TABLE test.child, test.parent @@ -280,7 +280,7 @@ b CREATE TABLE public.b ( parent_id INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), d INT8 NULL DEFAULT 23:::INT8, - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT b_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_parent_id_ref_parent FOREIGN KEY (parent_id) REFERENCES public.parent(id), INDEX foo (parent_id ASC), UNIQUE INDEX bar (parent_id ASC), @@ -729,7 +729,7 @@ COMMIT query TTBTTTB SHOW COLUMNS FROM customers ---- -k CHAR false NULL · {primary} false +k CHAR false NULL · {customers_pkey} false query error pq: index "j_idx" not found SELECT * FROM customers@j_idx @@ -914,9 +914,9 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM check_table ---- -check_table c_0 CHECK CHECK ((c > 0)) NOT VALID false -check_table d_0 CHECK CHECK ((d > 0)) true -check_table primary PRIMARY KEY PRIMARY KEY (k ASC) true +check_table c_0 CHECK CHECK ((c > 0)) NOT VALID false +check_table check_table_pkey PRIMARY KEY PRIMARY KEY (k ASC) true +check_table d_0 CHECK CHECK ((d > 0)) true statement ok BEGIN @@ -947,17 +947,17 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM check_table ---- -check_table c_0 CHECK CHECK ((c > 0)) NOT VALID false -check_table d_0 CHECK CHECK ((d > 0)) true -check_table primary PRIMARY KEY PRIMARY KEY (k ASC) true +check_table c_0 CHECK CHECK ((c > 0)) NOT VALID false +check_table check_table_pkey PRIMARY KEY PRIMARY KEY (k ASC) true +check_table d_0 CHECK CHECK ((d > 0)) true # Adding column e was rolled back query TTBTTTB SHOW COLUMNS FROM check_table ---- -k INT8 false NULL · {primary} false -c INT8 true NULL · {primary} false -d INT8 true 1:::INT8 · {primary} false +k INT8 false NULL · {check_table_pkey} false +c INT8 true NULL · {check_table_pkey} false +d INT8 true 1:::INT8 · {check_table_pkey} false statement ok DROP TABLE check_table @@ -986,7 +986,7 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM check_table ---- -check_table primary PRIMARY KEY PRIMARY KEY (k ASC) true +check_table check_table_pkey PRIMARY KEY PRIMARY KEY (k ASC) true statement ok BEGIN @@ -1003,7 +1003,7 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM check_table ---- -check_table primary PRIMARY KEY PRIMARY KEY (k ASC) true +check_table check_table_pkey PRIMARY KEY PRIMARY KEY (k ASC) true statement ok DROP TABLE check_table @@ -1506,7 +1506,7 @@ query TTTTB SHOW CONSTRAINTS FROM y ---- y fk_b_ref_x FOREIGN KEY FOREIGN KEY (b) REFERENCES x(b) true -y primary PRIMARY KEY PRIMARY KEY (a ASC) true +y y_pkey PRIMARY KEY PRIMARY KEY (a ASC) true # Also test dropping the index on the referenced side statement ok @@ -1531,8 +1531,8 @@ COMMIT query TTTTB SHOW CONSTRAINTS FROM x ---- -x primary PRIMARY KEY PRIMARY KEY (a ASC) true x x_b_key UNIQUE UNIQUE (b ASC) true +x x_pkey PRIMARY KEY PRIMARY KEY (a ASC) true statement ok DROP TABLE x, y diff --git a/pkg/sql/logictest/testdata/logic_test/select_for_update b/pkg/sql/logictest/testdata/logic_test/select_for_update index e15afc97fbc0..90cca24d5cbe 100644 --- a/pkg/sql/logictest/testdata/logic_test/select_for_update +++ b/pkg/sql/logictest/testdata/logic_test/select_for_update @@ -305,16 +305,16 @@ BEGIN; UPDATE t SET v = 2 WHERE k = 1 user testuser -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t FOR UPDATE NOWAIT -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t FOR SHARE FOR UPDATE OF t NOWAIT -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT * FROM t FOR SHARE NOWAIT FOR UPDATE OF t -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey BEGIN; SELECT * FROM t FOR UPDATE NOWAIT statement ok @@ -344,16 +344,16 @@ BEGIN; UPDATE t SET v = 2 WHERE k = 1 user testuser -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT v, v2 FROM t JOIN t2 USING (k) FOR SHARE FOR SHARE OF t NOWAIT -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT v, v2 FROM t JOIN t2 USING (k) FOR SHARE OF t2 FOR SHARE OF t NOWAIT -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT v, v2 FROM t JOIN t2 USING (k) FOR SHARE NOWAIT FOR SHARE OF t -query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@primary +query error pgcode 55P03 could not obtain lock on row \(k\)=\(1\) in t@t_pkey SELECT v, v2 FROM t JOIN t2 USING (k) FOR SHARE NOWAIT FOR SHARE OF t2 statement ok diff --git a/pkg/sql/logictest/testdata/logic_test/select_index_flags b/pkg/sql/logictest/testdata/logic_test/select_index_flags index 41199275953b..5bb1849dfe73 100644 --- a/pkg/sql/logictest/testdata/logic_test/select_index_flags +++ b/pkg/sql/logictest/testdata/logic_test/select_index_flags @@ -21,14 +21,14 @@ SELECT * FROM abcd WHERE a >= 20 AND a <= 30 # Force primary query IIII rowsort -SELECT * FROM abcd@primary WHERE a >= 20 AND a <= 30 +SELECT * FROM abcd@abcd_pkey WHERE a >= 20 AND a <= 30 ---- 20 21 22 23 30 31 32 33 # Force primary, reverse scan. query IIII rowsort -SELECT * FROM abcd@{FORCE_INDEX=primary,DESC} WHERE a >= 20 AND a <= 30 +SELECT * FROM abcd@{FORCE_INDEX=abcd_pkey,DESC} WHERE a >= 20 AND a <= 30 ---- 20 21 22 23 30 31 32 33 @@ -83,7 +83,7 @@ SELECT c, d FROM abcd WHERE c >= 20 AND c < 40 # Force primary index query II rowsort -SELECT c, d FROM abcd@primary WHERE c >= 20 AND c < 40 +SELECT c, d FROM abcd@abcd_pkey WHERE c >= 20 AND c < 40 ---- 22 23 32 33 diff --git a/pkg/sql/logictest/testdata/logic_test/sequences_regclass b/pkg/sql/logictest/testdata/logic_test/sequences_regclass index a1a7e9907a07..f8bc7f5b0d45 100644 --- a/pkg/sql/logictest/testdata/logic_test/sequences_regclass +++ b/pkg/sql/logictest/testdata/logic_test/sequences_regclass @@ -48,7 +48,7 @@ foo CREATE TABLE public.foo ( j INT8 NOT NULL DEFAULT nextval('public.test_seq'::REGCLASS), k INT8 NOT NULL DEFAULT nextval('public.foo_k_seq'::REGCLASS), l INT8 NOT NULL DEFAULT currval('diff_db.public.test_seq'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT foo_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i, j, k, l) ) @@ -139,7 +139,7 @@ bar CREATE TABLE public.bar ( i INT8 NOT NULL DEFAULT nextval('public.new_bar_i_seq'::REGCLASS), j INT8 NOT NULL DEFAULT currval('public.new_s1'::REGCLASS), k INT8 NOT NULL DEFAULT nextval('public.new_s2'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT bar_pkey PRIMARY KEY (i ASC), FAMILY fam_0_i_j_k (i, j, k) ) @@ -196,7 +196,7 @@ new_other_db.public.t CREATE TABLE public.t ( i INT8 NOT NULL DEFAULT nextval('new_other_db.public.s'::REGCLASS), j INT8 NOT NULL DEFAULT currval('new_other_db.public.s2'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) ) @@ -260,7 +260,7 @@ tb CREATE TABLE public.tb ( i INT8 NOT NULL DEFAULT nextval('test_schema.tb_i_seq'::REGCLASS), j INT8 NOT NULL DEFAULT nextval('test_schema.sc_s1'::REGCLASS), k INT8 NOT NULL DEFAULT currval('test_schema.sc_s2'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT tb_pkey PRIMARY KEY (i ASC), FAMILY fam_0_i_j_k (i, j, k) ) @@ -315,7 +315,7 @@ new_test_schema.foo CREATE TABLE new_test_schema.foo ( i INT8 NOT NULL DEFAULT nextval('new_test_schema.foo_i_seq'::REGCLASS), j INT8 NOT NULL DEFAULT nextval('new_test_schema.s3'::REGCLASS), k INT8 NOT NULL DEFAULT currval('new_test_schema.s4'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT foo_pkey PRIMARY KEY (i ASC), FAMILY fam_0_i_j_k (i, j, k) ) @@ -381,7 +381,7 @@ t2 CREATE TABLE public.t2 ( i INT8 NOT NULL DEFAULT nextval('public.s5_new'::REGCLASS), j INT8 NOT NULL DEFAULT nextval('public.s5_new'::REGCLASS), rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t2_pkey PRIMARY KEY (rowid ASC), FAMILY fam_0_i_j_rowid (i, j, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/serial b/pkg/sql/logictest/testdata/logic_test/serial index be5f333957a0..905991e7f1de 100644 --- a/pkg/sql/logictest/testdata/logic_test/serial +++ b/pkg/sql/logictest/testdata/logic_test/serial @@ -16,7 +16,7 @@ serial CREATE TABLE public.serial ( a INT8 NOT NULL DEFAULT unique_rowid(), b INT8 NULL DEFAULT 7:::INT8, c INT8 NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT serial_pkey PRIMARY KEY (a ASC), UNIQUE INDEX serial_c_key (c ASC), FAMILY "primary" (a, b, c) ) @@ -55,7 +55,7 @@ smallbig CREATE TABLE public.smallbig ( b INT8 NOT NULL DEFAULT unique_rowid(), c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT smallbig_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, rowid) ) @@ -79,7 +79,7 @@ serials CREATE TABLE public.serials ( c INT8 NOT NULL DEFAULT unique_rowid(), d INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT serials_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, rowid) ) @@ -120,7 +120,7 @@ serial CREATE TABLE public.serial ( a INT8 NOT NULL DEFAULT nextval('public.serial_a_seq'::REGCLASS), b INT8 NULL DEFAULT 7:::INT8, c INT8 NOT NULL DEFAULT nextval('public.serial_c_seq2'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT serial_pkey PRIMARY KEY (a ASC), UNIQUE INDEX serial_c_key (c ASC), FAMILY "primary" (a, b, c) ) @@ -164,7 +164,7 @@ smallbig CREATE TABLE public.smallbig ( b INT8 NOT NULL DEFAULT nextval('public.smallbig_b_seq'::REGCLASS), c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT smallbig_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, rowid) ) @@ -188,7 +188,7 @@ serials CREATE TABLE public.serials ( c INT8 NOT NULL DEFAULT nextval('public.serials_c_seq'::REGCLASS), d INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT serials_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, rowid) ) @@ -225,7 +225,7 @@ serial CREATE TABLE public.serial ( a INT8 NOT NULL DEFAULT nextval('public.serial_a_seq1'::REGCLASS), b INT8 NULL DEFAULT 7:::INT8, c INT8 NOT NULL DEFAULT nextval('public.serial_c_seq3'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT serial_pkey PRIMARY KEY (a ASC), UNIQUE INDEX serial_c_key (c ASC), FAMILY "primary" (a, b, c) ) @@ -281,7 +281,7 @@ SHOW CREATE TABLE "serial_MixedCase" a INT8 NOT NULL DEFAULT nextval('public."serial_MixedCase_a_seq"'::REGCLASS), b INT8 NULL DEFAULT 7:::INT8, c INT8 NOT NULL DEFAULT nextval('public."serial_MixedCase_c_seq"'::REGCLASS), - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT "serial_MixedCase_pkey" PRIMARY KEY (a ASC), UNIQUE INDEX "serial_MixedCase_c_key" (c ASC), FAMILY "primary" (a, b, c) ) @@ -309,7 +309,7 @@ smallbig CREATE TABLE public.smallbig ( b INT8 NOT NULL DEFAULT nextval('public.smallbig_b_seq1'::REGCLASS), c INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT smallbig_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, rowid) ) @@ -333,7 +333,7 @@ serials CREATE TABLE public.serials ( c INT8 NOT NULL DEFAULT nextval('public.serials_c_seq1'::REGCLASS), d INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT serials_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, b, c, d, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/show_create b/pkg/sql/logictest/testdata/logic_test/show_create index 01152a5ac591..bf17557d0f75 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_create +++ b/pkg/sql/logictest/testdata/logic_test/show_create @@ -32,7 +32,7 @@ c CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), INDEX c_a_b_idx (a ASC, b ASC), FAMILY fam_0_a_rowid (a, rowid), FAMILY fam_1_b (b), @@ -60,7 +60,7 @@ c CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_a FOREIGN KEY (a) REFERENCES public.d(d) NOT VALID, INDEX c_a_b_idx (a ASC, b ASC), UNIQUE INDEX unique_a (a ASC), @@ -91,7 +91,7 @@ c CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_a FOREIGN KEY (a) REFERENCES public.d(d), INDEX c_a_b_idx (a ASC, b ASC), UNIQUE INDEX unique_a (a ASC), diff --git a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables index 612aa085754d..eb2d87c00d99 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables +++ b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables @@ -50,19 +50,19 @@ CREATE TABLE public.parent ( y INT8 NULL, z INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT parent_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX parent_x_y_z_key (x ASC, y ASC, z ASC), UNIQUE INDEX parent_x_key (x ASC), FAMILY f1 (x, y, z, rowid) ); CREATE TABLE public.full_test ( - x INT8 NULL, - y INT8 NULL, - z INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - UNIQUE INDEX full_test_x_key (x ASC), - FAMILY f1 (x, y, z, rowid) + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT full_test_pkey PRIMARY KEY (rowid ASC), + UNIQUE INDEX full_test_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) ); CREATE VIEW public.vx ("?column?") AS SELECT 1; CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; @@ -98,19 +98,19 @@ CREATE TABLE public.parent ( y INT8 NULL, z INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT parent_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX parent_x_y_z_key (x ASC, y ASC, z ASC), UNIQUE INDEX parent_x_key (x ASC), FAMILY f1 (x, y, z, rowid) ); CREATE TABLE public.full_test ( - x INT8 NULL, - y INT8 NULL, - z INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - UNIQUE INDEX full_test_x_key (x ASC), - FAMILY f1 (x, y, z, rowid) + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT full_test_pkey PRIMARY KEY (rowid ASC), + UNIQUE INDEX full_test_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) ); CREATE VIEW public.vx ("?column?") AS SELECT 1; CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; @@ -168,50 +168,50 @@ SHOW CREATE ALL TABLES create_statement CREATE TABLE public.b ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT b_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) ); CREATE TABLE public.a ( i INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT a_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ); CREATE TABLE public.g ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT g_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) ); CREATE TABLE public.f ( i INT8 NOT NULL, g INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT f_pkey PRIMARY KEY (i ASC), FAMILY f1 (i, g) ); CREATE TABLE public.e ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT e_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) ); CREATE TABLE public.d ( i INT8 NOT NULL, e INT8 NULL, f INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT d_pkey PRIMARY KEY (i ASC), FAMILY f1 (i, e, f) ); CREATE TABLE public.c ( - i INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - FAMILY "primary" (i, rowid) + i INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), + FAMILY "primary" (i, rowid) ); CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; CREATE TABLE public.s_tbl ( - id INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), - v INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY f1 (id, v) + id INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), + v INT8 NULL, + CONSTRAINT s_tbl_pkey PRIMARY KEY (id ASC), + FAMILY f1 (id, v) ); ALTER TABLE public.a ADD CONSTRAINT fk_i_ref_b FOREIGN KEY (i) REFERENCES public.b(i); ALTER TABLE public.f ADD CONSTRAINT fk_g_ref_g FOREIGN KEY (g) REFERENCES public.g(i); @@ -248,17 +248,17 @@ SHOW CREATE ALL TABLES ---- create_statement CREATE TABLE public.loop_b ( - id INT8 NOT NULL, - a_id INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY f1 (id, a_id) + id INT8 NOT NULL, + a_id INT8 NULL, + CONSTRAINT loop_b_pkey PRIMARY KEY (id ASC), + FAMILY f1 (id, a_id) ); CREATE TABLE public.loop_a ( - id INT8 NOT NULL, - b_id INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - INDEX loop_a_b_id_idx (b_id ASC), - FAMILY f1 (id, b_id) + id INT8 NOT NULL, + b_id INT8 NULL, + CONSTRAINT loop_a_pkey PRIMARY KEY (id ASC), + INDEX loop_a_b_id_idx (b_id ASC), + FAMILY f1 (id, b_id) ); ALTER TABLE public.loop_b ADD CONSTRAINT fk_a_id_ref_loop_a FOREIGN KEY (a_id) REFERENCES public.loop_a(id) ON DELETE CASCADE; ALTER TABLE public.loop_a ADD CONSTRAINT b_id_delete_constraint FOREIGN KEY (b_id) REFERENCES public.loop_b(id) ON DELETE CASCADE; @@ -302,7 +302,7 @@ create_statement CREATE TABLE public.t ( a INT8 NOT NULL, b INT8 NULL AS (a + 1:::INT8) STORED, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_pkey PRIMARY KEY (a ASC), FAMILY f1 (a, b) ); @@ -321,7 +321,7 @@ create_statement CREATE TABLE public.";" ( ";" INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT ";_pkey" PRIMARY KEY (rowid ASC), INDEX ";_;_idx" (";" ASC), FAMILY "primary" (";", rowid) ); @@ -333,7 +333,7 @@ CREATE DATABASE test_comment; USE test_comment; CREATE TABLE test_comment."t t" ("x'" INT PRIMARY KEY); COMMENT ON TABLE test_comment."t t" IS 'has '' quotes'; -COMMENT ON INDEX test_comment."t t"@primary IS 'has '' more '' quotes'; +COMMENT ON INDEX test_comment."t t"@"t t_pkey" IS 'has '' more '' quotes'; COMMENT ON COLUMN test_comment."t t"."x'" IS 'i '' just '' love '' quotes'; query T colnames @@ -342,12 +342,12 @@ SHOW CREATE ALL TABLES create_statement CREATE TABLE public."t t" ( "x'" INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY ("x'" ASC), + CONSTRAINT "t t_pkey" PRIMARY KEY ("x'" ASC), FAMILY "primary" ("x'") ); COMMENT ON TABLE public."t t" IS e'has \' quotes'; COMMENT ON COLUMN public."t t"."x'" IS e'i \' just \' love \' quotes'; -COMMENT ON INDEX public."t t"@primary IS e'has \' more \' quotes'; +COMMENT ON INDEX public."t t"@"t t_pkey" IS e'has \' more \' quotes'; # Ensure schemas are shown correctly. statement ok @@ -365,13 +365,13 @@ create_statement CREATE TABLE sc1.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); CREATE TABLE sc2.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); @@ -401,7 +401,7 @@ create_statement CREATE TABLE public.t ( x public.test NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); @@ -421,7 +421,7 @@ CREATE TABLE public.t ( z INT8 NULL, h STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY f1 (x, y, rowid), FAMILY f2 (z), FAMILY f3 (h) diff --git a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin index b3e8060cdad6..a1a3108deae4 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin +++ b/pkg/sql/logictest/testdata/logic_test/show_create_all_tables_builtin @@ -48,19 +48,19 @@ CREATE TABLE public.parent ( y INT8 NULL, z INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT parent_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX parent_x_y_z_key (x ASC, y ASC, z ASC), UNIQUE INDEX parent_x_key (x ASC), FAMILY f1 (x, y, z, rowid) ); CREATE TABLE public.full_test ( - x INT8 NULL, - y INT8 NULL, - z INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - UNIQUE INDEX full_test_x_key (x ASC), - FAMILY f1 (x, y, z, rowid) + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT full_test_pkey PRIMARY KEY (rowid ASC), + UNIQUE INDEX full_test_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) ); CREATE VIEW public.vx ("?column?") AS SELECT 1; CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; @@ -94,19 +94,19 @@ CREATE TABLE public.parent ( y INT8 NULL, z INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT parent_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX parent_x_y_z_key (x ASC, y ASC, z ASC), UNIQUE INDEX parent_x_key (x ASC), FAMILY f1 (x, y, z, rowid) ); CREATE TABLE public.full_test ( - x INT8 NULL, - y INT8 NULL, - z INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - UNIQUE INDEX full_test_x_key (x ASC), - FAMILY f1 (x, y, z, rowid) + x INT8 NULL, + y INT8 NULL, + z INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT full_test_pkey PRIMARY KEY (rowid ASC), + UNIQUE INDEX full_test_x_key (x ASC), + FAMILY f1 (x, y, z, rowid) ); CREATE VIEW public.vx ("?column?") AS SELECT 1; CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; @@ -162,50 +162,50 @@ SELECT crdb_internal.show_create_all_tables('test_fk_order') ---- CREATE TABLE public.b ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT b_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) ); CREATE TABLE public.a ( i INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT a_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid) ); CREATE TABLE public.g ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT g_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) ); CREATE TABLE public.f ( i INT8 NOT NULL, g INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT f_pkey PRIMARY KEY (i ASC), FAMILY f1 (i, g) ); CREATE TABLE public.e ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT e_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) ); CREATE TABLE public.d ( i INT8 NOT NULL, e INT8 NULL, f INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT d_pkey PRIMARY KEY (i ASC), FAMILY f1 (i, e, f) ); CREATE TABLE public.c ( - i INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - FAMILY "primary" (i, rowid) + i INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), + FAMILY "primary" (i, rowid) ); CREATE SEQUENCE public.s MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1; CREATE TABLE public.s_tbl ( - id INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), - v INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY f1 (id, v) + id INT8 NOT NULL DEFAULT nextval('public.s'::REGCLASS), + v INT8 NULL, + CONSTRAINT s_tbl_pkey PRIMARY KEY (id ASC), + FAMILY f1 (id, v) ); ALTER TABLE public.a ADD CONSTRAINT fk_i_ref_b FOREIGN KEY (i) REFERENCES public.b(i); ALTER TABLE public.f ADD CONSTRAINT fk_g_ref_g FOREIGN KEY (g) REFERENCES public.g(i); @@ -241,17 +241,17 @@ query T SELECT crdb_internal.show_create_all_tables('test_cycle') ---- CREATE TABLE public.loop_b ( - id INT8 NOT NULL, - a_id INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - FAMILY f1 (id, a_id) + id INT8 NOT NULL, + a_id INT8 NULL, + CONSTRAINT loop_b_pkey PRIMARY KEY (id ASC), + FAMILY f1 (id, a_id) ); CREATE TABLE public.loop_a ( - id INT8 NOT NULL, - b_id INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), - INDEX loop_a_b_id_idx (b_id ASC), - FAMILY f1 (id, b_id) + id INT8 NOT NULL, + b_id INT8 NULL, + CONSTRAINT loop_a_pkey PRIMARY KEY (id ASC), + INDEX loop_a_b_id_idx (b_id ASC), + FAMILY f1 (id, b_id) ); ALTER TABLE public.loop_b ADD CONSTRAINT fk_a_id_ref_loop_a FOREIGN KEY (a_id) REFERENCES public.loop_a(id) ON DELETE CASCADE; ALTER TABLE public.loop_a ADD CONSTRAINT b_id_delete_constraint FOREIGN KEY (b_id) REFERENCES public.loop_b(id) ON DELETE CASCADE; @@ -289,10 +289,10 @@ query T SELECT crdb_internal.show_create_all_tables('test_computed_column') ---- CREATE TABLE public.t ( - a INT8 NOT NULL, - b INT8 NULL AS (a + 1:::INT8) STORED, - CONSTRAINT "primary" PRIMARY KEY (a ASC), - FAMILY f1 (a, b) + a INT8 NOT NULL, + b INT8 NULL AS (a + 1:::INT8) STORED, + CONSTRAINT t_pkey PRIMARY KEY (a ASC), + FAMILY f1 (a, b) ); # Test showing a table with a semicolon in the table, index, and @@ -306,11 +306,11 @@ query T SELECT crdb_internal.show_create_all_tables('test_escaping') ---- CREATE TABLE public.";" ( - ";" INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - INDEX ";_;_idx" (";" ASC), - FAMILY "primary" (";", rowid) + ";" INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT ";_pkey" PRIMARY KEY (rowid ASC), + INDEX ";_;_idx" (";" ASC), + FAMILY "primary" (";", rowid) ); # Ensure quotes in comments are properly escaped, also that the object names @@ -319,7 +319,7 @@ statement ok CREATE DATABASE test_comment; CREATE TABLE test_comment."t t" ("x'" INT PRIMARY KEY); COMMENT ON TABLE test_comment."t t" IS 'has '' quotes'; -COMMENT ON INDEX test_comment."t t"@primary IS 'has '' more '' quotes'; +COMMENT ON INDEX test_comment."t t"@"t t_pkey" IS 'has '' more '' quotes'; COMMENT ON COLUMN test_comment."t t"."x'" IS 'i '' just '' love '' quotes'; query T @@ -327,12 +327,12 @@ SELECT crdb_internal.show_create_all_tables('test_comment') ---- CREATE TABLE public."t t" ( "x'" INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY ("x'" ASC), + CONSTRAINT "t t_pkey" PRIMARY KEY ("x'" ASC), FAMILY "primary" ("x'") ); COMMENT ON TABLE public."t t" IS e'has \' quotes'; COMMENT ON COLUMN public."t t"."x'" IS e'i \' just \' love \' quotes'; -COMMENT ON INDEX public."t t"@primary IS e'has \' more \' quotes'; +COMMENT ON INDEX public."t t"@"t t_pkey" IS e'has \' more \' quotes'; # Ensure schemas are shown correctly. statement ok @@ -347,16 +347,16 @@ query T SELECT crdb_internal.show_create_all_tables('test_schema') ---- CREATE TABLE sc1.t ( - x INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - FAMILY "primary" (x, rowid) + x INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), + FAMILY "primary" (x, rowid) ); CREATE TABLE sc2.t ( - x INT8 NULL, - rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), - FAMILY "primary" (x, rowid) + x INT8 NULL, + rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), + FAMILY "primary" (x, rowid) ); # Ensure sequences are shown correctly. @@ -383,13 +383,13 @@ COMMIT; CREATE TABLE sc1.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); CREATE TABLE sc2.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); @@ -402,12 +402,12 @@ COMMIT; CREATE TABLE sc1.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); CREATE TABLE sc2.t ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ); diff --git a/pkg/sql/logictest/testdata/logic_test/show_fingerprints b/pkg/sql/logictest/testdata/logic_test/show_fingerprints index d133501e63fe..3b16e28e5d25 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_fingerprints +++ b/pkg/sql/logictest/testdata/logic_test/show_fingerprints @@ -5,7 +5,7 @@ CREATE TABLE t (a INT PRIMARY KEY, b INT, c INT, d INT, INDEX (b) STORING (d)) query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary NULL +t_pkey NULL t_b_idx NULL statement ok @@ -15,7 +15,7 @@ INSERT INTO t VALUES (1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12) query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary -7903300865687235210 +t_pkey -7903300865687235210 t_b_idx -5073888452016928166 statement ok @@ -25,7 +25,7 @@ UPDATE t SET b = 9 query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 3722816579880544080 +t_pkey 3722816579880544080 t_b_idx -8494698744159250398 statement ok @@ -35,7 +35,7 @@ UPDATE t SET c = 10 query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 4547357529681250049 +t_pkey 4547357529681250049 t_b_idx -8494698744159250398 statement ok @@ -45,7 +45,7 @@ UPDATE t SET d = 10 query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 492416650140211287 +t_pkey 492416650140211287 t_b_idx -8497500299788131628 statement ok @@ -56,7 +56,7 @@ ALTER TABLE t ADD COLUMN e string; query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 492416650140211287 +t_pkey 492416650140211287 t_b_idx -8497500299788131628 statement ok @@ -66,7 +66,7 @@ UPDATE t SET e = 'foo' WHERE a = 1; query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 1205834892498753533 +t_pkey 1205834892498753533 t_b_idx -8497500299788131628 statement ok @@ -76,13 +76,13 @@ DROP INDEX t@t_b_idx query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 1205834892498753533 +t_pkey 1205834892498753533 # Make sure fully qualified table names work query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE test.t ---- -primary 1205834892498753533 +t_pkey 1205834892498753533 statement ok CREATE TABLE "foo""bar" ("a""b" INT PRIMARY KEY, b INT, INDEX "id""x" (b)) @@ -95,8 +95,8 @@ INSERT INTO "foo""bar" VALUES (1, 2), (3, 4), (5, 6) query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE "foo""bar" ---- -primary 590693963425091008 -id"x 590692863913460538 +foo"bar_pkey 590693963425091008 +id"x 590692863913460538 # BYTES is special cased so make sure tables with both BYTES and non-BYTES # columns work @@ -109,7 +109,7 @@ INSERT INTO blocks VALUES (1, b'\x01') query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE blocks ---- -primary 590700560494856555 +blocks_pkey 590700560494856555 # Verify that we can show fingerprints from a read-only transaction (#39204). statement ok @@ -118,7 +118,7 @@ BEGIN TRANSACTION AS OF SYSTEM TIME '-1us' query TT SHOW EXPERIMENTAL_FINGERPRINTS FROM TABLE t ---- -primary 1205834892498753533 +t_pkey 1205834892498753533 statement ok COMMIT diff --git a/pkg/sql/logictest/testdata/logic_test/show_indexes b/pkg/sql/logictest/testdata/logic_test/show_indexes index 377bd5d17086..bf5f734d6b3b 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_indexes +++ b/pkg/sql/logictest/testdata/logic_test/show_indexes @@ -19,10 +19,10 @@ t1 c_idx true 3 b ASC false t1 d_b_idx false 1 d ASC false false t1 d_b_idx false 2 b ASC false false t1 d_b_idx false 3 a ASC false true -t1 primary false 1 a ASC false false -t1 primary false 2 b ASC false false -t1 primary false 3 c N/A true false -t1 primary false 4 d N/A true false +t1 t1_pkey false 1 a ASC false false +t1 t1_pkey false 2 b ASC false false +t1 t1_pkey false 3 c N/A true false +t1 t1_pkey false 4 d N/A true false statement ok CREATE TABLE t2 ( @@ -59,8 +59,8 @@ t2 d_idx true 1 d ASC false t2 d_idx true 2 c ASC false true t2 d_idx true 3 b ASC false true t2 d_idx true 4 a ASC false true -t2 primary false 1 c ASC false false -t2 primary false 2 b ASC false false -t2 primary false 3 a ASC false false -t2 primary false 4 d N/A true false -t2 primary false 5 e N/A true false +t2 t2_pkey false 1 c ASC false false +t2 t2_pkey false 2 b ASC false false +t2 t2_pkey false 3 a ASC false false +t2 t2_pkey false 4 d N/A true false +t2 t2_pkey false 5 e N/A true false diff --git a/pkg/sql/logictest/testdata/logic_test/show_source b/pkg/sql/logictest/testdata/logic_test/show_source index add8123738a0..9406da4bcb4e 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_source +++ b/pkg/sql/logictest/testdata/logic_test/show_source @@ -455,8 +455,8 @@ CREATE TABLE showdbindexestest.table2 (key2 INT PRIMARY KEY); query TTBITTBB SHOW INDEXES FROM DATABASE showdbindexestest; ---- -table1 primary false 1 key1 ASC false false -table2 primary false 1 key2 ASC false false +table1 table1_pkey false 1 key1 ASC false false +table2 table2_pkey false 1 key2 ASC false false statement ok CREATE DATABASE "$peci@l"; @@ -470,8 +470,8 @@ CREATE TABLE "$peci@l".table2 (key2 INT PRIMARY KEY); query TTBITTBB SHOW INDEXES FROM DATABASE "$peci@l"; ---- -table1 primary false 1 key1 ASC false false -table2 primary false 1 key2 ASC false false +table1 table1_pkey false 1 key1 ASC false false +table2 table2_pkey false 1 key2 ASC false false # Test SHOW LOCALITY telemetry. query T @@ -546,16 +546,16 @@ COMMENT ON INDEX t@i2 IS 'comm''ent3' query TTBITTBBT SHOW INDEXES FROM t WITH COMMENT ---- -t i1 true 1 x ASC false false NULL -t i1 true 2 rowid ASC false true NULL -t i2 true 1 y ASC false false comm'ent3 -t i2 true 2 rowid ASC false true comm'ent3 -t i3 true 1 z ASC false false NULL -t i3 true 2 rowid ASC false true NULL -t primary false 1 rowid ASC false false NULL -t primary false 2 x N/A true false NULL -t primary false 3 y N/A true false NULL -t primary false 4 z N/A true false NULL +t i1 true 1 x ASC false false NULL +t i1 true 2 rowid ASC false true NULL +t i2 true 1 y ASC false false comm'ent3 +t i2 true 2 rowid ASC false true comm'ent3 +t i3 true 1 z ASC false false NULL +t i3 true 2 rowid ASC false true NULL +t t_pkey false 1 rowid ASC false false NULL +t t_pkey false 2 x N/A true false NULL +t t_pkey false 3 y N/A true false NULL +t t_pkey false 4 z N/A true false NULL query TTBITTBBT SHOW INDEXES FROM t2 WITH COMMENT @@ -566,7 +566,7 @@ t2 i2 true 1 y ASC false false NULL t2 i2 true 2 rowid ASC false true NULL t2 i3 true 1 z ASC false false NULL t2 i3 true 2 rowid ASC false true NULL -t2 primary false 1 rowid ASC false false NULL -t2 primary false 2 x N/A true false NULL -t2 primary false 3 y N/A true false NULL -t2 primary false 4 z N/A true false NULL +t2 t2_pkey false 1 rowid ASC false false NULL +t2 t2_pkey false 2 x N/A true false NULL +t2 t2_pkey false 3 y N/A true false NULL +t2 t2_pkey false 4 z N/A true false NULL diff --git a/pkg/sql/logictest/testdata/logic_test/srfs b/pkg/sql/logictest/testdata/logic_test/srfs index 930c6b228afb..dd4008f8699f 100644 --- a/pkg/sql/logictest/testdata/logic_test/srfs +++ b/pkg/sql/logictest/testdata/logic_test/srfs @@ -967,10 +967,10 @@ SELECT tbl, idx, (i.keys).n JOIN pg_class ct2 ON ix.indexrelid = ct2.oid) AS i ORDER BY 1,2,3 ---- -tbl idx n -vals primary 1 -vals woo 1 -vals woo 2 +tbl idx n +vals vals_pkey 1 +vals woo 1 +vals woo 2 subtest dbviz_example_query @@ -1016,7 +1016,7 @@ SELECT NULL AS TABLE_CAT, WHERE true AND ct.relname = 'j' AND i.indisprimary ORDER BY table_name, pk_name, key_seq ---- -NULL public j x 1 primary +NULL public j x 1 j_pkey subtest liquibase_example_query diff --git a/pkg/sql/logictest/testdata/logic_test/storing b/pkg/sql/logictest/testdata/logic_test/storing index d017d3ec60bc..0215dbace47b 100644 --- a/pkg/sql/logictest/testdata/logic_test/storing +++ b/pkg/sql/logictest/testdata/logic_test/storing @@ -20,10 +20,10 @@ t c_idx false 1 c ASC false t c_idx false 2 b N/A true false t c_idx false 3 d N/A true false t c_idx false 4 a ASC false true -t primary false 1 a ASC false false -t primary false 2 b N/A true false -t primary false 3 c N/A true false -t primary false 4 d N/A true false +t t_pkey false 1 a ASC false false +t t_pkey false 2 b N/A true false +t t_pkey false 3 c N/A true false +t t_pkey false 4 d N/A true false statement ok INSERT INTO t VALUES (1, 2, 3, 4) diff --git a/pkg/sql/logictest/testdata/logic_test/table b/pkg/sql/logictest/testdata/logic_test/table index 55774ff3ac71..96a29d7e7f98 100644 --- a/pkg/sql/logictest/testdata/logic_test/table +++ b/pkg/sql/logictest/testdata/logic_test/table @@ -28,7 +28,7 @@ CREATE TABLE b (id INT PRIMARY KEY, id INT) statement error multiple primary keys for table "b" are not allowed CREATE TABLE b (id INT PRIMARY KEY, id2 INT PRIMARY KEY) -statement error index \"primary\" contains duplicate column \"a\" +statement error index \"dup_primary_pkey\" contains duplicate column \"a\" CREATE TABLE dup_primary (a int, primary key (a,a)) statement error index \"dup_unique_a_a_key\" contains duplicate column \"a\" @@ -76,9 +76,9 @@ c c_foo_idx true 1 foo ASC fal c c_foo_idx true 2 id ASC false true c c_foo_idx1 true 1 foo ASC false false c c_foo_idx1 true 2 id ASC false true -c primary false 1 id ASC false false -c primary false 2 foo N/A true false -c primary false 3 bar N/A true false +c c_pkey false 1 id ASC false false +c c_pkey false 2 foo N/A true false +c c_pkey false 3 bar N/A true false query TTBITTBBT colnames SHOW INDEXES FROM c WITH COMMENT @@ -93,9 +93,9 @@ c c_foo_idx true 1 foo ASC fal c c_foo_idx true 2 id ASC false true index_comment c c_foo_idx1 true 1 foo ASC false false NULL c c_foo_idx1 true 2 id ASC false true NULL -c primary false 1 id ASC false false NULL -c primary false 2 foo N/A true false NULL -c primary false 3 bar N/A true false NULL +c c_pkey false 1 id ASC false false NULL +c c_pkey false 2 foo N/A true false NULL +c c_pkey false 3 bar N/A true false NULL # primary keys can never be null @@ -104,8 +104,8 @@ SHOW CONSTRAINTS FROM c WITH COMMENT ---- table_name constraint_name constraint_type details validated comment c c_bar_key UNIQUE UNIQUE (bar ASC) true NULL +c c_pkey PRIMARY KEY PRIMARY KEY (id ASC) true NULL c foo_positive CHECK CHECK ((foo > 0)) true NULL -c primary PRIMARY KEY PRIMARY KEY (id ASC) true NULL statement ok CREATE TABLE d ( @@ -115,8 +115,8 @@ CREATE TABLE d ( query TTBTTTB colnames SHOW COLUMNS FROM d ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -id INT8 false NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +id INT8 false NULL · {d_pkey} false statement ok CREATE TABLE e ( @@ -126,8 +126,8 @@ CREATE TABLE e ( query TTBTTTB colnames SHOW COLUMNS FROM e ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -id INT8 false NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +id INT8 false NULL · {e_pkey} false statement ok CREATE TABLE f ( @@ -140,10 +140,10 @@ CREATE TABLE f ( query TTBTTTB colnames SHOW COLUMNS FROM f ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -a INT8 false NULL · {primary} false -b INT8 false NULL · {primary} false -c INT8 false NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +a INT8 false NULL · {f_pkey} false +b INT8 false NULL · {f_pkey} false +c INT8 false NULL · {f_pkey} false query TTTTITT colnames SHOW TABLES FROM test WITH COMMENT @@ -191,13 +191,13 @@ CREATE TABLE test.users ( query TTBTTTB colnames SHOW COLUMNS FROM test.users ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -id INT8 false NULL · {bar,foo,primary} false -name VARCHAR false NULL · {bar,foo,primary} false -title VARCHAR true NULL · {primary} false -nickname STRING true NULL · {primary} false -username STRING(10) true NULL · {primary} false -email VARCHAR(100) true NULL · {primary} false +column_name data_type is_nullable column_default generation_expression indices is_hidden +id INT8 false NULL · {bar,foo,users_pkey} false +name VARCHAR false NULL · {bar,foo,users_pkey} false +title VARCHAR true NULL · {users_pkey} false +nickname STRING true NULL · {users_pkey} false +username STRING(10) true NULL · {users_pkey} false +email VARCHAR(100) true NULL · {users_pkey} false query TTBITTBB colnames SHOW INDEXES FROM test.users @@ -207,12 +207,12 @@ users bar false 1 id ASC false users bar false 2 name ASC false false users foo true 1 name ASC false false users foo true 2 id ASC false true -users primary false 1 id ASC false false -users primary false 2 name N/A true false -users primary false 3 title N/A true false -users primary false 4 nickname N/A true false -users primary false 5 username N/A true false -users primary false 6 email N/A true false +users users_pkey false 1 id ASC false false +users users_pkey false 2 name N/A true false +users users_pkey false 3 title N/A true false +users users_pkey false 4 nickname N/A true false +users users_pkey false 5 username N/A true false +users users_pkey false 6 email N/A true false statement error precision for type float must be at least 1 bit CREATE TABLE test.precision (x FLOAT(0)) @@ -233,7 +233,7 @@ test.public.users CREATE TABLE public.users ( nickname STRING NULL, username STRING(10) NULL, email VARCHAR(100) NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT users_pkey PRIMARY KEY (id ASC), INDEX foo (name ASC), UNIQUE INDEX bar (id ASC, name ASC), FAMILY "primary" (id, name), @@ -397,54 +397,54 @@ CREATE TABLE alltypes ( query TTBTTTB colnames SHOW COLUMNS FROM alltypes ---- -column_name data_type is_nullable column_default generation_expression indices is_hidden -cbigint INT8 true NULL · {primary} false -cbigserial INT8 false unique_rowid() · {primary} false -cblob BYTES true NULL · {primary} false -cbool BOOL true NULL · {primary} false -cbit BIT true NULL · {primary} false -cbit12 BIT(12) true NULL · {primary} false -cvarbit VARBIT true NULL · {primary} false -cvarbit12 VARBIT(12) true NULL · {primary} false -cbytea BYTES true NULL · {primary} false -cbytes BYTES true NULL · {primary} false -cchar CHAR true NULL · {primary} false -cchar12 CHAR(12) true NULL · {primary} false -cdate DATE true NULL · {primary} false -cdec DECIMAL true NULL · {primary} false -cdec1 DECIMAL(1) true NULL · {primary} false -cdec21 DECIMAL(2,1) true NULL · {primary} false -cdecimal DECIMAL true NULL · {primary} false -cdecimal1 DECIMAL(1) true NULL · {primary} false -cdecimal21 DECIMAL(2,1) true NULL · {primary} false -cdoubleprecision FLOAT8 true NULL · {primary} false -cfloat FLOAT8 true NULL · {primary} false -cfloat4 FLOAT4 true NULL · {primary} false -cfloat8 FLOAT8 true NULL · {primary} false -cint INT8 true NULL · {primary} false -cint2 INT2 true NULL · {primary} false -cint4 INT4 true NULL · {primary} false -cint64 INT8 true NULL · {primary} false -cint8 INT8 true NULL · {primary} false -cinteger INT8 true NULL · {primary} false -cinterval INTERVAL true NULL · {primary} false -cjson JSONB true NULL · {primary} false -cnumeric DECIMAL true NULL · {primary} false -cnumeric1 DECIMAL(1) true NULL · {primary} false -cnumeric21 DECIMAL(2,1) true NULL · {primary} false -cqchar "char" true NULL · {primary} false -creal FLOAT4 true NULL · {primary} false -cserial INT8 false unique_rowid() · {primary} false -csmallint INT2 true NULL · {primary} false -csmallserial INT8 false unique_rowid() · {primary} false -cstring STRING true NULL · {primary} false -cstring12 STRING(12) true NULL · {primary} false -ctext STRING true NULL · {primary} false -ctimestamp TIMESTAMP true NULL · {primary} false -ctimestampwtz TIMESTAMPTZ true NULL · {primary} false -cvarchar VARCHAR true NULL · {primary} false -cvarchar12 VARCHAR(12) true NULL · {primary} false -rowid INT8 false unique_rowid() · {primary} true +column_name data_type is_nullable column_default generation_expression indices is_hidden +cbigint INT8 true NULL · {alltypes_pkey} false +cbigserial INT8 false unique_rowid() · {alltypes_pkey} false +cblob BYTES true NULL · {alltypes_pkey} false +cbool BOOL true NULL · {alltypes_pkey} false +cbit BIT true NULL · {alltypes_pkey} false +cbit12 BIT(12) true NULL · {alltypes_pkey} false +cvarbit VARBIT true NULL · {alltypes_pkey} false +cvarbit12 VARBIT(12) true NULL · {alltypes_pkey} false +cbytea BYTES true NULL · {alltypes_pkey} false +cbytes BYTES true NULL · {alltypes_pkey} false +cchar CHAR true NULL · {alltypes_pkey} false +cchar12 CHAR(12) true NULL · {alltypes_pkey} false +cdate DATE true NULL · {alltypes_pkey} false +cdec DECIMAL true NULL · {alltypes_pkey} false +cdec1 DECIMAL(1) true NULL · {alltypes_pkey} false +cdec21 DECIMAL(2,1) true NULL · {alltypes_pkey} false +cdecimal DECIMAL true NULL · {alltypes_pkey} false +cdecimal1 DECIMAL(1) true NULL · {alltypes_pkey} false +cdecimal21 DECIMAL(2,1) true NULL · {alltypes_pkey} false +cdoubleprecision FLOAT8 true NULL · {alltypes_pkey} false +cfloat FLOAT8 true NULL · {alltypes_pkey} false +cfloat4 FLOAT4 true NULL · {alltypes_pkey} false +cfloat8 FLOAT8 true NULL · {alltypes_pkey} false +cint INT8 true NULL · {alltypes_pkey} false +cint2 INT2 true NULL · {alltypes_pkey} false +cint4 INT4 true NULL · {alltypes_pkey} false +cint64 INT8 true NULL · {alltypes_pkey} false +cint8 INT8 true NULL · {alltypes_pkey} false +cinteger INT8 true NULL · {alltypes_pkey} false +cinterval INTERVAL true NULL · {alltypes_pkey} false +cjson JSONB true NULL · {alltypes_pkey} false +cnumeric DECIMAL true NULL · {alltypes_pkey} false +cnumeric1 DECIMAL(1) true NULL · {alltypes_pkey} false +cnumeric21 DECIMAL(2,1) true NULL · {alltypes_pkey} false +cqchar "char" true NULL · {alltypes_pkey} false +creal FLOAT4 true NULL · {alltypes_pkey} false +cserial INT8 false unique_rowid() · {alltypes_pkey} false +csmallint INT2 true NULL · {alltypes_pkey} false +csmallserial INT8 false unique_rowid() · {alltypes_pkey} false +cstring STRING true NULL · {alltypes_pkey} false +cstring12 STRING(12) true NULL · {alltypes_pkey} false +ctext STRING true NULL · {alltypes_pkey} false +ctimestamp TIMESTAMP true NULL · {alltypes_pkey} false +ctimestampwtz TIMESTAMPTZ true NULL · {alltypes_pkey} false +cvarchar VARCHAR true NULL · {alltypes_pkey} false +cvarchar12 VARCHAR(12) true NULL · {alltypes_pkey} false +rowid INT8 false unique_rowid() · {alltypes_pkey} true statement ok CREATE DATABASE IF NOT EXISTS smtng @@ -499,7 +499,7 @@ SHOW CREATE TABLE test.null_default test.public.null_default CREATE TABLE public.null_default ( ts TIMESTAMP NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT null_default_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (ts, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/truncate b/pkg/sql/logictest/testdata/logic_test/truncate index ce440254241a..0fdbd1ed288e 100644 --- a/pkg/sql/logictest/testdata/logic_test/truncate +++ b/pkg/sql/logictest/testdata/logic_test/truncate @@ -144,10 +144,10 @@ z comm"en"t2 query TT rowsort SELECT distinct(index_name), comment FROM [SHOW INDEXES FROM t WITH COMMENT] ---- -primary NULL -i1 NULL -i2 comm'ent3 -i3 NULL +t_pkey NULL +i1 NULL +i2 comm'ent3 +i3 NULL # Ensure that truncate comment reasignment works when index and column IDs # don't all start from 1. @@ -177,5 +177,5 @@ z NULL query TT rowsort SELECT distinct(index_name), comment FROM [SHOW INDEXES FROM t WITH COMMENT] ---- -primary NULL -i hello2 +t_pkey NULL +i hello2 diff --git a/pkg/sql/logictest/testdata/logic_test/txn b/pkg/sql/logictest/testdata/logic_test/txn index 1295eeb60f40..069502488aa5 100644 --- a/pkg/sql/logictest/testdata/logic_test/txn +++ b/pkg/sql/logictest/testdata/logic_test/txn @@ -112,7 +112,7 @@ a c statement ok BEGIN -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\('a'\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\('a'\) already exists\. INSERT INTO kv VALUES('unique_key', 'some value'); INSERT INTO kv VALUES('a', 'c'); INSERT INTO kv VALUES('unique_key2', 'some value'); diff --git a/pkg/sql/logictest/testdata/logic_test/unique b/pkg/sql/logictest/testdata/logic_test/unique index 1e031350d784..90e961341c89 100644 --- a/pkg/sql/logictest/testdata/logic_test/unique +++ b/pkg/sql/logictest/testdata/logic_test/unique @@ -135,7 +135,7 @@ statement ok INSERT INTO uniq VALUES (1, 1, 1, 1, 1), (2, 2, 2, 2, 2) # Regular primary key violation. -statement error pgcode 23505 pq: duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(1\) already exists\. +statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_pkey"\nDETAIL: Key \(k\)=\(1\) already exists\. INSERT INTO uniq VALUES (1, 1, 1, 1, 1) # Regular unique index violation. @@ -361,7 +361,7 @@ NULL 5 statement ok INSERT INTO uniq_computed_pk (i, s, d) VALUES (1, 'a', 1.0), (2, 'b', 2.0) -statement error pgcode 23505 pq: duplicate key value violates unique constraint "primary"\nDETAIL: Key \(c_i_expr,i\)=\('bar',1\) already exists\. +statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_pkey"\nDETAIL: Key \(c_i_expr,i\)=\('bar',1\) already exists\. INSERT INTO uniq_computed_pk (i, s, d) VALUES (1, 'c', 3.0) statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_c_s_s_key"\nDETAIL: Key \(c_s,s\)=\('b','b'\) already exists\. @@ -542,7 +542,7 @@ NULL 10 # Check that uniqueness violations are detected in a table with UNIQUE indexes # containing computed columns that are dependent on UNIQUE WITHOUT INDEX # columns. -statement error pgcode 23505 pq: duplicate key value violates unique constraint "primary"\nDETAIL: Key \(c_i_expr,i\)=\('bar',1\) already exists\. +statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_pkey"\nDETAIL: Key \(c_i_expr,i\)=\('bar',1\) already exists\. UPDATE uniq_computed_pk SET i = 1 WHERE i = 2 statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_c_s_s_key"\nDETAIL: Key \(c_s,s\)=\('a','a'\) already exists\. @@ -825,7 +825,7 @@ i # Check that uniqueness violations are detected in a table with UNIQUE indexes # containing computed columns that are dependent on UNIQUE WITHOUT INDEX # columns. -statement error pgcode 23505 pq: duplicate key value violates unique constraint "primary"\nDETAIL: Key \(c_i_expr,i\)=\('bar',2\) already exists\. +statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_pkey"\nDETAIL: Key \(c_i_expr,i\)=\('bar',2\) already exists\. INSERT INTO uniq_computed_pk (i, s, d) VALUES (1, 'a', 1.0) ON CONFLICT (s) DO UPDATE SET i = 2 statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_c_s_s_key"\nDETAIL: Key \(c_s,s\)=\('b','b'\) already exists\. diff --git a/pkg/sql/logictest/testdata/logic_test/update b/pkg/sql/logictest/testdata/logic_test/update index 523d07ac546e..f4b6b0f0eb2b 100644 --- a/pkg/sql/logictest/testdata/logic_test/update +++ b/pkg/sql/logictest/testdata/logic_test/update @@ -255,7 +255,7 @@ SELECT * FROM abc statement count 1 INSERT INTO abc VALUES (4, 5, 6) -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(a\)=\(4\) already exists\. +statement error duplicate key value violates unique constraint "abc_pkey"\nDETAIL: Key \(a\)=\(4\) already exists\. UPDATE abc SET a = 4, b = 3 statement error duplicate key value violates unique constraint "d"\nDETAIL: Key \(c\)=\(6\) already exists\. @@ -472,7 +472,7 @@ SELECT create_statement FROM [SHOW CREATE t29494] ---- CREATE TABLE public.t29494 ( x INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT t29494_pkey PRIMARY KEY (x ASC), FAMILY "primary" (x) ) diff --git a/pkg/sql/logictest/testdata/logic_test/upsert b/pkg/sql/logictest/testdata/logic_test/upsert index 9f7ce2164e49..421226e635cb 100644 --- a/pkg/sql/logictest/testdata/logic_test/upsert +++ b/pkg/sql/logictest/testdata/logic_test/upsert @@ -120,7 +120,7 @@ INSERT INTO kv VALUES (4, 10) ON CONFLICT (k) DO UPDATE SET v = v + 1 statement count 1 INSERT INTO kv VALUES (4, 10) ON CONFLICT (k) DO UPDATE SET v = kv.v + 20 -statement error duplicate key value violates unique constraint "primary"\nDETAIL: Key \(k\)=\(3\) already exists\. +statement error duplicate key value violates unique constraint "kv_pkey"\nDETAIL: Key \(k\)=\(3\) already exists\. INSERT INTO kv VALUES (2, 10) ON CONFLICT (k) DO UPDATE SET k = 3, v = 10 statement count 1 @@ -636,7 +636,7 @@ SELECT create_statement FROM [SHOW CREATE t29494] CREATE TABLE public.t29494 ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t29494_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (x, rowid) ) @@ -800,7 +800,7 @@ a b c d # Final check to ensure that primary index is correct. query TTTT colnames -SELECT * FROM indexed@primary ORDER BY a +SELECT * FROM indexed@indexed_pkey ORDER BY a ---- a b c d 1 1.0 2 3 diff --git a/pkg/sql/logictest/testdata/logic_test/vectorize b/pkg/sql/logictest/testdata/logic_test/vectorize index 6d62594df07a..89dfa56e0986 100644 --- a/pkg/sql/logictest/testdata/logic_test/vectorize +++ b/pkg/sql/logictest/testdata/logic_test/vectorize @@ -458,7 +458,7 @@ CREATE TABLE composite (d DECIMAL, INDEX d_idx (d)); INSERT INTO composite VALUES (NULL), (1), (1.0), (1.00); query T rowsort -SELECT d FROM composite@primary +SELECT d FROM composite@composite_pkey ---- NULL 1 diff --git a/pkg/sql/logictest/testdata/logic_test/virtual_columns b/pkg/sql/logictest/testdata/logic_test/virtual_columns index fe006e11a2c7..f2158d7a13ba 100644 --- a/pkg/sql/logictest/testdata/logic_test/virtual_columns +++ b/pkg/sql/logictest/testdata/logic_test/virtual_columns @@ -1190,7 +1190,7 @@ CREATE TABLE public.t63167_b ( a INT8 NULL, v INT8 NULL AS (a + 1:::INT8) VIRTUAL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT t63167_a_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (a, rowid) ) diff --git a/pkg/sql/logictest/testdata/logic_test/zone_config b/pkg/sql/logictest/testdata/logic_test/zone_config index 43d76c1e914f..8feda8561a6f 100644 --- a/pkg/sql/logictest/testdata/logic_test/zone_config +++ b/pkg/sql/logictest/testdata/logic_test/zone_config @@ -167,7 +167,7 @@ SHOW CREATE TABLE a ---- a CREATE TABLE public.a ( id INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (id ASC), + CONSTRAINT a_pkey PRIMARY KEY (id ASC), FAMILY "primary" (id) ); ALTER TABLE test.public.a CONFIGURE ZONE USING @@ -322,7 +322,7 @@ SHOW CREATE TABLE same_table_name ---- same_table_name CREATE TABLE public.same_table_name ( rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT same_table_name_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (rowid) ); ALTER TABLE test.public.same_table_name CONFIGURE ZONE USING @@ -333,7 +333,7 @@ SHOW CREATE TABLE alternative_schema.same_table_name ---- alternative_schema.same_table_name CREATE TABLE alternative_schema.same_table_name ( rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT same_table_name_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (rowid) ); ALTER TABLE test.alternative_schema.same_table_name CONFIGURE ZONE USING diff --git a/pkg/sql/opt/exec/execbuilder/testdata/aggregate b/pkg/sql/opt/exec/execbuilder/testdata/aggregate index a5535649da12..ab94852f3978 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/aggregate +++ b/pkg/sql/opt/exec/execbuilder/testdata/aggregate @@ -58,7 +58,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -111,7 +111,7 @@ vectorized: true └── • scan columns: (k int, v int, s string) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Aggregate functions trigger aggregation and computation when there is no source. @@ -205,7 +205,7 @@ vectorized: true columns: (k int) ordering: +k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Selecting and grouping on a more complex expression works. @@ -229,7 +229,7 @@ vectorized: true └── • scan columns: (k int, v int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Selecting a more complex expression, made up of things which are each grouped, works. @@ -257,7 +257,7 @@ vectorized: true columns: (k int, v int) ordering: +k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -274,7 +274,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -293,7 +293,7 @@ vectorized: true └── • scan columns: (k int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -315,7 +315,7 @@ vectorized: true └── • scan columns: (v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -346,13 +346,13 @@ vectorized: true ├── • scan │ columns: (k, v, w, s) │ estimated row count: 1,000 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -378,13 +378,13 @@ vectorized: true ├── • scan │ columns: (k) │ estimated row count: 1,000 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -410,13 +410,13 @@ vectorized: true ├── • scan │ columns: (k) │ estimated row count: 1,000 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # A useful optimization: naked tuple expansion in GROUP BY clause. @@ -443,13 +443,13 @@ vectorized: true ├── • scan │ columns: (k) │ estimated row count: 1,000 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Show reuse of renders expression inside an expansion. @@ -475,13 +475,13 @@ vectorized: true ├── • scan │ columns: (v, w, s) │ estimated row count: 1,000 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN statement ok @@ -506,7 +506,7 @@ vectorized: true └── • scan columns: (a char) estimated row count: 1 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: LIMITED SCAN limit: 1 @@ -530,7 +530,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: abc@primary +│ table: abc@abc_pkey │ spans: LIMITED SCAN │ limit: 1 │ @@ -543,7 +543,7 @@ vectorized: true │ └── • revscan missing stats - table: abc@primary + table: abc@abc_pkey spans: LIMITED SCAN limit: 1 @@ -801,7 +801,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # We don't yet support the optimization to convert multiple aggregates to @@ -1069,7 +1069,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # VARIANCE/STDDEV @@ -1082,14 +1082,14 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /xyz/primary/1 -> NULL -fetched: /xyz/primary/1/y -> 2 -fetched: /xyz/primary/1/z -> 3.0 -fetched: /xyz/primary/4 -> NULL -fetched: /xyz/primary/4/y -> 5 -fetched: /xyz/primary/4/z -> 6.0 -fetched: /xyz/primary/7 -> NULL -fetched: /xyz/primary/7/z -> 8.0 +fetched: /xyz/xyz_pkey/1 -> NULL +fetched: /xyz/xyz_pkey/1/y -> 2 +fetched: /xyz/xyz_pkey/1/z -> 3.0 +fetched: /xyz/xyz_pkey/4 -> NULL +fetched: /xyz/xyz_pkey/4/y -> 5 +fetched: /xyz/xyz_pkey/4/z -> 6.0 +fetched: /xyz/xyz_pkey/7 -> NULL +fetched: /xyz/xyz_pkey/7/z -> 8.0 output row: [9 4.5 6.33333333333333] query T @@ -1189,7 +1189,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1213,7 +1213,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1247,7 +1247,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Check that filters propagate through no-op aggregation. @@ -1277,7 +1277,7 @@ vectorized: true └── • scan columns: (v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Verify that FILTER works. @@ -1317,7 +1317,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: filter_test@primary + table: filter_test@filter_test_pkey spans: FULL SCAN query T @@ -1346,7 +1346,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: filter_test@primary + table: filter_test@filter_test_pkey spans: FULL SCAN # Tests with * inside GROUP BY. @@ -1364,7 +1364,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1391,13 +1391,13 @@ vectorized: true ├── • scan │ columns: (k int) │ estimated row count: 1,000 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan columns: (d decimal) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # opt_test is used for tests around the single-row optimization for MIN/MAX. @@ -1491,7 +1491,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: opt_test@primary + table: opt_test@opt_test_pkey spans: FULL SCAN # Verify that we don't use the optimization if there is a GROUP BY. @@ -1516,7 +1516,7 @@ vectorized: true columns: (k int, v int) ordering: +k estimated row count: 1,000 (missing stats) - table: opt_test@primary + table: opt_test@opt_test_pkey spans: FULL SCAN statement ok @@ -1536,7 +1536,7 @@ vectorized: true └── • scan columns: (a int, b int) estimated row count: 1,000 (missing stats) - table: ab@primary + table: ab@ab_pkey spans: FULL SCAN query T @@ -1565,13 +1565,13 @@ vectorized: true ├── • scan │ columns: (a int, b int) │ estimated row count: 1,000 (missing stats) - │ table: ab@primary + │ table: ab@ab_pkey │ spans: FULL SCAN │ └── • scan columns: (x string, y string) estimated row count: 1,000 (missing stats) - table: xy@primary + table: xy@xy_pkey spans: FULL SCAN # Test that ordering on GROUP BY columns is maintained. @@ -1719,7 +1719,7 @@ vectorized: true └── • scan columns: (v int, w int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN statement ok @@ -1751,7 +1751,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN query T @@ -1779,7 +1779,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN query T @@ -1802,7 +1802,7 @@ vectorized: true └── • scan columns: (v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1823,7 +1823,7 @@ vectorized: true └── • scan columns: (k, s) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1841,7 +1841,7 @@ vectorized: true columns: (k, s) ordering: +k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1864,7 +1864,7 @@ vectorized: true └── • scan columns: (k, s) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1890,7 +1890,7 @@ vectorized: true columns: (k, s) ordering: +k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Verify that we project away all input columns for count(*). @@ -1922,7 +1922,7 @@ vectorized: true └── • scan columns: (v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN @@ -1971,7 +1971,7 @@ vectorized: true └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN statement ok @@ -2017,7 +2017,7 @@ vectorized: true └── • scan columns: (company_id, employee) estimated row count: 1,000 (missing stats) - table: string_agg_test@primary + table: string_agg_test@string_agg_test_pkey spans: FULL SCAN query T @@ -2056,7 +2056,7 @@ vectorized: true └── • scan columns: (company_id, employee) estimated row count: 1,000 (missing stats) - table: string_agg_test@primary + table: string_agg_test@string_agg_test_pkey spans: FULL SCAN query T @@ -2095,7 +2095,7 @@ vectorized: true └── • scan columns: (company_id, employee) estimated row count: 1,000 (missing stats) - table: string_agg_test@primary + table: string_agg_test@string_agg_test_pkey spans: FULL SCAN query T @@ -2134,5 +2134,5 @@ vectorized: true └── • scan columns: (company_id, employee) estimated row count: 1,000 (missing stats) - table: string_agg_test@primary + table: string_agg_test@string_agg_test_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/array b/pkg/sql/opt/exec/execbuilder/testdata/array index d500c59488bb..75f4d4fa14fc 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/array +++ b/pkg/sql/opt/exec/execbuilder/testdata/array @@ -17,7 +17,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -31,7 +31,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -45,7 +45,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -62,7 +62,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -79,7 +79,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN statement ok @@ -103,5 +103,5 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/catalog b/pkg/sql/opt/exec/execbuilder/testdata/catalog index 772c96666b9d..194dd6bb6d33 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/catalog +++ b/pkg/sql/opt/exec/execbuilder/testdata/catalog @@ -18,7 +18,7 @@ TABLE xyz ├── z int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX xyz_pkey │ └── x int not null └── INDEX foo ├── z int @@ -53,7 +53,7 @@ TABLE abcdef ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] ├── CHECK (f > 2:::INT8) - └── PRIMARY INDEX primary + └── PRIMARY INDEX abcdef_pkey └── rowid int not null default (unique_rowid()) [hidden] scan abcdef ├── check constraint expressions @@ -91,7 +91,7 @@ TABLE uvwxy ├── FAMILY fam_0_u_v_w (u, v, w) ├── FAMILY fam_1_x (x) ├── FAMILY fam_2_y (y) - └── PRIMARY INDEX primary + └── PRIMARY INDEX uvwxy_pkey ├── u int not null └── v int not null scan uvwxy @@ -119,7 +119,7 @@ TABLE child ├── r int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX child_pkey │ └── c int not null └── CONSTRAINT fk FOREIGN KEY child (p, q, r) REFERENCES parent (p, q, r) scan child @@ -134,7 +134,7 @@ TABLE parent ├── other int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX parent_pkey │ ├── p int not null │ ├── q int not null │ └── r int not null @@ -161,7 +161,7 @@ TABLE child2 ├── r int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX child2_pkey │ └── c int not null └── CONSTRAINT fk FOREIGN KEY child2 (p, q, r) REFERENCES parent (p, q, r) MATCH FULL ON DELETE SET NULL scan child2 @@ -176,7 +176,7 @@ TABLE parent ├── other int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX parent_pkey │ ├── p int not null │ ├── q int not null │ └── r int not null diff --git a/pkg/sql/opt/exec/execbuilder/testdata/check_constraints b/pkg/sql/opt/exec/execbuilder/testdata/check_constraints index b2b810442084..f6d55409517b 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/check_constraints +++ b/pkg/sql/opt/exec/execbuilder/testdata/check_constraints @@ -49,7 +49,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t9@primary + table: t9@t9_pkey spans: /5/0-/5/1/2 locking strength: for update @@ -80,6 +80,6 @@ vectorized: true └── • scan columns: (a, b, c, d, e) estimated row count: 1 (missing stats) - table: t9@primary + table: t9@t9_pkey spans: /5-/5/# locking strength: for update diff --git a/pkg/sql/opt/exec/execbuilder/testdata/ddl b/pkg/sql/opt/exec/execbuilder/testdata/ddl index e922135ba719..7bc4b22de6e7 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/ddl +++ b/pkg/sql/opt/exec/execbuilder/testdata/ddl @@ -23,7 +23,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/f -> /9 +fetched: /t/t_pkey/1/f -> /9 output row: [1 9] statement ok @@ -63,9 +63,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/f -> /9 -fetched: /t/primary/2/f/b/c -> /9/1/1 -fetched: /t/primary/3/f/b/c -> /9/2/1 +fetched: /t/t_pkey/1/f -> /9 +fetched: /t/t_pkey/2/f/b/c -> /9/1/1 +fetched: /t/t_pkey/3/f/b/c -> /9/2/1 output row: [1 9 NULL NULL] output row: [2 9 1 1] output row: [3 9 2 1] @@ -81,9 +81,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/f -> /9 -fetched: /t/primary/2/f -> /9 -fetched: /t/primary/3/f -> /9 +fetched: /t/t_pkey/1/f -> /9 +fetched: /t/t_pkey/2/f -> /9 +fetched: /t/t_pkey/3/f -> /9 output row: [1 9] output row: [2 9] output row: [3 9] @@ -106,7 +106,7 @@ vectorized: true columns: (k1, k2) ordering: +k1 estimated row count: 3 (missing stats) - table: s@primary + table: s@s_pkey spans: LIMITED SCAN limit: 3 @@ -135,8 +135,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1 -> NULL -fetched: /t/primary/1/b -> 1 +fetched: /t/t_pkey/1 -> NULL +fetched: /t/t_pkey/1/b -> 1 output row: [1 1] user root @@ -213,8 +213,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- fetched: /t/b_desc/2/2 -> NULL fetched: /t/b_desc/1/1 -> NULL -fetched: /t/primary/1/b/c -> /1/1 -fetched: /t/primary/2/b/c -> /2/2 +fetched: /t/t_pkey/1/b/c -> /1/1 +fetched: /t/t_pkey/2/b/c -> /2/2 output row: [1 1 1] output row: [2 2 2] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/delete b/pkg/sql/opt/exec/execbuilder/testdata/delete index 3b9e3dec3ecb..7e1e7d5d87df 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/delete +++ b/pkg/sql/opt/exec/execbuilder/testdata/delete @@ -85,7 +85,7 @@ vectorized: true │ └── • scan missing stats - table: unindexed@primary + table: unindexed@unindexed_pkey spans: FULL SCAN # Check DELETE with LIMIT clause (MySQL extension) @@ -107,7 +107,7 @@ vectorized: true │ └── • scan missing stats - table: unindexed@primary + table: unindexed@unindexed_pkey spans: FULL SCAN # Check fast DELETE. @@ -138,7 +138,7 @@ vectorized: true │ └── • scan missing stats - table: unindexed@primary + table: unindexed@unindexed_pkey spans: [/1 - ] limit: 1 @@ -286,7 +286,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # With the hint, we use a constrained scan. @@ -309,7 +309,7 @@ vectorized: true └── • index join │ columns: (x, y, z) │ estimated row count: 990 (missing stats) - │ table: xyz@primary + │ table: xyz@xyz_pkey │ key columns: x │ └── • scan diff --git a/pkg/sql/opt/exec/execbuilder/testdata/dist_union b/pkg/sql/opt/exec/execbuilder/testdata/dist_union index 6576b1cdb7e5..f0ebb315cec1 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/dist_union +++ b/pkg/sql/opt/exec/execbuilder/testdata/dist_union @@ -16,12 +16,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: uniontest@primary +│ table: uniontest@uniontest_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: uniontest@primary + table: uniontest@uniontest_pkey spans: FULL SCAN query T @@ -34,12 +34,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: uniontest@primary +│ table: uniontest@uniontest_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: uniontest@primary + table: uniontest@uniontest_pkey spans: FULL SCAN # Check that EXPLAIN properly releases memory for virtual tables. @@ -82,7 +82,7 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • project @@ -91,7 +91,7 @@ vectorized: true └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Regression test for #32723. diff --git a/pkg/sql/opt/exec/execbuilder/testdata/dist_vectorize b/pkg/sql/opt/exec/execbuilder/testdata/dist_vectorize index 7a7b2ae2bacc..9e6a06842f3f 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/dist_vectorize +++ b/pkg/sql/opt/exec/execbuilder/testdata/dist_vectorize @@ -74,7 +74,7 @@ regions: KV rows read: 5 KV bytes read: 40 B missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzslt9u0zwUwO-_p7DOVffJVf5263I1qIY0wVrUduMCVZOXHJWoiR1sZ2uZ-li8AE-GkizQdFtqhFCR6KXP8YmPf_nZ8gOozwkEMDl_dz6YklDkXHf-PyJvxqNLsrgDClxEOGQpKgg-ggMUXKDgAQUfKPRgRiGTIkSlhCymPJQFF9ESAptCzLNcF-EZhVBIhOABdKwThACm7DbBMbIIpWUDhQg1i5NymcXdWSbjlMkVUJhkjKuAdK1i4VGuAzIUHIHC22ui4xQDYn_7qqpxKLhGrmPBn6SkuFdEIosC4lSR25XGOtQnr4HC5fVgQJTGrAJBOrjUVsz1UUDsssdqAuLipQkpW5IUUyFXhCWJCJnGKCB2-fVbpsNPqIjIdVZso5hfdlUHHJitKVSjR2hKszlC4KypOdhX87nEOdNCWr0m18Hoaji9GY8-TDpHQAGXGOZPYf1Gn-6Lff5sL-dCRigxavQ2W7fvxNlSZHJ1eXMxnHbOnD-zE6-xE8dcZWe3ypbbtbyDzEZoNxQ43qvMrrkCroECXtfyDwoYod1Q4GSvCnjmCngGCvjd8n4-KLAb7YYC_b0q4Jsr4Bso0OseBDACuyHA6V_zpnmmzzGqTHCFW2-b579sF28ejOZYPZCUyGWI76UIy2Wq4aisKwMRKl1lnWpwwatU0eBmsdNa7DaKne1it33lHUt7rdV-e7H_K32XFEugwFHfC7kgCdPIw9WPn17H71msmzpEqFDGLIm_sKeu1GWPpyvE-A4fT1idqo9ZnauOWp1NUSk2b0ywjR1sIum1Ijlu53l84LmN5KQVSb-dZ__AcxvJafttYe-4qNqvuX-D6Gz93_cAAAD__2VFyow= @@ -108,7 +108,7 @@ regions: │ KV rows read: 5 │ KV bytes read: 40 B │ missing stats -│ table: kv@primary +│ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan @@ -120,7 +120,7 @@ regions: KV rows read: 5 KV bytes read: 40 B missing stats - table: kw@primary + table: kw@kw_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsmt9u2zYUxu_3FASv2lWuTMlOEwEFjAUdkG5JhrTozeALRjqzBcmiStJxvCCPtRfYkw2S5rb-I0oyOpAzdReJpHT44-GnL_R5wuJzigP84d2v7y4_oh_Rz3e31yh5QO9vr25QskK3Nyh5eJ2gtyhZvU6wgzMWwQ1dgMDB75hgB3vYwT528Ag7eIynDs45C0EIxosuT-WAq-gRB0MHx1m-lMXtqYNDxgEHT1jGMgUc4I_0PoU7oBFwd4gdHIGkcVq-JnmY5DxeUL7GDv6Q00wEaOAWL_7lE5LxAgI0_PsvUV2HLJOQyZhle02crQTiQKMAkerO_VrC5tY5-gk7-PrT5SUSEnIUsmUm0Qt4lG6cyZcBGpZxVR0AkroOC_qIFrBgfI1omrKQSogCNCyffk9lOAeB2FLmSxmgon8Z1eYGwdNnB1dXFb8Nn_s1mlMx3yYzKfpPHSwknQEOyLNzHPCzHeCrfeAu6ZEfQO7VIv_6HMYj4BDtPudV8eJWvQ6s3jXwGbxncQbcJTv7JYU_5IsJefXyLY9n8-pP7ODbYrYT4kw8Z-I7k2LDwiOEy_2FU_Es2sTnFElY5CiKRYKWgs7gaNxfUfotUC6zQ5gOErphA5a7ZLzNpmbGjWGPa8MebYVN2m860qxyrjdw_X7TqXWuA_I3LXSuR96sc0SPzpET1DmvffZ6LQTDH7ijPnvVgtEB-XkLweiRNwuGp0cwvBMUDL999votBGM0cMd99qoFowPyixaC0SNvFgxfj2D4JygYo_bZO2ohGONBn7tquegAfNwsFwOXIJpFiCAm58B7-GrhGOkRjtEJCkfDAeIdiJxlAnaOYg4_eVgQhGgG1boItuQh_MZZWL6murwtx5X_XUYgZNXqVRdX2aZJSCpVRzn_JblhlS_toz-rjT4DuWI8QSmVkIXrL-Fv7q9oLLcnFoEAHtM0_pPuz3oz7N_dHkL8UE77m6bNtv_SVs5507oAUaDYHfz9kVxoRkIUSM6_CxLSFQmpT3Jr04SMbWRCOmihZ5wWqqM_q43e2gW90IxEixaqkZD6JLc2TXa00BIm3i6T4bdM_O3Pw-5gXzmYbGvR0DglHR3piU84HdRI6o32_2FBdXtiAxfUTk_cwES3J9biF8ZHeuITThM1knqjbYYWqqPX7YkNXFA7PXEDE92eWIsWnnXxxHYgedNb5W5IrDyTViOp999mfDHV0Wu3ygbue-1WWUuWn_dWuRsSK8-k1Ujq_bcZWqiOXrtV1qKFDUx0W2UtWX7RW-W9XxmOLbU44TRpYKLbLJuYJ1aeVjcwUXhwMz6bTfFb6ZfJsfUW9jLR7Zj1CKLZZRwm5onCiBsiiH3NxQEonYouLNn8e7UkRrlmE5nods169o6aiZ2uWc1E-8m1kVDqrbghX84u1Wm2OMQu5Wm2mIkuRW89EyOOr42EUm_FDRHEvVIVC13z9PmHfwIAAP__GzeRXQ== diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distinct b/pkg/sql/opt/exec/execbuilder/testdata/distinct index 6ba82262d9f1..008c0f1b5d26 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distinct +++ b/pkg/sql/opt/exec/execbuilder/testdata/distinct @@ -91,7 +91,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -123,7 +123,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -135,7 +135,7 @@ vectorized: true • scan columns: (x) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -147,7 +147,7 @@ vectorized: true • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # Test the case when the DistinctOn operator is projecting away a column. @@ -227,7 +227,7 @@ vectorized: true columns: (a, b) ordering: +a,+b estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN query T @@ -239,7 +239,7 @@ vectorized: true • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN query T @@ -251,7 +251,7 @@ vectorized: true • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN statement ok diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distinct_on b/pkg/sql/opt/exec/execbuilder/testdata/distinct_on index 90b000c4d852..72026f14630a 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distinct_on +++ b/pkg/sql/opt/exec/execbuilder/testdata/distinct_on @@ -38,7 +38,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -58,7 +58,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -70,7 +70,7 @@ vectorized: true • scan columns: (a, c, b) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Distinct node should be elided since we have a strong key. @@ -83,7 +83,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Distinct node should be elided since we have a strong key. @@ -102,7 +102,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN @@ -122,7 +122,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -142,7 +142,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -159,7 +159,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -179,7 +179,7 @@ vectorized: true columns: (x, pk1) ordering: +pk1 estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -199,7 +199,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -216,7 +216,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN @@ -240,7 +240,7 @@ vectorized: true columns: (pk1, pk2) ordering: +pk1 estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # Ensure the distinctNode advertises an a+ ordering. @@ -273,7 +273,7 @@ vectorized: true columns: (a, b, c) ordering: +a estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN ################# @@ -300,7 +300,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -323,7 +323,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -348,7 +348,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN ##################### @@ -369,7 +369,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -386,7 +386,7 @@ vectorized: true └── • revscan columns: (a) estimated row count: 1 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: LIMITED SCAN limit: 1 @@ -413,7 +413,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -445,7 +445,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN ######################### @@ -474,7 +474,7 @@ vectorized: true └── • scan columns: (y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN ########################### @@ -495,7 +495,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # Distinct node elided because of strong key. @@ -508,7 +508,7 @@ vectorized: true • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN ######################### @@ -530,7 +530,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # Ignores the alias. @@ -548,7 +548,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN ################################## @@ -569,7 +569,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN ################################ @@ -592,7 +592,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -618,7 +618,7 @@ vectorized: true └── • scan columns: (x, y, z, pk1) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # Regression tests for #34112: distinct on constant column. @@ -643,7 +643,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -675,5 +675,5 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_agg b/pkg/sql/opt/exec/execbuilder/testdata/distsql_agg index 1580ca901bbb..022402bb39fc 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_agg +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_agg @@ -57,7 +57,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsV11v4jgUfd9fYfkprIyC88HXk5lCq0iQdALMdrRCkSEWjURjNglVq6r_fZVAgVDGzsh0nnghvsk9vtfn-FyJN5j-t4JdOHi4H_YcF2h9ZzwZfx_WwHgwHNxMwBwB-rzUaA2BOeergMahFuSrjxc82ccLvomzIvWJvmyfUVw80ywM2fN2uXn6eAbRLv2ZJhGNF6wIXngS0OVSC-avGUv32_6dF4yyXQNRtguL8lFWA7e-NwIhzSi4873pPfj2E8whgjEPmUufWAq7_0IMETQggiZE0III2nCG4DrhC5amPMlT3gqAE77AbgPBKF5vsvz1DMEFTxjsvsEsylYMduGEzlfMZzRkid6ACIYso9GqKJN3QdZJ9ESTV4jgeE3jtAvqOgY0DgEGPHtkCUTQ22RdQDAiBiI2Ik1EWnD2jiDfZIe6aUaXDHbxO6reW2-5TNiSZjzR7XJrJD9-z_0ZuN4kcKfDoUaMWt7jdKQRnK9uvKk72a2_ed4w6Ll9jZj70PN3UZEY-N4_Yy0PR72HHWrkuLvV-Lvfd25vP6LpKHD2ez94ftC7u9OIVWztTLaF7I8or2PXTvg4HHH-Ch5p-nhyOgxn7wfOjF9ydthnE_MkZAkLSzsVuwhYxY1PhU9pxXtajdLhzTKxVolYu5Ta3PPa2vPazle3jtsbBuNJvz_4oZFOcYHMMsWNQ96Pnu_03JtBKXNPP8Yl_rFxLAAucn0Whywprioghk5MBIiFALERIE0ESAsB0kaAdPLPCBDcyH_yZGzsUnCOwdYvr7d5WalcXudrHdsnmedrW6XauLrtcRXb67iuGxczvqS7oyvavBr_DGfKxsdX43-h8Y3q5jMqmc-o6-bFzCfp7uiatK7mO8OZsvmMq_m-0HxmdfOZlcxn1nXrYuaTdHd0TdpX853hTNl85tV8X2g-q7r5rErms-q6fTHzSbo7uiadq_nOcKZsPutqvj_0f_OMED5L1zxOWaV_k41cShYu2Vb3lG-SBbtP-KIosw29Ale8CFmabb_ibeDE2095g8dgfArGx2CjBMa_B26qgDsqYKzUN7bFaEPItykGm2KxmmK1LCHaFoNtFanFYInUYrBEajFYJrUELZG6qSJ1Swhui8Vqq4glBkvEEoMlYonBMrEkaIlYHRWxsGSKysao2hxVG6Rqk1RxlKrNUqw0TLFkmloS0T6N098STYyWiSZGy0QTo6WiSeAy0T4NVaFos_e__g8AAP__dlZT8w== @@ -77,7 +77,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslF1r2zAUhu_3K8S5akDGlu2kqa9StgwCadPFGQyGL7To4AUSy5Nk2Aj578P2RZ3QyhrapT9ePe_DEecM-tcRMlh-e1k_rp7J3adVvsu_rCckX66XH3dEN6c7PiGft5snIrjhQKGSAp_5CTVk34EBhRgoJEAhBQpTKCjUSu5Ra6naX85dYCV-QxZROFR1Y9rXBYW9VAjZGczBHBEy2PEfR9wiF6jCCCgINPxw7DAtelGrw4mrP0Ahr3mlMxKEjPBKEEak-YkKKGwak5EFg-JCQTbmlaUNLxEydqHufR7LUmHJjVTh9LpO_vXpbsEm72LidzGvpzeVVAIViquji4u9CIv-rUly1YS5D4C5DCBkQRh7jWCk0cB85jOC2F08dhKPgzDxEh9pNBC_9xFP3MUTJ_EkCFMv8ZFGA_G5j3jqLp46iadBOPUSH2k0EH_4X9vmDcwWdS0rjTdb5-2To3YboSixX11aNmqPL0ruO0z_uOly3QuB2vRfWf-wqvpPbcFhmFnD8VWY3YZjO3kEnVjTqT2c-vSeWsMzO3nmQ763hud28tyH_GCfVTRyTeyX7JZdXD78DQAA__-VJNs- @@ -94,7 +94,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUVUGL4kwQvX-_oqlTMtMh6SQ6Tp-UGT8IqDOrLiwsHnrswhU07XZH2EX870sSBhOZ6WTJXswpVdWvX71XDXUC83MHHMbfXiejZEac52SxXHyZuGQxnoyflsQc907-CeIR5pI7woIgcMk9cZy3SsotU2vOk9lycCmUeVkkXPL__GVKpMgEUEiVxJnYowH-HRhQCIFCBBRioNCDFYWDVms0Run8yKkAJPIX8IDCNj0cszy9orBWGoGfINtmOwQOS_G2wzkKidoPgILETGx3BU1OPTzo7V7o30BhcRCp4cTzGRGpJIyo7AdqoDDHVKLmJBc-ZB7jpSz3Lhf_Htw7zjCs197_i1pUBrUTlQPDuKg8j5-S6WjiwupMQR2ziy6TiQ0CZ2faXvtos9G4EZnSfq8uffF16gzZ5zThpzSX24-p0hI1ytrVq7O9ERb8XSdRrRPWftiszbB95vnhzYy7QX3F5X6XcYftTQ5bmRx6fnQzJjeor5j80MXkqL3JUSuTI8-Pb8bkBvUVkwddTI7bmxy3Mjn2_N7NmNygvmLy47_aDh_QzNEcVGrwakt8fHOQbw-UGyxXjVFHvcZXrdYFTRm-FLgiIdFkZZWVQZKWpbzBKphZwWENzK7BoZ25gTqyomM7OO7Sd88K7tuZ-12YH6zggZ150IX50T6roOGZ2B_ZNffq_N-fAAAA__9ghWKm @@ -109,7 +109,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF2L2kAUhu_7K4ZzFWEkThJ33VwpWwuCH1ujdKHIMs0cUkEz6cwEtoj_vSSBbpR1EgjeORnfPC_PCecE-s8BQpi-vswnsyVxvs6iTfR93iPRdD593hCdHx3eoySWeWrKX0f-7vAe-bZeLYjghgOFVApc8iNqCH8CAwoeUPCBQgAUhrCjkCkZo9ZSFX85lYGZeIdwQGGfZrkpHu8oxFIhhCcwe3NACGHDfx1wjVygcgdAQaDh-0OJKdDjTO2PXP0FClHGUx2SvssITwVhRJrfqIDCKjchGTPYnSnI3HywtOEJQsjOtH2fSZIoTLiRyh1e1om2C2fMekDhebVdbt7Wqx-RUxwXk9fy4hbfu8n_wOapVAIVigvm7mxvyAa3KkbbxdtsuXHG3v-G_u2G_kVD1n5irM3EXNZ3vU4za2hUM_Jwl5l57Y14rYx4fdfvZKShUc3I412M-O2N-K2M-H036GSkoVHNyOguRoL2RoJWRoK-O-xkpKFRzcjT3TfdJ_w16kymGq823udvHhSbEEWC1drUMlcxvigZl5jquCpz5QOB2lS3rDrM0uqqKFgPM2vYuwiz67BnJzegfWs6sIeDLr2H1vCDnfzQhfxoDY_s5FEX8pN9VoOGz8T-kV2zd-cv_wIAAP__TJ4EgA== @@ -126,7 +126,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF1r4kAUhu_3VwznSulInEm0NldK1wXBj65RtrBImToHV9CMOzOBLuJ_X5KUNkqdBNQ7J-Ob5-U54ezB_N1ACP3np2FvMCa174NoFv0c1knUH_YfZ8Qk25ogd-S1TslSJbH9OG3F2_tv8mM6GREprAAKsZI4Fls0EP4GBhQ4UPCBQgAUWrCgsNNqicYonf5lnwUG8g3CJoV1vEts-nhBYak0QrgHu7YbhBBm4nWDUxQStdcEChKtWG8yTIru7vR6K_Q_oBDtRGxC0vAYEbEkjCj7BzVQmGIsUYeky-66HBYHCiqxn0RjxQohZAdavVVvtdK4ElZpr3VcKpqPal1WBwqPk_l49jKd_Ipq6XHUe84uzvH5Wf4nNomVlqhRHjEXB3dD1jxXMZqPXgbjWa3LPxr65xv6Rw1Z9bmxKnPzWMPjV5hcSa-Cl_ZNJsere-GVvPCG51_BS0mvgpf7m3jxq3vxK3nxG15wBS8lvQpeOjfxElT3ElTyEjS81hW8lPQqeHm4-Qb8gj9Fs1OxwZNN-PWbm-mGRLnCfJ0aleglPmm1zDD5cZLlsgcSjc1vWX4YxPlVWrAYZs4wPwqz0zB3k0vQvjMduMPBJb1bznDbTW5fQr53hjtucucS8oN7Vs2Sz8T9kZ2yF4dv_wMAAP__anEPwA== @@ -145,7 +145,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMVdGK2kAUfe9XDPcpWSckk8RdN09Zdi0E1N2qhULxYda5WEEzdiZCi_jvJUnRRNZJqFh8m7knJ-eeMxfuDvTPFUTQ__Y2eEpGxHpJJtPJl4FNJv1B_3lKLEtv15bFiUOYTe4I8zzPJh1SVN8rVftQnUdRMpr2jtgBEmXt8_h1SATPOFBIpcARX6OG6DswoOADhQAohEChCzMKGyXnqLVU-Se7gpCIXxB5FJbpZpvl5RmFuVQI0Q6yZbZCiGDK31c4Ri5QuR5QEJjx5aqQyaXjjVquufoNFCYbnuqIOC4jPBWEEZn9QAUUxpgKVBGxYuawqHRl3-UJ_L1QYsV-HaogQXms4Qc4Dov6S_85GT4NYLanILfZ0Y7O-AIhYnva3vLTYqFwwTOp3G7d8eTr0IqZnZvNT_7hFBxOoX22Cf9sE0ftbSqVQIWiJjzbm9tk3r_0eXyZOOxYcdCxYtaJffu8g6DmgLWfHNZmclzmuP6tz06D6cqj3F9vdvz2yfutkvcdN7j15BtMV5J_uF7yQfvkg1bJB44b3nryDaYryfeul3zYPvmwVfKh43ZvPfkG05XkH__PpvqgiTHqjUw1nmysj__s5ZsMxQLLtaflVs3xTcl5IVNeXwteURCosxJl5SVJSyhvsEpmRrJfI7NTsm9WbpAOjOzQTA4v6btrJN-ble8vUX4wkntm5d4lyo_mt_IaxsQ8ZKfas_2nPwEAAP__pG2Lvg== @@ -160,7 +160,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lF2L2kAUhu_7K4ZzlcBInCS6bq4iWwsBP7ZG6UKRZTZzsIJm7MwEtoj_vSRerMo6SVF7ZT588z48Zzg70L_XEMHg5XnYT8bE-Zqks_T70CXpYDh4mhFdbBzuUrJZ5c5b-cvfncylJJNFbhzhkm_TyYgIbjhQyKXAMd-ghugnMKDgA4UAKIRAoQMLClslM9RaqvIvuyqQiHeI2hRW-bYw5eMFhUwqhGgHZmXWCBHM-Nsap8gFKq8NFAQavlpXNWV1vFWrDVd_gEK65bmOSMtjhOeCMCLNL1RAYVKYiMSMxj6NA1jsKcjCfDRqw5cIEdvT5lT95VLhkhupvM4pVDofOTFzgcIoGTuxX131X5w4KK-eJvPx7HU6-ZE67kUS_yLJB0CRSyVQoThpX-ztrKz9L7DpfPSajGdOHF5mDU5YWfNZsiaz9FjL828wzRquI0PdO0_Tb27Ib2TIb3nBDQzVcB0ZerizoaC5oaCRoaDlhTcwVMN1ZKh3Z0Nhc0NhI0Nhy-vcwFAN15Ghx_-4Mz8hmaLeylzj2e78_MvtcqeiWOJhAWtZqAyflcyqmsPtpMpVDwRqc3jLDjdJfnhVAh6HmTXsn4TZedi3N9dUB9Z0aA-H13B3rOGuvbl7TfODNdyzN_euaX60z6pdc0zsh-y8e7H_8jcAAP__VMIZjw== @@ -179,7 +179,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF2L2kAUhu_7K4ZzleBInEl03Vxl2VoI-LE1CoUiZdY5pIKbsZOxtIj_vSQWNso6CWju8uHr8-Y5wzlA_msLIYy-vYyf4ilxPsfJIvk6dkkyGo-eF0T8Th3HEaRDXl3SIeswjKeLYXEpXfJlPpsQKYwACpmSOBVvmEP4HRhQ4EDBBwoBUOjDisJOqzXmudLFTw5lIJZ_IOxR2GS7vSkeryislUYID2A2ZosQwkK8bnGOQqL2ekBBohGbbYkp0NFOb96E_gsUkp3I8pB0PUZEJgkjyvxEDRTmmEnUIYmCjuNErBNxtxP5_z8FVkcKam_eG-RGpAghO9LmLZ_SVGMqjNJe_7xkspw4EXOBwvNsOV2U19eQ_CrynbTPlJaoUZ5hVkd7Kda71ipZTn7ERS_uVlUxL-JXe_pnPVnzAbImA_RY1-MtjLCmZ8XW4F4j5M3V8EZqeNfzW1BT07Oi5uFeavzmavxGavyuF7SgpqZnRc3wXmqC5mqCRmqCrtdvQU1Nz4qaxzZ24gfIOeY7leV4sRs__udesTNRpnhasLna6zW-aLUuMafbWZkrH0jMzektO93E2elVUbAaZtYwPwuzyzC3k2vQvjUd2MPBLb371vDATh7cQn6whod28vAW8qN9Vr2aY2I_ZJfs1fHTvwAAAP__eg0PVQ== @@ -198,7 +198,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lF-L4jwUxu_fTxHOVYVITVpnnF51GBUKjs7YzsvCIkvGHFxBGzdJl13E7760LozKmBaKe5c_ffo8-Z3D2YP5sYEIRl9eJo_JlHjDJM3S10mHpKPJ6Ckjpth6okOJVkUuPWOlxJ_ee4cS1iHj-eyZSGEFUMiVxKnYooHoKzCgwIFCABRCoNCHBYWdVks0Runyk30lSOQviHoU1vmusOXxgsJSaYRoD3ZtNwgRZOJ9g3MUErXfAwoSrVhvKpvSOt7p9Vbo30Ah3YncRKTrMyJySRhR9jtqoDArbERiRmMOiwMFVdgPO2PFCiFiB9o80uNqpXElrNJ-_zxR-vbsxaxThnmdD5Px2It5tSvPq9XT7G2aVetrUfjVKB8JilxpiRrlmf3i4A7LetfSjpPp4-Rbmg2Ho_-9mNM4oHFYXswxl6gren9bIOaURVGUTLPB9TcEZ29gzSvMmlTYZ12ft61xTagTbHe3rjFvzoc34sO7ftCWT02oEz73t-YTNOcTNOITdP2wLZ-aUCd8BrfmEzbnEzbiE3b9fls-NaFO-Dz8yxn6SZQ5mp3KDV7M0s__3CtnLMoVHgeyUYVe4otWy8rmuJ1VuupAorHHW3bcJPnxqgx4KmZOMT8Ts0sxdzvXWAdOdegWh21y953iO7fzXRvne6d44HYetHF-cNeqV9Mm7ia79F4c_vsTAAD__6KHHKU= @@ -215,7 +215,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lF-L4jwUxu_fTxHOVYVITVpnnF5VZhQKTp2pzsvCIkvGHFxBGzdJl13E7760LozKmBaKe5c_ffo8-Z3D2YP5sYEIRl9eJsMkJd5TMpvPXicdMhtNRo9zYoqtJzqUaFXk0vsp9FrkS_TeO5SwDhln02cihRVAIVcSU7FFA9FXYECBA4UAKIRAoQ8LCjutlmiM0uUn-0qQyF8Q9Sis811hy-MFhaXSCNEe7NpuECKYi_cNZigkar8HFCRasd5UNqV1vNPrrdC_gcJsJ3ITka7PiMglYUTZ76iBwrSwEYkZjTksDhRUYT_sjBUrhIgdaPNIw9VK40pYpf3-eaLZ27MXs04Z5jV7SsZjL-bVrjyvVo_Tt3Rera9F4VejfCQocqUlapRn9ouDOyzrXUs7TtLh5Nv_wywZpo8jL-Y0DmgcllcZ5hJ1xe9vG8ScsiiKknQ-uP6K4OwVrHmNWZMa-6zr87ZVrgl1Au7u1lXmzfnwRnx41w_a8qkJdcLn_tZ8guZ8gkZ8gq4ftuVTE-qEz-DWfMLmfMJGfMKu32_LpybUCZ-HfzlFP4mSodmp3ODFNP38z71yyqJc4XEkG1XoJb5otaxsjttppasOJBp7vGXHTZIfr8qAp2LmFPMzMbsUc7dzjXXgVIducdgmd98pvnM737VxvneKB27nQRvnB3etejVt4m6yS-_F4b8_AQAA__8iOB3j @@ -232,7 +232,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lNFq4kAUhu_3KYZzFXEkThKtzVWkKgSstiZdFhZZps7BFWzGnRmXXcR3L4mFRqmTgORukvj7f_lOOAfQf7YQwvjH03QYz4gzipM0eZ62SDKejh9Soo0Q-NdxHE7a5LVF2mQVhvEsHeRH0SKTxfyRCG44UMikwBl_Qw3hT2BAwQMKPlAIgEIPlhR2Sq5Qa6nynxyKQCz-QdilsMl2e5PfXlJYSYUQHsBszBYhhJS_bnGBXKByu0BBoOGbbVGTV0c7tXnj6j9QSHY80yHpuIzwTBBGpPmNCigsMBOoQhIFbceJWDvyWu3I_3gVWB4pyL35JNCGrxFCdqT1KYfrtcI1N1K5vXPI5HkxiicTJ2KtnPHl8eP0MH-ZpcX5GoB3FeCzd59JJVChOCtdHu2I7ELkJJ4Np7-SdDQaf3ciRiOPRv51MP8MjNWfH6szP5d1XK-BCVZwlvT0m5mgV1-UV0uU13H9BkRVcJZE3TUjyq8vyq8lyu-4QQOiKjhLogbNiArqiwpqiQo6bq8BURWcJVH3zS_PLwAWqHcy03ixRL_-526-XFGs8bSJtdyrFT4puSpqTpfzIlfcEKjN6Sk7XcTZ6VEOWA4za9g7C7PLsGdvrqj2renAHg5u4e5Zw317c_-W5jtreGBvHtzSfG-fVbfiM7F_ZJfdy-O39wAAAP__0akdEw== @@ -249,7 +249,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lNFq4kAUhu_3KYZzFXEkThKtzVXEKgRsbKNdFhZZppmDK9iMOzMuu4jvXhILVamTgORukvj7f_lOOHvQfzYQwvjH03QYJ8R5iOeL-fO0Rebj6Xi0IH-5WvM8Q8dxOGmT1xZpkywM42QxKI6iRSbp7JEIbjhQyKXAhL-hhvAnMKDgAQUfKARAoQdLClslM9RaquIn-zIQi38Qdims8-3OFLeXFDKpEMI9mLXZIISw4K8bTJELVG4XKAg0fL0pa4rqaKvWb1z9BwrzLc91SDouIzwXhBFpfqMCCinmAlVIoqDtOBFrR16rHfkfrwLLAwW5M58E2vAVQsgOtD7lcLVSuOJGKrd3Djl_Th_iycSJWKtgfHn8OI1mL8miPF8D8K4CfPbucqkEKhRnpcuDHZFdiJzEyXD66_swjYfJaOxEjEYejfzraP4ZGqs_QVZngi7ruF4DM6zgPBHUb2aGXn1RXi1RXsf1GxBVwXki6q4ZUX59UX4tUX7HDRoQVcF5ImrQjKigvqiglqig4_YaEFXBeSLqvvn1-QVAinorc40Xa_Trf-4W6xXFCo-7WMudyvBJyaysOV7Oylx5Q6A2x6fseBHnx0cF4GmYWcPeWZhdhj17c0W1b00H9nBwC3fPGu7bm_u3NN9ZwwN78-CW5nv7rLoVn4n9I7vsXh6-vQcAAP__V8ceUQ== @@ -268,7 +268,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUVl9r6k4Qff99imWeEhyJu4n_8rRSFQLWtsaWH1ykbLOLV7CJdxPLvRS_-yXRq7G0m0BB8G0mM2fPmT0Dm3dIf63Bh9H_95NBMCXWMAjn4cPEJuFoMrqZk3T7agkbiXhbWi82Fnl0yGWeZ1Kqt6LlTeiViCN17LMsQRrkxSYNEvl-MJ338lDaZDy7uyVSZAIQ4kSqqXhVKfg_gAICAwQXEDxAaMMCYaOTSKVpovOW9wIQyN_gtxBW8Wab5Z8XCFGiFfjvkK2ytQIf5uJlrWZKSKWdFiBIlYnVuqDJqflGr16F_gMI4UbEqU-aDiUiloSSJPupNCDMVCyV9gn3GpbFaYMzu8HdwyhIOEXCGRLuIuEeLHYIyTY7KUozsVTg0x3WVz1YLrVaiizRTvtcdPh4a3Fm53rzyM2jm7vH6fwQF1-9Y9Qu1Ys4fJgNg_H4cMahws4qp3Oo_eU47MtxTlNs40RLpZU8G2GxMw9MW59MTI-a_s3-HBhnPnZ08mwcTAeT53A-HI6eLN5FTpH3ToWnwSwYTG9GFu8jZ1i-gZZd3oDCamfvNBLedngHCe8i4T0kvP_lbblnt0Xrryyts7IObTrsAktbobvkYecalpbVt4HVsoE1HfcCNlToLtnQvQYb3Po2uLVscJuOdwEbKnSXbOhdgw1efRu8WjZ4Tad9ARsqdJds6F-DDRU_BjOVbpI4VR9e1M9PbuUvrZJLtX-W02SrI3Wvk6ig2ad3Ba74IFWa7at0nwTxvpQLLIOpEczOwPQjmJmZK6hdI9ozg73v6G4bwR0zc-c7zF0juGdm7n2HuW_2qlWxJuYl-8i92P33NwAA___DI7Sb @@ -285,7 +285,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUVl9r6k4Qff99imWeNjgSN4l_mqeVqhCw2hrbX-EiZZtdvIIm3k0svRS_-2WjTbW0MdAH8cndmTmeOXMGsm-Q_lmCD_3H22E3GBHaC8JpeDe0SNgf9q-nJN2sqLCQrBYxfTa_4pVGFpIo2cQZlRYS8TKnlApSI88WqZHI94PRtGOOJptmUqqXfRrJi9ALEUeK7svyKjKYjG-IFJkAhDiRaiRWKgX_FzBAcADBBQQPEJowQ1jrJFJpmmhT8pYDAvkKfgNhEa83mQnPEKJEK_DfIFtkSwU-TMXzUk2UkErbDUCQKhOLZU5jqPlaL1ZC_wWEcC3i1Cd1mxERS8JIkv1WGhAmKpZK-4R7NUo5q3HHqnF3LxhJHkGTfQ-aGJI86MJsi5Bsso8O00zMFfhsi9VVdOdzreYiS7TdPBYR3t9Q7lmAcBOMKG_mp-4j5S1zuh7fj6ZPk_H_ITXXvJgVif05vJv0gsGAcqeocQ5qnKMat6hxD2pc61udzrc6P-Rt4kRLpZU80jbblk-CNb4YBStG4RSjeO_5KTC9eoWC5lE8H9ggGHWHT-G01-s_UN5G3kF-9ZF46E6C7ui6TzlrIGcMOctpihUpfDcLgYQ3bd5CwttIeOfbEblHI2LVF5pVWWib1W3nDCt9QseBka2LXmmnul9OJb-cuu2ewa8TOg78al-0X251v9xKfrl12zuDXyd0HPjVuWi_vOp-eZX88up28wx-ndBx4NfVRft14ikzUek6iVP16VP_9T83zBNAybnavRfSZKMjdauTKKfZXcc5Lg9IlWa7LNtdgniXMg0eglkp2DkCs89gp5z5BLVbivbKwd5P-m6WglvlzK2fMLdLwZ1y5s5PmK_KvWqcWJPyJfvMPdv-9y8AAP__HHblwg== @@ -303,7 +303,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsls9v6jgQx-_7V1hzCpJR4jjhR05GJWgjUWgDbVfaRZUhFosECc9JqvdU8b8_mbQkoRCi1wMXTuDxfOfrmXws-R3iH2twwP3nYdjzRkjre5Pp5HHYQBN36N5NUZxuNN7AKE6CQLzt__K3pcYbaOANp66PtJe_Xd9FHP2XGgYVyG5gtIjSMNHmH7nq943LFQ8XQpsfC-eZcIE6yiXdXMrIznEuSSCzgQb--B4FPOGAIYwCMeIbEYPzLxDAYAIGChgswGDDDMNWRgsRx5FUKe97gRf8BMfAsAq3aaLCMwyLSApw3iFZJWsBDkz5fC18wQMhdQMwBCLhq_XeRlmzrVxtuPwFGCZbHsYOauoE8TBABEXJ_0ICBl-EgZAOYiQ7u-04jjeadjBiZtZy5zgizDxCVBRmOwxRmuQHjRO-FOCQHa7fTG-5lGLJk0jqdrmXydO9xqyGauPR73uDwcfqbvw0mn7uZDmfX4SR4v7X6Ks_fploB6FdKGeXjOxcbObZpdhBV848UYGeqEBPVqBnZ2qenWk-yjSMZCCkCEpznO2qp06ME2MnahoDb9Qbvk6m_b77rDETM4IZLUw9-_fq5eP7XLUOWe1SvJOXfe75Xm9052qsixkxMCPkICLGV3ui_ClmZO-b86tIxIhRnVkYMRsj1tJZGyOmOO0qVo2zQ6WloZL6t47UuXU6aerm9e7dhXYKBLRu967mvTPrI2LWQsRs6vR6iFxop4BI-4ZITURofURoLURoU7euh8iFdgqIdG6I1ETEqo-IVQsRq6nb10PkQjsFRLo3RP7ggXdipr6It1EYi6OH3unKhnoAimApstdiHKVyIR5ktNjbZMvxXrcPBCJOsl2SLbww21IHLIpJpdgsicmx2Kx2vmBNK9VWtdj6zrntSnGr2rn1Hed2pbhT7dz5jnO3-lsZFzCphuzYe7b763cAAAD__1EKnyA= @@ -320,7 +320,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0k1GLm0AQgN_7K5Z5SmCDrppS9imSeq2Q865qr4XWh607WCFx7e56tIT896JS0hzpYUnucWf22_l2htmD-bEFDtHn-00YJ2T2Ns7y7MNmTrJoE61zYrrdTMwpEY_VkIuTdU76wKPQtWhKnIk5uYk3eZSS2af3URoRQb52rusjcefkJr27JVJYARQaJTEROzTAvwADCh5Q8IFCABSWUFBotSrRGKX7K_sBiOVP4C6Fumk724cLCqXSCHwPtrZbBA65-LbFFIVE7bhAQaIV9XYo05detbreCf0LKGStaAwnC4cR0UjCiLLfUQOFFBuJmpMVG91dznmc5G8oWTEoDhRUZ48CxooKgbMD_Yfk0a1rlJaoUZ54FYcz3wirSmMlrNLO8vQX2cfb2cqbA4Xw4d1xDGPoIUzjMFlH_Y0_k3hG2juRZtM7y6Z01mELx7t-b73pmt4kTW_h-NfX9Kdr-pM0_YUTXF8zmK4ZTNIMFs7yZRfqjGaKplWNwSeLdf5lt184lBWO22lUp0u816ocyozHu4EbAhKNHbNsPMTNkBoE_4bZs_DrE9h9CnuXVPYvgYNL4OV_wcXh1e8AAAD__05NBLA= @@ -335,7 +335,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lF9ro0AUxd_3Uwz3ycAEM2r6xydDk4CQJq2m3YUllFnn4gZSJzszll1KvvuiPlRLo4KQp8z1enLO_Lzcd9B_DuDD4sfDahauiTUP4238uBqReLFa3G2Jzl8tPqKEv6XlbyLzzJQnbYTAt_L4xtWeZwlafESW0eaeCG44UMikwDV_RQ3-T2BAwQEKLlDwgMIUdhSOSiaotVTFK--lIBR_wZ9Q2GfH3BSPdxQSqRD8dzB7c0DwYct_HTBCLlDZE6Ag0PD9obQprIOj2r9y9Q8oxEeeaZ-MbUZ4Jggj0vxGBRQ2ufFJwGB3oiBz8-GlDU8RfHai_fPM0lRhyo1U9rQZJ366twI2Agp3m6f1tn5-iTbfY6so48doHi6XZfNcHudsno8YeSaVQIWikWF3ak_MJucix0_3L2ER2mlUblEtw_Vs9RJv5_PFsxV4NGC0eq1qPM-icLa-WzRaEWYCVYGdkoDZgUNJ4FISeJQE07M3dxs3Z_0ng_WZDJuNbWfQbHQkqpG-ushsOP0JOb0IOWPbHUSoI1GN0PVFCLn9Cbm9CLlj2xtEqCNRjdDNRQh5_Ql5vQh5Y3s6iFBHohqh24tv4C_yRKiPMtP4aRN__c-TYkOjSLFa51rmKsEHJZPSpio3pa58IFCbqsuqIsyqVhGwLmatYqchZp_FTrtzh7Xbqvbaxd6Q3NNW8VW789UQ5-tW8U27880Q59v2bzXpGJP2IfvsvTt9-x8AAP__YWk00g== @@ -350,7 +350,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF-L2kAUxd_7KYb7pDASZxJdN09ZthYE_2yNQqFImXUuqaAZOzMpLeJ3L0lo18g6CcS-3TvxeM787nBPYH7sIYTxl5fp02ROOh8n8Sr-PO2SeDwdP6-IyQ4d0aVE_Ew6r136r6-ek0_LxYxIYQVQSJXEuTiggfArMKDAgYIPFAKgMIANhaNWWzRG6fwnp0Iwkb8g7FPYpcfM5scbClulEcIT2J3dI4SwEq97XKKQqL0-UJBoxW5f2OTW0VHvDkL_BgrxUaQmJD2PEZFKwoiy31EDhUVmQxIxGnHYnCmozL7ZGSsShJCdafNIT0miMRFWaW9QTRSvZ52IdfMwecXz6nmxnq-K-pY5v2n-5pmlSkvUKCuGm7M7HuvX54vXs2-TPKGfd0tMJeoCF4m4F_m0LP-2Ny_hVy7Bmg-VNRmqx3oebzvWmlAX3Ib3HytvToQ3IsJ7nt-WSE2oCyIP9yfiNyfiNyLi97ygLZGaUBdERvcnEjQnEjQiEvS8QVsiNaEuiDz-32X4jvkSzVGlBq-W4vv_3M-XJcoEy81qVKa3-KLVtrAp20WhKw4kGlt-ZWUzSctPecBLMXOKeUXMrsXc7Vxj7TvVgVsctMk9cIqHbudhG-cHp3jkdh61cX50z6pf80zcj-zae3P-8CcAAP__edINZw== @@ -365,7 +365,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lF-L2kAUxd_7KYb7tIGROEl03TxFrAuCf7ZGoVCkTJ1LKmjGzkxKi_jdS6KwiayTQLBP8d7keM787nBPoH_tIYTx17fpcDInT58n8Sr-MnVIPJ6ORyvCfydPW4cSnR2KZ16Lay0c8rpczIjghgOFVAqc8wNqCL8BAwoeUPCBQgAUerChcFRyi1pLlX9yKgQT8QfCLoVdesxM3t5Q2EqFEJ7A7MweIYQV_7HHJXKByu0CBYGG7_aFTW4dHdXuwNVfoBAfeapD0nEZ4akgjEjzExVQWGQmJJFPowA2ZwoyM-922vAEIWRn2jzSMEkUJtxI5faqieL17CliDlAYLdbz1fV30fVKXc-5G8S7G-TdP0ulEqhQVMw3Z3tU1r2XNV7Pvk-uua5p_Uo_yKslpgJVSCLmjoZx_vUwfp0uhquBQ0nEKIl8Nwryx93D-ZXDseaDZ00G77KO67UdfU2oEs_-Y0fvNafjNaLjdVy_LZ2aUCU6z4-l4zen4zei43fcoC2dmlAlOoPH0gma0wka0Qk6bq8tnZpQJTov_2-pfhBkifooU403y_Xjf-7mSxdFgpcNrWWmtvim5LawuZSLQlc0BGpzecsuxSS9vMoDlsXMKvYqYnYr9uzONda-VR3YxUGb3D2ruG937rdxfraKB3bnQRvnF_usujXXxH7Jbr0350__AgAA___gMx9O @@ -393,7 +393,7 @@ vectorized: true │ │ │ └── • revscan │ missing stats -│ table: data@primary +│ table: data@data_pkey │ spans: LIMITED SCAN │ limit: 1 │ @@ -406,7 +406,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkE1L80AQx-_PpxjmlMBCkzwX2ZNVW12oaW1LETSHNTvUYLpb9wUKpd9dksWXChU9zm_2P7-d2aN7bZHj6H42GYoSkiuxWC7uJiksRpPR5RI2cpfIlMGm0clTCuP59BaU9BJuhitRXr_zx5Bl_wkKZKiNolJuyCF_wBwrhltranLO2A7t-wdC7ZBnDBu9Db7DFcPaWEK-R9_4lpDjSraB3CBDhoq8bNp-YgEXkORQPwf94lKsDgxN8J9TnJdrQp4d2O9N46b1ZMkO8mNX5BzOi48FOeeiXJ6d9OZ_8c7JbY12dGQ9vVHFkNSa4hWdCbammTV1r4nltM_1QJHzsZvHQujY6j74NZz_GC6-havDv7cAAAD__0das9A= @@ -423,7 +423,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lVuL4jAYhu_3V4TvaoZNqenB0V65zLgguDqrXiwsXmRsGAtO020i7CD-96EWdDxMvkiKlz08-d7mCW83oP6tIIH-n-fhj8GI3D0NprPp7-E9mfaH_ccZqa4Ho8cZueP35Odk_IukXHOgkMtUjPibUJD8BQYUAqAQAoUIKMQwp1CUciGUkmX1ymYHDNL_kLQoZHmx1tXtOYWFLAUkG9CZXglIYMZfVmIieCpKvwUUUqF5ttqNqUb3ijJ74-U7UJgWPFcJ8XxGeJ4SRqReihIojNc6IT0G8y0FudaHWUrzVwEJ21L7PE-Z0lm-0H58HKZXffS4TEUp0gvTDgu8vJMlV8szer49JAq-THRYR9azTtf5Xi_0ZWzWuir3IVNokWmdX0p1MdBIerLwWXzy5uXZ0dFsZn9imM2J8ZnnB05nBkm03_z2zc4Ma_TMsEbOTGDvLbDyFnh-6OQNSbTfgIebeQsa9RY04i209xZaeQs9P3LyhiTab0DnZt7CRr2FjXiL7L1FVt4iz4-dvCGJ9hvQvZm3qFFvUeP_1gvjJkIVMlfC6s_ZqgKL9FXUH6jkulyI51IudmPqy_GO291IhdL1U1ZfDPL6URXwM8xOYfYZDo5gdh3cdoG7LjBzys1iMx0Y9zs0w6FZVttsKzLSsRmOXVSbYUS1GUZUm2FMNUIjqtsuqh-McMcsq-MiywwjsswwIssMY7IQGpHVdZHFkBbFatStR92K1K1JHavUrUuZU5kypE0jRNpZnV4lzUxj0sw0Js1Mo9IQHJN2VqpGafPtt48AAAD__2gsERs= @@ -442,7 +442,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9r4kAUxd_3U4T71LIj8U7ivzxZ2i4Ibe1WFxYWH6ZmsIJN3JkRthS_-6IBjX96b0KCjyaeuXfO-XHIJ9i_C4jg_vfzw83gybu6G4zGo58P197o_uH-duzZ1fv22eDpduypa-_Hy_DRi5VTICBJY_2k3rWF6A8gCJAgIAABIQhowUTA0qRTbW1qNn_53AoG8T-ImgLmyXLlNo8nAqap0RB9gpu7hYYIxup1oV-0irXxmyAg1k7NF9sxm9H9pZm_K_MBAkZLldjIa_joqST20EvdmzYgYLhykddHmKwFpCu3n2WdmmmIcC2K73M3t26eTJ3fOlymv7n00MTa6PjMtP0Brx_em7JvJ-rJer-R_HKj_TlpNuv4nO_ZQV-ujc1Se-93Csq4dDObGT1TLjU-Hhk1-vV41cfrL-eEBe6-Ss7d_uzFc5vIZrlNWgebYHFOsQinPjZ8WYlUZqNd5O2LkYq1koq1kMq4lCe1XYVUWZwPWYgP2fCDSnwwG-2M7lyMD1krH7IWPhiX8nx0qvARFOcjKMRH0PDDSnwwG-2M7l6Mj6BWPoJa-GBcyvPRrcJHWJyPsBAfYcNvVeKD2WhndO9ifIS18hHWwgfjUp6PXl1fQmfmvGi7TBOrj76Izp_c3Bij45nOjLTpykz1s0mn2zHZz-FWt30Qa-uyt5j9GCTZq82CeTEeizEvlgdiLCfuVBEjVlK3Kql7tFqShge04QEpDunJISmWTNYtUt2mxe0qoNBiBhRazIHCqBlQGDUDSoc0vEsb3q0CSo_uhCZTCieVUqoVaDVXC7Sa7QVGzhUDI2cCx5NiOfRdMr7TzcJkjnS1YMgMPymXUqHTai50Ws2Gzsi50Bk5Fzrdq8gUK550TKnQ6Y5BpmTwpGVKhU6rudBpNRs6I-dCZ-Rc6HTDSqZhJf3Rdhz6ZP3tfwAAAP__SIsndg== @@ -457,7 +457,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslFGL2kAUhd_7K4b7VGEkziS6bp5cdi0Irm7VQqHkYTZzSQOaSWcm0CL-95IEtBF3Ekwfc5Mz53w5wz2C-bWHEObf35ZPixX5_LLY7rZflwOynS_nzztiikM1W6yed0QMaHPwPiBfNutXIoUVQCFTElfigAbCH8CAAgcKPlAIgMIYIgq5VjEao3T5ybESLORvCEcU0iwvbDmOKMRKI4RHsKndI4SwE-973KCQqL0RUJBoRbqvbErrWa7Tg9B_gMI2F5kJydBjRGSSMKLsT9RAYV3YkMwYnXGIThRUYS92xooEIWQn2j3SS2psmsXWGzfzuC34hxaXk4tMaYkaZePg6HQjxFOSaEyEVdpjV_9l--310tOMDcp_0xjxwYcp_UZK1r0b1qUbjw093redllDndib3t8O7c_NO3Hzo-X25W0KduR_u5_a7c_uduP2hF_Tlbgl15p7ezx105w46cQdDb9yXuyXUmfvx_2yhGxYbNLnKDF5to9snj8othTLBeqUZVegY37SKK5v6cV3pqoFEY-u3rH5YZPWrMuC_YuYU84aYXYu527nF2neqA7c46JN77BRP3M6TPs4PTvHU7Tzt4_zo7mrUck3cl-zaOzp9-hsAAP__lD7lyw== @@ -477,7 +477,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lt9r4koUx9_vX3E4TxZH4kwSfwQu5N7WcoVe7aqwuyw-RDO0AZu4kxG2FP_3JQZM1TonrmkeJ_qZ-Wa-Hw55w_TnCj0cfHt8-Gc4gsbdcDqbfnm4gengYXA7g2w9HN3OIGCwgPvJ-H8IAx3A1_8GkwE0GgE0YXEDTVh63nA0693A3yC6MJ7cDSbw7_cdhgzjJJSj4EWm6P1AjgwFMrSRoYMMXZwzXKtkKdM0Udlf3nbAMPyFXpthFK83Ons8Z7hMlETvDXWkVxI9nAWLlZzIIJTKaiPDUOogWu2OyXL6axW9BOoVGU7XQZx60LI4BHEIHBL9LBUyHG-0Bz5nvmC-jfMtw2SjixNTHTxJ9PiWlU91H620VFJZ7mGk_LkHjYbPoQm-yG7Ot99fnZcvDnKdDSUuCXUXpTqKl9riRxeVn8FwrEKpZPjxocU-i1d4DtLnj_aYb4ts9tlsxVZJfuLxVk3mi2a-2fmXcP_gJYp0zqekGyWtZG2Jw_s9F8E9iMDLe87LeG7xliUqMJ3ItTe9U6fpRKhCEl6_6bxy0zsVmi7KayZKaSZall2BZkSuvWbdOjUjQhUNifo1E5Vr1q1QM7u8ZnYpzeyW5VSgGZFrr1mvTs2IUEVDdv2a2ZVr1qtQM6e8Zk4pzZyW5VagGZFrr1m_Ts2IUEVDTv2aOZVr1v-kz8MPDp3IdJ3EqSz11dfOYsvwSeavmiYbtZSPKlnujsmX4x23exDKVOe_8nwxjPOfsoDvYW6EhRkWxzB_D9sHML8M7l0Dc3EV3bmGFm0zbRsv3DHDjrktomvXSHfMcMcId81w9xpRzDAhihmmRCFoQhQzTYnSu0aUvnkmtImhQIwUaqacDJVL6iZoom-CpgqncKJxAqcq5yej5ZLOuXm0cIdozTxcuEvgJ9PlotLNNFW6mSZLJ3CqdDNOlm6erFTpJ0PmsLUe0Zp5yvA-gZ_MmYtKN9NU6WaaLJ3AqdLNOFW6ME_Y49Ln279-BwAA___CbXsr @@ -500,7 +500,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9voloUxd_vp9jZTzYeg-cA_iG5Cfe2NmPS0Y6azEwmPqCctCZWnAMm0zR-9wkSpVI9GwrhEXSdvVj89gpvGP5eo4ODH48P_w1H0LgbTmfTbw83MB08DG5nEF8PR7cz8Bgs4H4y_gq-F3nw_ctgMoBGw4MmLG6gCUvHGY5mvRv4F0QXxpO7wQT-_wkLBh4y3AS-HHkvMkTnF3JkKJChiQwtZGjjnOFWBUsZhoGK__J2EAz9P-i0Ga42210U354zXAZKovOG0SpaS3Rw5i3WciI9XyqjjQx9GXmr9WFM7NPdqtWLp16R4XTrbUIHWgYHb-MDhyB6lgoZjneRAy5nrmCuifM9w2AXpRPDyHuS6PA9y-_qfrWOpJLKsM8tJfcdaDRcDk1wRZyca76PzkkuznxdNSWKmLpbhdFqs4wMngkqmcFwrHyppH95aHrO4hWevfD50hnzferNvOotPSpIJmaPajJXNJPDrj-E_YmHSN1ZRZKbBiqSyhDZ3ESTubx5dYb96QROB18wMwpawdYQ549_zULnzALPv0s8zy4ZvGWICraJ8HXapk6d20SYSkHk9W8Tr3ybOhVuE5HccZuyuRXaJpEfZZELZdEyzApQJnydUO7WiTJhKqVA1I-yqBzlboUoE8kdUc7mVghlMz_KZi6UzZZhVYAy4euEcq9OlAlTKQVm_SiblaPcqxBlIrkjytncCqFs5UfZyoWy1TLsClAmfJ1Q7teJMmEqpcCqH2WrcpT7FaJMJHdEOZvbpz_XL8yYyHAbbEKZ6yu8HUcj_SeZxBkGO7WUjypYHsYkl-OD7nDDl2GU_MqTi-Em-Sk2-F7MtWKhF4usmL8Xm2diXkzcLyPmVil1qdmCmG1qA7f0gVtasa2fbOtfdUc_uqNVd_Xirlbc04t7ZSjTi4k3rRdTlBHqUrMpyvr6TmgTpaCvFIIzru8UTpQK_7Bf53KTkH9YsCK4EGrinRFqChhKXm46hQzXlwu3idz19UIxo68XTvQL1xcMJxqGl6oYQk29tXIlQ8nLTSeZ0feMIHpGlOoZQXy7UB8v-p4RRM-IUj1DqKkvkHI9Q8nLTaeYEfqeEUTPiGI9M9__8zcAAP__pXCBQQ== @@ -520,7 +520,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlltv2kAQhd_7K1bzBGKR2V2bi5-cpmmFREzKRWpUocjBK4JEbLo2VaOI_17ZkHBxsmOEkeDNGH-e2TlnjvwK0Z8Z2HDz665z1XZJ6Vu7P-j_7JRJ_6Zzcz0gY0p8SqLFc8kjFTK27bY7aJZJhXh_J6VHUiF-mXzvdW-J78Ue-dHrDu_I1_sUAwpB6EvXe5YR2L-BAQUOFARQMIGCBSMKcxWOZRSFKnnkNQXa_j-waxSmwXwRJ7dHFMahkmC_QjyNZxJsGHiPM9mTni-VUQMKvoy96SwtkzTizNX02VMvQKE_94LIJlWDES_wCSNh_CQVUOjJwJfKJg6rOGJ1LkocXnFMShxBiWPCaEkhXMSbNqLYm0iw2ZLmb_VqMlFy4sWhMqzdTh1BnWQQV-79g9sdPLjDTqfkiHLmlpnc6g9vSw57v-LJ1XV36A7S691WN9UfX8iTFz3tFWbU4TBabk7EPz3R5lWLIFS-VNLfeVn6Fs2ZWe2j2vsnZNlD8_ejivert0E8tJNjW-UdGRP13qQzHOtT9cQh6rlhNZwbbE-5bNGKxi5mscNdtcRre09-XNvaqc3ybxXLs1UGqxr8VHuFNLvlsfqF7BUrcq_Yee8Vot56r-rF7RXP722ey9u8aohTeRtpdkvnxoV4mxfpbX7e3kbUW3u7UZy3RX5vi1zeFlXDPJW3kWa3dG5eiLdFkd4W5-1tRL21t5vFedvM720zl7fNqmGdyttIs1s6ty7E22aR3jbP29uIemtvt07zrf9BwZ6M5mEQyVxf8rVk-NKfyJVSUbhQY3mnwnFaZvWzm3LpDV9G8epftvrRDlZ_JQ1uw2wfZtsw34HZYXDjGJixo2jrKLqlp7l24EI_cKGFTX1lUwtzRGtLS9f1cP0Yo-hhxCh6GDMKQiNGQWjEKA3twJv6gTePMUpLnwk1JBQykXJQKuhpLBb0NJoLCI4FA4IjgrNMsOzOnSNz1ycLojnTRwszkeKZcDlIdD2Nia6nUdERHBMdwTHR9bnKkGBlmYw5SHR9xjAkZFgmZQ4SXU9joutpVHQEx0RHcEx0fcJyJGG5_qNtX_TR8sv_AAAA__-I9wkL @@ -544,7 +544,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUl11r-kgUh-_3UwznSslInEliba7Sbd1FsLHrC2xZpKRmsII17iQuW4rf_U8SrSbBOZEQ0Ltk7JM5c37PHOg3hP-uwIbe3y-Dh75LGk_98WT816BJxr1B73FC5pT4lITbz4ZHNDK37b476TaJRrz_Fo13ohG_Sf4YDZ-J70Ue-XM0nL6Q318TjAxHT73R4Q0orANfuN6nCMH-BxhQ4EDBAAomULBgRmEjg7kIw0DGf_KdAH3_f7DbFJbrzTaKl2cU5oEUYH9DtIxWAmyYeO8rMRKeL6TeBgq-iLzlKtkmLsvZyOWnJ7-AwnjjrUObtHRGvLVPGAmiDyGBwkisfSFt4jDNMdJTUuJwzTEpcQxKHBNmOwrBNjqWEUbeQoDNdrR8qeNARkLqVrZKx9CoY2pnt-CXbPGwWEix8KJA6qyd34c6cbOH0hdS-DY5LDy4r2_ucPLmTgeDhmM0C0tmvDSePjcc9vPE46fH4dSdJM_Z4o_1vH-RDy_8yFXCqMNhtjue0Th7xuOngrTu_Kc06nAt_ZiqGfmmJyWcNmO_kD05KzaD_7TA-Hk6NOitH7fDamacilU6eKQ71tmczVp64AatYKPznAvF6jSF5FamMlb-PrIy91FnLZ3XdSORYvc3slPlRiJbnErIbvVGshpuZL7p134jeXnveSnveUs36vIeKXbv_V0V75EtTqPmt-o9r8H7fNOv3XujvPdGKe-Nlm7W5T1S7N77bhXvkS1OozZu1XujBu_zTb92783y3pulvDdbulWX90ixe-_vq3iPbHEatXmr3ps1eJ9v-rV7j_yHORLhJliHInOqc19ux80R_kKkDQ2DrZyLFxnMk23S12HCJQu-CKP0V5a-9NfpT3GBpzBTwlwN8zzMTmEjA7PL4G4VmPFKdKcKzdtq2lA23FTDpjotJGtLSXfUcEcJ36nhuyqiqGFEFDWMiYLQiChqGhOlW0WUe_VMaCNDARkp2EwpDJVL4kZoJG-ExgLHcCRxBMciZ4XRcknmTD1amImkph4uzELwwnS5KHQ1jYWuptHQERwLXY2joasnKxZ6YchkU-siqamnDLtH8MKcuSh0NY2FrqbR0BEcC12NY6Fz9YTNhz7b_fYrAAD___6ENUA= @@ -565,7 +565,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: [/10 - ] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkl-vk0AQxd_9FJN5grA35U9NdJ-2Kl5JuLQCVW-0udnLTkiTlsVdMJqm390AD7Ya0fs4Z-YcfsPsCe3XA3KMP23SVZKB8yYpyuJ96kIRp_HrEioGioHtj44EDyrOk6x84YIH8lvtPIIHyoW3-foOlOwkfHwX5zFI-NL7fkTwEm7z9XYDr-7HHGTYaEWZPJJF_hkDZPgcdwxboyuyVptBPo1DifqO3Ge4b9q-G-Qdw0obQn7Cbt8dCDlm-ka3ixAZKurk_jCOnRnqvvtlsp2sCXl0ZhfBwXxwKR8PlJNUZBb-VTwOa4rW7I_S_ECGRSsby2ER-DfIMKdGkeEgAk9E069iIEJPLBmIiIFY4t_4gqfwreraUC07bRbBNZ6ImFgiw1V2_5Cty4dsm6aOiNw_pOUgFds7RwRj88OtI0L3aocBfeD2ZrDDK-x_3Csn2-rG0n8dzD_vGJKqaXoTVvemoo3R1fiZqVyPvlFQZLupG01F0kytAfDSHMyaw3lzOGv2fzPvzs9-BgAA__-R_woM @@ -586,7 +586,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMll1vok4Uxu__n2JyrjQdAzOAL1zhv7VdE6tdtZttdk2DMrEmFtwBk20av_sG2BTF7hyMSrzi9eGcOc9vnvAO4a8l2ND5_tBrd_ukctMdjUdfe1Uy6vQ612MSrl8rbpUmx-nf46xKboeDe-K5kUvuhoPHB_L_E_HIl_a3bv8ulZArMq2Sn2tdNwRhOlDwA0_03VcRgv0DGFDgQMEACiZQsGBCYSWDmQjDQMavvCeCrvcbbJ3Cwl-to_j2hMIskALsd4gW0VKADWN3uhRD4XpCanEhT0TuYpmUiTt0VnLx6so3oDBauX5ok5rGiOt7hJEgehESKAyF7wlpE4ddOZwSh1GSHA1KHBMmGwrBOso6CCN3LsBmG1q8y_Z8LsXcjQKpWbtNOvF1u__03B-Mn_uPvV7Fsapxt4_3FYd_nBkfZ-bHGavmmsvqTd_Iixu-5EoxmGyyBfB_LiD7ztoPpCek8Ha-lHxFsUSm7xXOr5EVXKOVX2PWv3GIAbeLZSSkkBrLzT99YBPHyni1bfumc929b_eAwmAd2TEPjkEVNJinHWY_qAUrjeu5Nz-vbe3UZsX3CyuyXzRW0_gZdgzS5xZO9cvcMeyUO4aVv2MQA7IdUy9hx_Di1PJC1PKaZpyBWqTPLUsbl0ktPyW1vHxqEQMyahslUGsUp9YoRK1R08wzUIv0uWVp8zKpNU5JrVE-tYgBGbXNEqg1i1NrFqLWrGnWGahF-tyytHWZ1JqnpNYsn1rEgIzaVsn_1J80MxThKvBDUeiPWY-HLby5SJ0Jg7WciQcZzJIy6eUg0SU3PBFG6VOWXnT99FHc4LaY5cVsW8x3xOwwceMYMWNHqa2j1C21misHbqgHbijFprqyqRRzxGtLqa6rxfVjQFGLEVDUYgwURI2AgqgRUBrKgTfVA28eA0pLnQk6Egp7kXJQKqjVWCyo1WguIHIsGBA5YjjbC5bduXNk7upkQTxn6mhhJlJ8L1wOMl2txkxXq1HTETlmOiLHTFfnKkOCle1lzEGmqzOGISHD9lLmINPVasx0tRo1HZFjpiNyzHR1wnIkYbn6py1v-mTz358AAAD__75d3tU= @@ -607,7 +607,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMl9tr4zgUxt_3rxDnKaEKjiTnZig42227gdTp5rJMGUJRY5EGUjsjO8OUkv99cFJy81THuYHfbNk_6zv6vnNIPiD6MQUHbr89tpstjxT-afX6vf_aRdK7bd_e9In8OS5IckVeipSMyF2380B8GUty3-0MHsnfT2REiU_-bf7f8u7JiFwTHygEoa88-aYicL4DAwocKAigYAOFCgwpzHQ4UlEU6uSVjyXQ8n-BU6YwCWbzOFkeUhiFWoHzAfEknipwoC9fpqqrpK-0VQYKvorlZLrcJlHlzvTkTep3oNCbySBySMliRAY-YSSMX5WG4YJCOI83O0SxHCtw2IJmV3E3mcZKK21VdiWs1h3iCnJN3KTWrgr85Qq7cjklrqDJ-lci-CEimuOxVmMZh9pie0fhJkfd9J6evU7_2Ru02wVXFJMzGTwUXJZc3XQGXv_zevdFXtyTt9nx5Z28yuh1by8Gw8WmBPFlCZvvzINQ-0orf-dLy6-YiqykNt7XztZF8s-r51ZSpkiXaRe33eEW4ox93rK8sBTOLF7ee_PPe1d29mbZG4RlaRCLlSx-RIsgOtYtUr1kiyAittPDctoi7JwtUs1Ni_DsMeWZYspLljgipoiOdUxrl4wpImLbQZ7TmPJzxrSWm5iK7DEVmWIqSpZ9REwRHeuY1i8ZU0TEtoMipzEV54xpPTcxtbPH1M4UU7tkVY6IKaJjHdPGJWOKiNh20M5pTO1zxrSRm5gi_1i6KpqFQaQy_eotJ2Urf6xWZxSFcz1SjzocLbdZ3XaW3HLBV1G8espWN61g9SgRuA0zI8zNMN-H2TYsdmB2GFw_BWb8JLp6Cs3LZloYD9w2w7bZLcTripGumuGqEa6Z4dopQTHDSFDMMBYUhEaCYqaxoNRPCUrDPBPKyFBARgo2U1JD5RC7ERrxG6ExwzEccRzBMctZarQc4jkzjxZmI66ZhwurIHhquhxkupnGTDfTqOkIjpluxlHTzZMVMz01ZHZdqyOumacMayB4as4cZLqZxkw306jpCI6ZbsYx07l5wu6bPlz89TsAAP__M1zTEw== @@ -625,7 +625,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMll9v2jAUxd_3Kaz7BKpRsB1oG6lSuo1uSBS6QLVVG6pcbFEkGjMnkVZVfPcpQSuBdnYqg8qb8-eXe-49R1d5guT3HALo_LjqnXf7qPa5OxwNv_XqaNjpdT6NUJI91Dg6Qnd1XDqji25v1IlQ7fvXTtRBHP3Kmk02QcL81hma1NFFNLhEgqccfYkG11fo4w0SgCFWQvb5g0wg-AkEMFDAwACDDxhaMMaw0Goik0Tp_JWnAuiKPxA0McziRZbmt8cYJkpLCJ4gnaVzCQGM-N1cRpILqb0mYBAy5bN5USZXES707IHrR8AwXPA4CVDDI4jHAhGk0nupAUMkYyF1gEJyFFKMQrJqN_Tz81nIMAp9GC8xqCxdC0lSPpUQkCWuLvZ8OtVyylOlvdam1jCfw3n_5rY_GN32r3u9WujXc9HXl7WQlE7_ph7SV-6xLZnryneP6J4n91tFCYyX61bof1tZfyeLlRZSS7HxpeIrhmZJ80Xh7W7XPdLnE3s-FbMYZGmAQopDhg2GsN120VcNtfBIa-vN12v7G7VJ9eSSKsn1SMOj-8uuRW7JzvahZ5fsMrvkvbJLq-eHVsoPbXhsf_mxyC2N9PjQ80N3mR_6Xvlh1fPDKuWHNTx_f_mxyC2N9OTQ88N2mR_2Xvnxq-fHr5Qfv-G19pcfi9zSSE8PPT_-LvPjH8K_1ysaI5ksVJzISn9WzbxLKaZyNZJEZXoir7SaFGVWl4OCK24ImaSrp2R10Y1Xj3KBZZhsw6QM0w2YvA1uu8CnLjBx0k1aZpoa583MMDOb1Ta75RvplhluuVhthi1Wm2GL1WbYZrWFtljddrH62AifmM06cTHLDFvMMsMWs8ywzSwLbTHr1MUsYtmitjXqtkfdFqnbJnVcpW67lDgtU2LZpr7FtBfr9E2mmWmbaWbaZpqZtppmwW2mvViqRtPGyw9_AwAA__9_QsYt @@ -644,7 +644,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: [/1 - /1] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUklFr2zAQx9_3KY57SqhKLDtPgoKyzd0Mrp05DlvZQlGtwwQSy5Nk2Aj57sM2o8nYvO3t7n_3P_2k0wnd1wMKjD-t01WSwextsik3H9I5bOI0flOC644zBTfwPGcXMdwnaRkXMPv4Pi5iUPClC4KoAj3ddQfVHO6L_AG08gpeZA7viny7htePoJFhYzRl6kgOxWfkyDDEHcPWmoqcM7aXT0NTor-hCBjum7bzvbxjWBlLKE7o9_5AKDAzt6ZdhMhQk1f7w9B2Zmg6_2JyXtWEIjqzi8F8enCpng9UkNJkF8HVeOyvJ1u7Pyr7HRluWtU4AQt-O3AU1GiyAiS_kSEDycfXk8s-vpMRA7nEPyHy_0Fc1bWlWnljF_yaUC6R4Sp7fMry8inbpulMLuc96vZhJvlF9HOJMvyNFiHDvPMCZMhkxCawwyvsv6ysINeaxtE_7Sw47xiSrmn8Fs50tqK1NdVwzJjmg28QNDk_VqMxSZqx1ANemvmkOZw2h5Pm4Bfz7vzqRwAAAP__7JoUPA== @@ -662,7 +662,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslF1v2jAUhu_3K6xzBZJRcBIo9VXZxiokVjrCRacpQh4-SpFonNlGYkL89ynJpgbUOpmSy3y8ed48xzonML_2wGH29LiYzh9I7_M8WkffFn0SzRazT2tyVHojkqRn1eYZjz3R5_zj9_Us6pMvq-VXIoUVQCFVEh_ECxrgP4ABBR8oBEAhBAojiClkWm3RGKXzV05FYC6PwIcUdml2sPntmMJWaQR-AruzewQOa_FzjysUErU3BAoSrdjtC0yOvsv07kXo30AhykRqOBl4jIhUEkaUfUYNFFaYStSc_P2DO_bvFyA-U1AH-0o3ViQInJ1p84bTJNGYCKu0N7os-LRcbab39znxXZT_LuqVcEiVlqhRXnw-PrvLsOH_twku2rDmo2FNRuOxged3PJyajhUf47bD8Zvr8Bvp8Ade0LGOmo4VHTdtdQTNdQSNdAQDL-xYR03Hio5JWx1hcx1hIx3hwBt1rKOmY0XHbZeb7A3UCk2mUoNXG-3tLw_zTYcywXItGnXQW3zUaltgystlkStuSDS2fMrKi3laPsoLVsPMGfYvwuw67LvJNejAmQ7d4bBN75EzPHaTx23IN87wxE2etCHfumc1rDkm7kN2zY7PH_4EAAD__4qIBsU= @@ -678,7 +678,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslF1r2zAUhu_3K8S5akDGlu2kqa8StqwEsqZLclEYpmjRwQuklifJ0BHy34ftizqhlTW0S3-8et6HI84J9O8jZLB4elzNlw_k5styu9t-X43IdrFafN6RV6meeVHc8BH5ull_I4IbDhRKKfCBv6CG7AcwoBADhQQopEBhDDmFSsk9ai1V88upDSzFK2QRhUNZ1aZ5nVPYS4WQncAczBEhgx3_ecQNcoEqjICCQMMPxxbToGeVOrxw9QcobCte6owEISO8FIQRaX6hAgrr2mRkxiA_U5C1eWNpwwuEjJ2pe595USgsuJEqHF_WeVpvnuf39zczNvoQFX-IeiPUpVQCFYqL4_OzvQyL_r1NctGGuQ-CuQwiZEEYe41ioFHPfuI7ithdPnaSj4Mw8ZIfaNSTv_WVT9zlEyf5JAhTL_mBRj35qa986i6fOsmnQTj2kh9o1JO_-58b6B3UBnUlS41Xm-j9k6NmQ6EosFtnWtZqj49K7ltM97huc-0Lgdp0X1n3sCy7T03BfphZw_FFmF2HYzt5AJ1Y06k9nPr0HlvDEzt54kO-tYandvLUh3xnn1U0cE3sl-yanZ8__Q0AAP__cEnj_A== @@ -735,7 +735,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlWFr2kAYx9_vUxzPq4Sdi5fE1h4MktW0C1jtorCVIeXqPWSCzbnLCSvF7z5irJ0yk6BvfNfnrn__P39PiK-Q_54Dh-jHfT-MB8TqxaPx6FvfJqOoH12PidBavDyKNLWETW6S4R2x3m7KUQojyPevURIRy3oinwmzSTjoEWta_P2pbW9GuRnJMOlFCfnyQIQNFDIlcSCeMQf-ExhQcIGCBxR8oNCBCYWFVlPMc6WLf3ldB2L5B3ibwixbLE1xPKEwVRqBv4KZmTkCh7F4mmOCQqJ22kBBohGz-bqmQA4WevYs9AtQGC1ElnPSchgRmSSMKPMLNUxWFNTSvDfkRqQInK1oc4qb2dygRu10dhHKc04sK3ALMZzzeDDublwFXimLc37TH4bj7pvEwN9e9KLr-C7sFw6HS8NJwA4SuweJ30GVlqhR7lIG7CNMVv_5WmGaakyFUdphe3LDJAkfHsPbWytg9kEkbweJNV8la7JKh7Uc94hl1nBsl3lxNst0m5tzG5lzW453hLkajq25y7Mx5zU35zUy57Uc_whzNRxbc92zMec3N-c3Mue3nM4R5mo4tuauzsZczY9FgvlCZTnu8B765HbxXkaZYvkez9VST_Feq-m6phyH69z6QGJuyltWDnFWXhWA_4ZZZdjdCbP9sFvdXFPtVab96rB_CnenMnxR3XxxSvNlZbhb3dw9pfmqelftmsek-iHb756sPvwNAAD__yC-ODo= @@ -753,7 +753,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlVGPmkwUhu-_XzE5V5BvLA6g607SBLrilsaVLZq0TWM2s3JCbVzGDmPSxvjfG8S61VQgeuPdnpl9fR-fQ3AN-Y8FcAg-Pw79cESMfjiejD8OTTIOhsHdhHzPZfYk0tQQJhnE0QMxdheiHBOhBfn0PogDYhjP5C1hJvFHfWLMir_ftM3dmOxGEsX9ICbvvhBhAoVMJjgSL5gD_woMKNhAwQEKLlDowJTCUskZ5rlUxb-st4Ew-Qm8TWGeLVe6OJ5SmEmFwNeg53qBwGEinhcYo0hQWW2gkKAW88W2pkD2lmr-ItQvoDBeiiznpGUxIrKEMCL1N1Qw3VCQK_3akGuRInC2oc0pBvOFRoXK6hwilOecGIZnF2I45-Fo0tu58pxSFud8MIz8Se-PRM_dX_SDu_DBHxYOo5XmxGMnie2TxK-gUiWoMDmk9Nj_MN3842v5aaowFVoqix3J_TCORk_-_b3hMfMkkXNAxJpvkjXZpMValn3GLms49rvsXs0u7ebm7Ebm7JblnGGuhmNv7uZqzDnNzTmNzDktyz3DXA3H3lzvasy5zc25jcy5Latzhrkajr2526sxV_NbEWO-lFmOB7ynPrldvJYxSbF8jedypWb4qORsW1OO0Ta3PUgw1-UtK4cwK68KwL_DrDJsH4TZcdiubq6pdirTbnXYvYS7UxnuVjd3L2m-qQz3qpt7lzTfVu-qXfOYVD9kx93TzX-_AwAA__8sJTeQ @@ -815,7 +815,7 @@ vectorized: true │ └── • scan missing stats - table: sorted_data@primary + table: sorted_data@sorted_data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlkFv2jAUx-_7FNY7gWYU7ATa5gRb2YRESQdUajWhyiUWRaJxZhupVcV3n5IcCO1qJ3I6cSMJP7-__Xt68iuoP1sIYXR7PRmOp6h1OZ4v5r8mbTQfTUbfF4hh9MSeWw9t9GMWXSElpObxfcw0Qz9n0c01-naHGIpml6NZ_hMwJCLmU_bEFYS_gQAGChh8wBAAhh4sMaRSrLhSQmZ_ec2BcfwMYRfDJkl3Onu9xLASkkP4CnqjtxxCWLCHLZ9xFnPpdQFDzDXbbPMypVyDVG6emHwBDPOUJSpEHY8glsSIIKEfuQQM0U6HaEDwgMJyj0Hs9KGq0mzNISR7XD3ZcL2WfM20kF7vONggO4BIxlzyOCsJGIbTu_tptLif3kwmrQFpA4ar4W1rQNtvwhzWf3hBj0w9vlt6uT8Eph8GPqwjiiBv1_laLGTYFek2t61DZL_xyFPREalHjiV8VD44Kk-qNx-p0Xwe6XjUtf0s2Uqi-qfRfqTh9iOf3360un9axz_teL6rf0u20kmdnYZ_2rB_-vn-_er-_Tr-_Y4XuPq3ZCud1Plp-Pcb9u9_vv-guv-gjv-g4_Vc_VuylU7q4jT8Bw37D_7v9eMfaWZcpSJRvNLNopvth8drXuxfiZ1c8WspVnmZ4jHKufxFzJUuvpLiYZwUn7KAZZi8hUkZpkcwqQf3XeALF5g45SY9M02N5-2bYd8sq2-2FRjpnhnuuag2wxbVZtii2gzbVFtoi-q-i-ozI3xulnXuIssMW2SZYYssM2yTZaEtsi5cZBHLFLWNUbc56jZI3Sap4yh1m6XEaZgSyzQNLNLejdNa0sy0TZqZtkkz01ZpFtwm7d1QNUpb7r_8DQAA__8yuHmt @@ -832,7 +832,7 @@ vectorized: true │ └── • scan missing stats - table: sorted_data@primary + table: sorted_data@sorted_data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlltv2jAUx9_3KazzBJpRcC60zRPd1k1INHRApVUTqlxiUSQaM9tIqyq--0TyQLjMJ2Ae8pjLL-cc_386ygfoPwuI4e7XQ_-2l5DGt95oPPrZb5LRXf_u65hMKXmbZ42XJiWcfB8O7omWyoj0OeWGkx_DweMD-fJEOCVToJDJVCT8TWiIfwMDCj5QCIBCCBQimFBYKjkVWku1eeUjB3rpX4jbFObZcmU2tycUplIJiD_AzM1CQAxj_rIQQ8FTobw2UEiF4fNFXqbUT3ep5m9cvQOF0ZJnOiYtjxGepYQRaV6FgsmaglyZbSFt-ExAzNa0ejO3s5kSM26k8qLdXrqbmQcqFUqkMcmvbpOn52Qwfk4e-_1GlzWBwn0vaXT95sHDoLnX37bkyzt55fr1oNpkvZ3B_-8M2-_Iorf973wuPmQZlLUvPCmFwcrEpBvQrk_zSY4nE1SYapUdm-voSIlsyaXHor03j9cOd2qz6oqyExT1WMvzz5AUaaeUXae2krILS8pqIalfXRT_FFH8lhecIQrSTun8rmorin9hUfxaiBJUFyU4RZSg5YVniIK0Uzq_69qKElxYlKAWooTVRQlPESVsedEZoiDtlM7vpraihBcWJayFKMif61Dopcy0qPT3096MLNKZKI5Iy5Waigclp3mZ4nKQc_mNVGhTPGXFRS8rHm0aLMNsH2Zl2N-B2WlwxwW-cYGZU98sstO-9bwDOxzYw-rY0wqtdGSHI5eo7TAStR1GorbDWNQIjUTdcYn6ygpf28O6dgnLDiNh2WEkLDuMhYXQSFg3LmExZItia9Rtj7otUrdN6rhK3XYpc1qmDNmmIRLawTo9KTQ7jYVmp7HQ7DQaGoJjoR0sVWtok_WnfwEAAP__1kitdw== @@ -849,7 +849,7 @@ vectorized: true │ └── • scan missing stats - table: sorted_data@primary + table: sorted_data@sorted_data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMllFrIj0Yhe-_XxHeK-WLjElG286V3a27CHamqxa2LFJSJ1jBTtwkwhbxvy_OXDhqm6hx0ctMfJLz5hwOLkD_nkIE7Z8P3dtOjCp3nf6g_6NbRf12t_11gEYYvU2yyksVI46-9ZJ7pKUyIn1OueHoey95fEBfnhDHaISS3l27l68AQyZTEfM3oSH6BQQwUMDAAEMIGBowxDBTciS0lmr1k0UOdNI_ENUxTLLZ3Kw-DzGMpBIQLcBMzFRABAP-MhU9wVOhgjpgSIXhk2l-TUlaa6Ymb1y9A4b-jGc6QrWAIJ6liCBpXoWC4RKDnJv1RdrwsYCILPH-Ym7HYyXG3EgVNDa1tFYzJyoVSqQRyle38dNznAye48dut9IiVcBw34krLVrd2WTVLX3rK1_e0SvXrzu3DZfrGeinM6zPkYW27XP-Lw6yDErq_3TS9RTs5FPEsiZnAdmyKpmbCLUYblGcv-PHasINNWT_kJIDQhqQWkCPiKlDTsm95sXGlJw4puQsMaX7B4MeEgxaC9gRwXDIKb3X1cUGg544GPQswWD7B4MdEgxWC8IjguGQU3qv64sNBjtxMNhZghHuH4zwkGCEtaBxRDAcckrvdXOxwQhPHIzw7P94PhDYE3omMy02tH12cn01okjHongSLedqJB6UHOXXFMsk5_IPqdCm2CXFopMVWyuBZZhsw6QM0w2YHAY3feAbH5h46SYNO02t783sMLOb1bS7FVrphh1u-Fhthx1W22GH1XbYZbWDdljd9LH6ygpf28269jHLDjvMssMOs-ywyywH7TDrxscs4mhRV4369ahfkfo1qWeV-nUp8SpT4mjT0GHaTp0eZJqddplmp12m2WmnaQ7cZdpOqVpNGy7_-xsAAP__7RShYA== @@ -865,7 +865,7 @@ vectorized: true │ ordered: +b │ └── • index join - │ table: sorted_data@primary + │ table: sorted_data@sorted_data_pkey │ └── • scan missing stats @@ -891,7 +891,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: sorted_data@primary +│ table: sorted_data@sorted_data_pkey │ spans: FULL SCAN │ └── • group @@ -899,7 +899,7 @@ vectorized: true │ ordered: +b │ └── • index join - │ table: sorted_data@primary + │ table: sorted_data@sorted_data_pkey │ └── • scan missing stats @@ -923,7 +923,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMllFv2jAUhd_3K6z7BKpRsBMozVPYSickSrpApVUTqlxiUSQaMztIrar-9ynJNgKsdiqHiTdicq7Pvd_RVV5B_VyBD4PvN6P-cIwal8PJdPJt1ESTwWjwZYrU5qnx3ERXUXiNGr_PGEYPvn81CvvTHjpDc9SfoOfilZilrIm-RuHtDfp8hxgKo8tBlP8EDImI-Zg9cQX-DyCAgQIGFzB4gKEDMwxrKeZcKSGzV15zwTB-Br-NYZmsN2l2PMMwF5KD_wrpMl1x8GHKHlY84izm0mkDhpinbLnKr8kcBWu5fGLyBTBM1ixRPmo5BLEkRhSJ9JFLBRginsRc-ihwzwL6pz2MAgKzNwxik26vVylbcPDJG65usb9YSL5gqZBOZ9dhkE0hlDGXPPZR_tQf392Pw-n9-HY0agS0mRm_vW4EpLlnZlv_4QU9MvW4VzozvzVM3zW8rSMKI_t1zopCmq5I--DuclvkoC3yty2639bWslu75bFoibVD9iCEmzSf_Xs-vB0fpHocSZU4OqTl0DyQpAhkDXk0eCyR655GHknNeSTHzyOtngNaKQe05bg158DgsTSx89PIAa05B_T4OXCr58CtlAO35Xg158DgsTSx3mnkwK05B-7xc-BVz4FXKQdeK_9asGVv8FWa0sVpsPdqZu_932-Tf7iJuFqLRPEdI-9Vbmf98HjBi_6V2Mg5v5Finl9TPIa5Lj-IuUqLf0nxMEyKvzKDZTHZF5OymO6IycfEXRvxhY2YWPkmHb2aauft6sWuHlZXT8vTqjt6cccGtV5sQK0XG1DrxSbUBrUBddcG9blW3NPD6tnA0osNsPRiAyy92ATLoDbAurCBRQxb1LRG7fao3SK126SWq9RulxKrZUoM29QzQDtYpx-CpleboOnVJmh6tRGaQW6CdrBUtdBmb59-BQAA__-gOoQT @@ -945,7 +945,7 @@ vectorized: true │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMll1v2kwQhe_fX7GaK1AWmV2bL1-ZtyEtEsGpIWqjFkUbvCJIBNO1kYii_PfKdsOH3ewY4VTcgeHZObPnzMgvEP5agA297zeDbn9IKpf90Xj0dVAlo96g92lMwvVTZVMlV557TSp_nglKHmz7auB2x21yQaakOyKb9C--iESVfPvS83pEkJ_ret2UZEM-e-7tDfn_jgjiepc9L_kIFJaBL4fiSYZg_wAGFDhQMIGCBRQaMKGwUsFUhmGg4r-8JEDf34BdpzBfrtZR_HhCYRooCfYLRPNoIcGGsXhYSE8KXyqjDhR8GYn5IikTS3RWav4k1DNQGK3EMrRJzWBELH3CSRA9ShUCBU8ufals4pgXDn_rlxKHweSVQrCOduXDSMwk2OyVFpd4NV9EUkllNA71pc9t4vC3-9NU5MdU7M5mSs5EFCiDZS7FiS_eVb5U0o9LA4Xu8O5-6I7vh7eDQcXh1fiubq8rDqtm1OwKPDyTRxE-Zo6O1e8Um-8q3p0TpEKy51ykB-naauRq77fFcm2xbVs829ZOslW65GFQC1YGz5jgrqPk7t_T0TjQwYpPACsyAQarGTyZAZbOQAkjgGjcjkCztBFAKu5nhZ3HCLCSR6D58SPAi0ePF4oerxlmydFDNG6j1yotekjFfY_4eUSPlxy91sdHzywePbNQ9MyaYZUcPUTjNnrt0qKHVNz3yDyP6JklR6_98dGzikfPKhQ9q5a8-50aN0TXNm6d0uKGVNz3xTqPuFklx63zb98z_6LGk-EqWIbyQMh7J9fjfqQ_k2n_YbBWU3mjgmlSJv3qJlzywJdhlP7K0i_9ZfpTLHAfZlqY62Gehdk-bB7A7Di4fQrM-El08xSa1_W0qb1wSw9bercQrxtauqmHm1q4pYdbpwRFDyNB0cNYUBAaCYqexoLSPiUoHf1OqCNLAVkp2E7JLZVj7EZoxG-ExgzHcMRxBMcsZ7nVcoznTL9amIW4pl8urIHgue1ylOl6GjNdT6OmIzhmuh5HTddvVsz03JI5dK2NuKbfMqyD4Lk9c5TpehozXU-jpiM4Zroex0zn-g2bNX3y-t_vAAAA___7U6lw @@ -1021,7 +1021,7 @@ vectorized: true columns: (a, b) ordering: +b estimated row count: 10 (missing stats) - table: data2@primary + table: data2@data2_pkey spans: /1-/2 query T @@ -1036,7 +1036,7 @@ vectorized: true │ └── • scan missing stats - table: data2@primary + table: data2@data2_pkey spans: [/1 - /1] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlNGLm0AQxt_7VyzzZNo9dDeXFISC6dW2gqepGq5HkbDRxQvkXLu7Qo8j_3tRD2LSnJe0pfRxnfnNfN984COo7xuwwf0692degIwPXpzEX_wRil3fvUrQCqNM1KU2Xo_Qxyi8RjnTjKKbz27kIobeIYI-ReFijt7fohVgKEXOA3bPFdjfgAAGChgmkGKopMi4UkI2pce20ct_gG1hWJdVrbvPeq03HGyoSyFzLnkOGHKu2XrT1NNtiiETkoO9aw3EhajM6UEjBlHrp7EpBqVZwcG-3OLeatJbfWRwwlYbHnGWc2lae-OhvYJTyfU9kw-AIa5YqWxkkguTmI3tsNY2cig8J4ScI2RWFJIXTAtp0n0dTruru5SN2tcsuF0GYbIMFr5vOGQEGK7CRZAso_AmNkYHinZLVg_ojqm7X-a3N39STZ9VvZtzLDdwyBs4Gl7P2uXvWIsX10svSAyHHjrbqR7vqaanh05ODL2JnZ4d-gtCepcZ_0eh078b-uTfhG4N3zriqhKl4if9Q6zGEs8L3p1AiVpmfC5F1q7pnmHLtR9yrnRXfds9vLIrNQL7MBmE6TBMD2HSh8d7MDkPng7D40HZ1jB8OQhPhj1P_sTzMPyC5-lZntPtq58BAAD__0K5XNc= @@ -1057,13 +1057,13 @@ vectorized: true │ ordered: +u │ └── • lookup join - │ table: uv@primary + │ table: uv@uv_pkey │ equality: (a) = (u) │ equality cols are key │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlttv2jAYxd_3V1jfE2hGwU64RZpEt7KJjiaMi7RqQlVKLMpGY5ZLtarq_z4lmUoIw18iKOKtIf3Zxz7nO8ozBL9XYELv-3Bw0bdI5bI_noy_Dapk3Bv0Pk1IED1UHqvk88i-Jq4TOqRvWb0RGdj21-mQXNl9i0SPxLZIxSEfSFQlX0b2dEg-3pCI2KPL3ij5Eyh40hWW8yACMH8AAwocKOhAwQAKDZhRWPtyLoJA-vG_PCdA3_0DZp3C0ltHYfzzjMJc-gLMZwiX4UqACRPnbiVGwnGFr9WBgitCZ7lKtokFd9f-8sHxn4DCeO14gUlqGiOO5xJOZHgv_AAo2FFoki6D2QsFGYWbzYLQWQgw2QstLuhKLr1_ehrbeqLHjJqBlL-iNfkplx6RXrL9qxDa5bSr75XDy8i5WCx8sXBC6Wssdz_d2APbd4UvXJMkTxfWza1lT26t6WBQ6fJqfG3T60pXr-bUbDa4eyL3TnCfWzq-zI1ifa_izToyFZJf5326kOpYjZ29s8diO8dir8fi-WNtJBtHl2zJmlxrPGdCajnfq6OxpYMVHwZWZBg0VtN4Mg4sHYfS04AoykxD8xTTgMjJxoadxzSwI09D8-2ngRdPIS-UQl7T9INSiCjKpLB1ihQicrJ28fNIIT9yCltvn0K9eAr1QinUa5pxUAoRRZkUtk-RQkRO1i79PFKoHzmF7bdPoVE8hUahFBq15LuxXPIQFZnkdU6RPERO1iLjPJJnHDl5ndN-k_5HzUgEa-kFYkvIvpXr8XmEuxDp-QMZ-XMx9OU82SZ9tBMu-cEVQZi-ZelD30tfxQKzMFPCXA3zPMyysL4Fs3Jw-xCY8YPo5iE0r6tpXXnhhho21G4hXjeUdFMNN5VwSw23DgmKGkaCooaxoCA0EhQ1jQWlfUhQOupOqCOlgFQK1ik7pVLGboRG_EZozHAMRxxHcMxytlMtZTxn6mphBuKaulxYA8F32qWU6WoaM11No6YjOGa6GkdNVzcrZvpOyWy71kZcU7cM6yD4Ts-UMl1NY6aradR0BMdMV-OY6VzdsHnTZy_v_gYAAP__ETW8Dg== diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_distinct_on b/pkg/sql/opt/exec/execbuilder/testdata/distsql_distinct_on index a58e37fd93b1..0e2f1203ffe9 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_distinct_on +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_distinct_on @@ -78,7 +78,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -92,7 +92,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lU1v4jAQhu_7K6w5tZKj4MThIydWLSshsdAFDiutOKTEaiPROBsHiQ_x31cJKyi0eFwcccMkj-e1n9FkC-rvAkLo_X4afO8Pyd1jfzKd_Brck0lv0HuYknLdHz5MyWhI7laUrCnZ3JP_P8iP8egnWa03QCGVsRhGb0JB-AcYUPCAgg8UOFAIYEYhy-VcKCXz8pVtBfTjFYQNCkmaLYvy7xmFucwFhFsokmIhIIRp9LwQYxHFIncbQCEWRZQsqjKr9aab5clblK-BwiSLUhUSxy0rj5ZFSLoe7fq0y2G2oyCXxbGIKqIXASHbUfMgj4kqknReuMFpii6jVaGzKkfweU1eI_V6kTrm8S7mOe62TGUei1zEJ_tVu1xMzBpGkY9B_HqDDKUjM5cFZ29-Xpuf1Gbm3cEMusP1HJdf2R9IlMNtN2_UH6y-_mBW_eGZO_JMHHGnusNrHCFRDidu3ciRV58jz8qRb-7IN3HUdKo7vMYREuVw4vaNHPn1OfKtHHFzR9zEUcu50hAS5HDezo0M8foM8dq-hJ-UGQuVyVQJo-9cowwq4hexP5WSy3wunnI5r8rsl6OKq_6IhSr2T9l-0U_3j8qA72F2DrP3sHcCs6_BTRu4YwMzq9ws0NOe9r59PezrZTX1triWDvRwYKNaDyOq9TCiWg9jqhEaUd20Ud3Swm29rLaNLD2MyNLDiCw9jMlCaERWx0YWQ6YoNkbt5qjdILWbpJaj1G6WMqthypBpyhFpH8bpl6TpaUyansak6WlUGoJj0j4MVa202e7bvwAAAP__i4nxhg== @@ -118,7 +118,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -135,7 +135,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lkFv2kAQhe_9Fas5Jeois2sDiU-0CZWQUkiBQ6uKg4NXCRLx0l0jQSL-e4UJEDDMLBhxwzZvZ_zepye_g_03ghAavx8fvjVb7Oq-2e11fz1cs27joXHXY4vrZuuux9otdjXlbMbZ2zX7-MF-dNo_2XT2xtqd-0aHff_DpsAh0bFqRa_KQvgXBHCQwMEHDgFwqECfw9jogbJWm8Vf3jNBM55CWOYwTMaTdHG7z2GgjYLwHdJhOlIQQi96GqmOimJlvDJwiFUaDUfZmOnsrT42w9fIzIBDdxwlNmQlbzG5PUlDVpe87vN6AP05Bz1JN0NsGj0rCMWcuy9yP7TpMBmkXmV7i7rg2aCdKRvh04y9RPbloGqzjzy4z-a0SaJNrIyKt87LTjm4sSg7rbxZxD_GmK42qTKeyPny9eD5gcOL7nvNj0P3LNHSJT32ZHnHlf3jK1vjhTuAwgFAT5a84EQEiVXWgVYvhKA4H4KiEIKEMSsEc764IijdGZAuDASlLKNTGCBWWTtauxAD8nwMyEIMEMasGMj54sqA786A78JAtZRldAoDxCprR28uxIB_Pgb8QgwQxqwYyPniykDgzkDgwkCtdCIBxCJrP28vREBwPgKCQgQQxqwIyPlyysfInvM7yo51YpXTd0Z5YYSKn9XSNasnZqAejR5kY5aX7UyX3YiVTZdPxfKimSwfLRb8LBa7YvFZLLfE4jhxrYhYiELqSiH1La6WqOE-briPigN8coCKJZF1BVVXcXG1CCi4mAAFF1OgEGoCFEJNgFJDDb_BDb8pAsot3gllohRylXJUK-BqqhZwNdkLhJwqBkJOBC5yxbLtuyR8x5uFyFzg1SICYniuXI4KHVdToeNqMnRCToVOyKnQ8V4VRLGKXMccFTreMYIoGZFrmaNCx9VU6LiaDJ2QU6ETcip0vGEl0bAS_2jbDb0___I_AAD__8DB-Cg= @@ -164,7 +164,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -182,7 +182,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9r4kwUxu_fTzGcq5aOxJnEP82V77YuCF3tqhe7LF6kZmgF67gzEUzF774kCqmmnpMY8TK1P5-T8_w4uAH7dw4-dH89P_3f67Obx95oPPr5dMtG3afuw5glz73-w5gN-uwmvmVrzmL2fTj4wdbxBxsMH7tD9u03izlbA4eFDlU_eFcW_D8ggIMEDi5w8IBDAyYclkZPlbXaJP-ySYFeuAa_zmG2WK6i5M8TDlNtFPgbiGbRXIEP4-BlroYqCJVx6sAhVFEwm6cx6_ijszSz98DEwGG0DBbWZzUnSR6sIp91JO-4MNly0KsoS7BR8KrAF1tefIqRNpEyTuNwgI684x1xdzJClol4nNlotphGjqgfpyQvZEJlVJi81FFc9g0vMXsL7FuOnmyzkdyTI2Xfo3dZp94VnT23IXT2bC6vwlxfz9TXNb105OEyT8U3DuJFcSVFASUdWXO8c6Qk5thL2awiJRGRFSuuJqW4uJS5DZ0lpSxuhSxihVdLqyttBTHH3opWFSuIiGyz8mpWyItbkdvQWVa4xa1wi1jRrKXVlbaCmGNvRbuKFUREtln3ala4F7cit6GzrPCKW-EVsaJVO8cJYoq9E_dVnCAisr16V3PCu7gTuQ1V_lHzRdxQ2aVeWFXo90o9GViFr2r3klavzFQ9Gz1NY3aPg5RL_xAqG-0-FbuH3mL3UTLgZ1igsMRheQyLz7B7AItycLsKLGQlulmFlnWcdtGFezjs4W0RXTdQuonDTRRu4XCriig4TIiCw5QoBE2IgtOUKO0qotzjN6FOHAXipFA3JXdUytRN0ETfBE0VTuFE4wROVS5yp6VM5wI_LcIjWsOPi2gQeO66lCodp6nScZosncCp0nGcLB2_rFTpuSNz2FqbaA2_MuKewHN3plTpOE2VjtNk6QROlY7jVOkSv7DHpU-2__0LAAD__xPOEOI= @@ -197,7 +197,7 @@ vectorized: true • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -208,7 +208,7 @@ vectorized: true · • scan missing stats - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykk0-L2zAQxe_9FOKddkHG8Z_04FPLNgWD62yTFAqND4o1bAOJ5UoKtIR892K5NI6bFqW5DH7SPL8fw-gI822HDLPPz8XbvGQP7_LlavmxeGTLWTF7WrFO5-XTis1L9iA423BWP7JfH-z9Yv6BiU0NjkZJKsWeDLIviMARgyMBRwqOKSqOVquajFG6azk6Qy6_I5twbJv2YLvjiqNWmpAdYbd2R8iwEpsdLUhI0mH3X0lWbHcuRmzqN63e7oX-AY5lKxqTsbD8VBTnEoRrRGv8rvEaqE4c6mDPmcaKF0IWnfhfuM44h0ZpSZrkBUp1ukJeqkC14XTUeD06voiO_EcS-4zkjxEEQ3HTVGJ_tOQWtHiI1ovE1dQbLfFHS_3QRhzBUIRrTL3RUn-0iQdaMFpyJhrJIqbsV9L_sd1XiBZkWtUY8lreSbf9JF-ofypGHXRNz1rVLqaXc-dzB5KM7W-jXuSNu3KAQ3P0T_PrC_NkbI7vSU7uMaf3mKc3mavTq58BAAD__1Um0jI= @@ -234,7 +234,7 @@ vectorized: true columns: (a, b, c) ordering: +a,+b,+c estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -249,7 +249,7 @@ vectorized: true │ └── • scan missing stats - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ld9v2jAQx9_3V1j31KpG4PygbZ7YWiYhsaQDJm0aPJjEaiPROIuDtKrif5-SSITQ1hdm4MXSGb533_PndHkF9WcFHgx_Pow_j3xycT-azqbfx5dkOhwP72akiEf-3YwEPrnglCwvSXGSr5PgG-HLkAST--GEfPlVXlMSAoVERsLnz0KB9xsYULCAgg0UHKDgwoJCmslQKCWz4i-vpWAU_QWvRyFO0nVeXC8ohDIT4L1CHucrAR7M-HIlJoJHIusWeSOR83hVluHLcJBm8TPPXoDCNOWJ8kjX_zEe10enOwc2h-1pzQEWGwpyndc1Vc4fBXhsQ9v7uo9VHidh3u03TQ0YHRS9B1kkMhF5pLpo1qzTLF_IE1dP7-VYbGpr1ofW6lSyqrif6ooOrCs6sK-qhB_2wdh_NFI7tA0dvu_Olx2ZdpnblATrHLPjNOyw9jNmtZmxNzPV2Q0OGjPE2hbP9fnHjJ1kzKwjjpnVnqt9CFdrl2sV2OXptOaKWNu-x835uVon4WofkavdnqvTjusexM5u0J2D25orYm37Hrfn52qfhKtzRK5Oe669Flw7ex97wpOIMCLzJ5G1xIk42j6De36czklw9k70lX-n6ESoVCZKNCp-lLlX2BbRo6jaVXKdheIhk2FZpgqDUldeRELl1a-sCkZJ9VNhcFfM9sWsIXYbanaY2jIR903EtyZihvi2tO9t68W2HlZfT8vRql292DVCrVcjT6YXI6j1YgQ10jTiu2-C-lorvtHDujGCpVcjTevFCCy9GIGFNI34vjWBxZAtiq1Rwz1qtkjNNqnZKjXbpcxomTJkmzoItDfr9DBoejnWuV6NQdOrMWhI45j1N0tVC22x-fQvAAD__5UTNgY= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_indexjoin b/pkg/sql/opt/exec/execbuilder/testdata/distsql_indexjoin index 0813b0d6da84..fa411e6fbd5a 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_indexjoin +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_indexjoin @@ -33,7 +33,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUUE9L-0AQvf8-xTCn9sdKNxVB9tRiUwzUtCYBBc1hTYYSSLNxdyNKyHeXZK21QkWP8968P7wWzXOJAv37zWoehDBaBHES367GEPsr_yqB_7CM1jdg4e7aj3wYvcBjw_k5gcfHMA8Xn0gGF3yMDCuVUyh3ZFA8oIcpw1qrjIxRuofa4SHIX1FwhkVVN7aHU4aZ0oSiRVvYklBgIp9KikjmpCccGeZkZVEOtnZW62In9RsyjGtZGQFnmHYMVWMPhsbKLaHwOvb70GVRWtKkJ95xosMFjGbTwwBCiCBMLj922DP9EHvmZKnpX0pFZGpVGTqqdMqZdylDyrfk1jaq0RlttMqGGHeuB90A5GSsYz13BJWj-oJfxd6P4uk3cdr9ew8AAP__FVC8zg== @@ -52,7 +52,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkUFLw0AQhe_-imFOra40SRFkT602xUBNaxJQ0RzWZCiBNBt3N0Up-e-SxFortNjjvLfvm8fsBvV7jhzdp8Vs7PnQm3hhFD7M-hC6M_c2gnOYBvN7MPB45wYu9NbwWlnWkMC2-jD2Jz9KAldWH-bBxA3g5hnWyLCQKfliRRr5C9oYMyyVTEhrqRpp0z7w0g_kFsOsKCvTyDHDRCpCvkGTmZyQYyTecgpIpKQGFjJMyYgsb7FmVKpsJdQnMgxLUWgOlxjXDGVldkBtxJKQ2zX7_9JplhtSpAb2_sZO59AbObtbcM49P7r-PsnWaW6ydQ6Wck4pFUplSA2c_Uoj5-IgfngKPiBdykLTHv4Q2apjhpQuqftMLSuV0ELJpF3TjfM21wopadO5djd4RWc1BX-H7aNh53jYORoe_gnH9dlXAAAA__8M7_K8 @@ -72,7 +72,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUUV1ro0AUfd9fcblPCTtLHGVhmSezG8MKWc2qsFtaH6xegmAcOzOmLcH_XtSmaQoJzeM9Z84HZ_aoHyoU6P1fr-Z-AJOFHyfx39UUYm_l_UrgEZZR-AcM_PvtRR5MdnDXWpZDwK0pzIPFG5LDd2sKYbTwIvh5AztkWMuCgmxLGsUtckwZNkrmpLVUPbQfHvjFEwqLYVk3renhlGEuFaHYoylNRSgwye4riigrSM0sZFiQycpqsDVuo8ptpp6RYdxktRbwDRmGrRHg2sx1MO0YytYc3bXJNoSCd-zzDZZlZUiRmvHT-BEXMHH5cRghhB8kP173OTD9QAfmbCn7mlKxVIbUzD6t5PKvxwHOBjnXBEWkG1lrOgk652x1KUMqNjT-sZatymmtZD7EjGc46AagIG1Glo-HX49UX_C9mF8U25fF9kWx80Gcdl9eAgAA__92zfiN @@ -85,7 +85,7 @@ distribution: full vectorized: true · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_inverted_index b/pkg/sql/opt/exec/execbuilder/testdata/distsql_inverted_index index 9225d84babcc..3c9e19bd7005 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_inverted_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_inverted_index @@ -79,7 +79,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '[1, 2]' @@ -107,7 +107,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> '[1]') AND (b @> '[2]') @@ -135,7 +135,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '[[1, 2]]' @@ -196,7 +196,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> ARRAY[1,2] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_join b/pkg/sql/opt/exec/execbuilder/testdata/distsql_join index 011c8589a3fc..d10eb7747702 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_join +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_join @@ -49,14 +49,14 @@ vectorized: true │ columns: (a, b) │ ordering: +a,+b │ estimated row count: 1,000 (missing stats) - │ table: data@primary + │ table: data@data_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b) ordering: +a,+b estimated row count: 1,000 (missing stats) - table: data@primary + table: data@data_pkey spans: FULL SCAN # TODO(radu): enable these tests when joins pass through orderings on equality @@ -140,13 +140,13 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: data@primary + │ table: data@data_pkey │ spans: FULL SCAN │ └── • scan columns: (c, d) estimated row count: 1,000 (missing stats) - table: data@primary + table: data@data_pkey spans: FULL SCAN query T @@ -163,12 +163,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: data@primary + │ table: data@data_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lt9u4jgUh-_3KaxzBVujYCf8i1SJ7pbVUnWgA72Y0YgLQzwFiSaME6Spqr77KKFMG0J94jHkqkrwF__i852ePEP8Yw0-DL7c3V4NR6R2PZzeTz_f1kltOrgd_HtP_ib_Tcaffl8KSua7O4FIBLmaZn9ZndyMU_x11YKSoLiKk_HkejAh_3zNFtTJeERqglySRZ1cja5JbU4us9v7VXNKRB0ohFEgR-JRxuB_AwYUOFBwgYIHFFowo7BR0ULGcaTSJc8ZMAx-gt-ksAo32yS9PaOwiJQE_xmSVbKW4MO9mK_lRIpAKqcJFAKZiNU62yYN3N-o1aNQT0BhuhFh7JOGw4gIA8JIlCylAgrjbeKTPqN9DrMXCtE2ed3ubZf5E1mKeJl__h6ZUYgT8SDBZy_0z5K3bJK7tO_ZJucfJn971DaMVCCVDHIPm6UktuTI6_8v4uVNtAqlcthB4dbye1LLMtYv1ephub_I1Yoee--3F3JNSjGNVJLmOChDn1_QPrv4cA-vxKEdO493Dz4SZhQ1oo3Dm4enfDRCKxeBlTeOlTHOYQ2HV9QtBtnbdtlP3y-s4n5h5-4XpBj7fmnb9AsvX3BequC84bgVyWqQvWOX_fSy8opl5eeWFSnGXtaOjaxu-YK7pQruNhyvIlkNsnftsp9eVrdiWd1zy4oUYy9r10ZWr3zBvVIF9xpOqyJZDbL37LKfXlavYlm9c8uKFGMva-9Un81H9pjIeBOFsSz1NdxMT0wGD3JXgTjaqoW8U9Ei22Z3Oc647BMnkHGy-5XvLobh7qc0YHm4YwMzZkW3rOienmYGZ8bN4I4NfHBmpnTLiu7paX5IN9_Tbg5uHsKuFvb01fK0MGf6rVs2_aGHkf7Qw1h_IDTSHwiN9Efbpj_0MNIfehjrD4RG-gOhkf7oaC3t6iXt2vRHz8ZwPYwYrocxwxEaMRyhsQlgMjaL_0lN5qYpjQ4Bo8lpjCOas8IUyanKuF50ph8jiOmsMEdMVEdoxHWExmTHcMR2DMd0L8xQI931NKa7nkZ1R3BMdwTHdC8M0rzubUT3wkwx0r0wU4x019OY7noa1R3BMd0RHNO9ME-NdNfTmO56GtUdwTHdERzTvTBV89_aTb3uvDBbtLrPXv76FQAA__9PLrbs diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_merge_join b/pkg/sql/opt/exec/execbuilder/testdata/distsql_merge_join index 582d6fdcaa7c..4bf05217d8c3 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_merge_join +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_merge_join @@ -145,12 +145,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: child1@primary + table: child1@child1_pkey spans: FULL SCAN # Select over two ranges for parent/child with split at children key. @@ -175,7 +175,7 @@ vectorized: true │ columns: (pid1, pa1) │ ordering: +pid1 │ estimated row count: 3 (missing stats) - │ table: parent1@primary + │ table: parent1@parent1_pkey │ spans: /3-/5/# │ parallel │ @@ -183,7 +183,7 @@ vectorized: true columns: (pid1, cid1, ca1) ordering: +pid1 estimated row count: 30 (missing stats) - table: child1@primary + table: child1@child1_pkey spans: /3-/6 query T @@ -198,12 +198,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: [/3 - /5] │ └── • scan missing stats - table: child1@primary + table: child1@child1_pkey spans: [/3 - /5] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckdGL00AQxt_9K4bxpdGVZBPrQ6CQw4uao5eeTUVB87Bmx95CbjfubkAp_d-liXCXo1V6b5lv5zfffJMdup8tpph_uVleFCXMLotqU31cBlDly_ztBl7Au_XqGjphSXsOV6uihOZWtZLDp6oo38OsU5IH8PlDvs7HAr71UZTQApIALsrLh2KzgHmADLWRVIo7cph-RY41w86ahpwz9iDthoZC_sI0Yqh01_uDXDNsjCVMd-iVbwlT3IjvLa1JSLJhhAwleaHaYezflbPOqjthfyPDqhPapRAmr8J5-BzrPUPT-_vhzostYcr37GkL8OkC45mO-7856R6fdL837bWxkizJiWF9IP_XciTCNdktXRmlyYbxNEJLP_ws4y-DhVXb2_ETGa56n0LGWRaz7DXL5ifDJOecck2uM9rR41BHJ0eHJCS3NF7Gmd42dGNNM9iM5WrgBkGS8-NrPBaFHp6Gf_0Q5mfA8WM4_iecTOBoX--f_QkAAP__lvUemA== @@ -230,14 +230,14 @@ vectorized: true │ columns: (pid1, cid1, ca1) │ ordering: +pid1 │ estimated row count: 30 (missing stats) - │ table: child1@primary + │ table: child1@child1_pkey │ spans: /3-/6 │ └── • scan columns: (pid1, pa1) ordering: +pid1 estimated row count: 3 (missing stats) - table: parent1@primary + table: parent1@parent1_pkey spans: /3-/5/# parallel @@ -253,12 +253,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: child1@primary +│ table: child1@child1_pkey │ spans: [/3 - /5] │ └── • scan missing stats - table: parent1@primary + table: parent1@parent1_pkey spans: [/3 - /5] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckdGL00AQxt_9K4bxpdGVZBPqw0Ihhxc1Ry89m4qC5mHNjr2F3G7c3YBS-r9LE-GuR6ucb5lv5zfffJMd-h8dCiw-3ywvygpml2W9qT8sI6iLZfFmAy_g7Xp1De2t7hSHq1VZQS8dmcDhY11W72DWa8Uj-PS-WBdTAV-HJMloAVkEF9XlQ7FdwDxChsYqquQdeRRfkGPDsHe2Je-tO0i7saFUP1EkDLXph3CQG4atdYRih0GHjlDgRn7raE1SkYsTZKgoSN2NY6eV897pO-l-IcO6l8YLiLNX8Wts9gztEO4n-yC3hILv2f-582P3P0c6bT-Pn59dID27wL3vYKxT5EgdeTYH8l8tJ1Jck9vSldWGXJwep-joe5jl_GW0cHp7O30iw9UQBOSc5SnLM5bPz4bJnnLNNfneGk-PQ52cnBySkNrSdBlvB9fSjbPtaDOVq5EbBUU-TK_pVJRmfBp_90OYPwFOH8PpX-HsCE72zf7Z7wAAAP__oz4elw== @@ -284,7 +284,7 @@ vectorized: true │ columns: (pid1, pa1) │ ordering: +pid1 │ estimated row count: 3 (missing stats) -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: /29-/31/# │ parallel │ @@ -292,7 +292,7 @@ vectorized: true columns: (pid1, cid1, ca1) ordering: +pid1 estimated row count: 30 (missing stats) - table: child1@primary + table: child1@child1_pkey spans: /29-/32 query T @@ -307,12 +307,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: [/29 - /31] │ └── • scan missing stats - table: child1@primary + table: child1@child1_pkey spans: [/29 - /31] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJycUVFv0zAQfudXnI6XFgyJHXhYpEoZNIhMXTLSSoAgDyE-OkuZHWxHAlX976jJ0MjUgrY33_fdd9995x26Hy3GmH66Wp1nOcyW2Xqz_rCawzpdpW838AzelcUldLUl7TlcFFkOzbVqJYci_wO_7JTksLglxurj-7RMYTbp-NqHYUQLEGdzOM-Xx9hmARGfQ1Eu0xLefJ44IENtJOX1DTmMvyDHimFnTUPOGXuAdkNDJn9iHDJUuuv9Aa4YNsYSxjv0yreEMW7qby2VVEuyQYgMJflatcPYW8uks-qmtr-Q4bqrtYshEGcvgogHT7HaMzS9vxvvfL0ljPmePW4FPl1hPOSpDcRJf3HS_86218ZKsiQnltVB-b-WIyEuyW7pwihNNhDTEC1997OEP58vrNpej09kWPQ-hoSzRLAkYskrlrw-mSd6yD1Lcp3Rju7nOjo5PIQhuaXxOM70tqEra5rBZiyLQTcAkpwfWTEWmR6o4cP_FvMHiMV9sfinOJqIw321f_I7AAD___2CMwk= @@ -347,14 +347,14 @@ vectorized: true │ columns: (pid1, pa1) │ ordering: +pid1 │ estimated row count: 333 (missing stats) - │ table: parent1@primary + │ table: parent1@parent1_pkey │ spans: /12- │ └── • scan columns: (pid1, cid2, cid3, ca2) ordering: +pid1 estimated row count: 333 (missing stats) - table: child2@primary + table: child2@child2_pkey spans: /12- query T @@ -369,12 +369,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: [/12 - ] │ └── • scan missing stats - table: child2@primary + table: child2@child2_pkey spans: [/12 - ] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckd9v0zAQx9_5K0731IJRYxd4iDQpwAJk6pqRFAGCPJj46CxldrAdCVT1f0dxkEanFdS93a_vffw979D_6DDF_NPV6mWxhtl5UW_q96s51Pkqf72Bx_CmKi-hl45M4HBRFmtor3WnBHyoi_VbmPVa8Tl8fJdXOYwxfB2SZElnwAWU1XlewavPsYEMjVW0ljfkMf2CHBuGvbMteW_dWNrFgUL9xDRhqE0_hLHcMGytI0x3GHToCFPcyG8dVSQVuUWCDBUFqbu49s9Ts97pG-l-IcO6l8ansODiKTZ7hnYIt5t9kFvClO_Zw-j8kD7d5kS4OAq_ZQ7GOkWO1AGvGZX_G7nHwSW5LV1YbcgtxKGDjr6HWcafzM-c3l5PITIsh5BCxlkmWPaMZc9Z9uKon-Upx6zI99Z4uuvr3s3JaIbUlqbjeDu4lq6cbSNmSsuoiwVFPkxdMSWFia3423-L-QlicVcs_ileHoiTfbN_9DsAAP__2Kgc-g== @@ -403,7 +403,7 @@ vectorized: true │ columns: (pid1, pa1) │ ordering: +pid1 │ estimated row count: 4 (missing stats) - │ table: parent1@primary + │ table: parent1@parent1_pkey │ spans: /1/0 /11/0 /21/0 /31/0 │ parallel │ @@ -411,7 +411,7 @@ vectorized: true columns: (pid1, cid2, cid3, ca2) ordering: +pid1 estimated row count: 40 (missing stats) - table: child2@primary + table: child2@child2_pkey spans: /1-/2 /11-/12 /21-/22 /31-/32 query T @@ -426,12 +426,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: [/1 - /1] [/11 - /11] [/21 - /21] [/31 - /31] │ └── • scan missing stats - table: child2@primary + table: child2@child2_pkey spans: [/1 - /1] [/11 - /11] [/21 - /21] [/31 - /31] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckc-O0zAQxu88xWhOLRgldoFDJKQAGyCrbrMkRYBQDiYe2khZO9iOBKr67igO0pJVFyg3z59v5veND-i-dZhg9vF6_SLfwOIir7bVu_USqmydvdrCQ3hdFlfQS0vac7gs8g00-7ZTAt5X-eYNLPpW8SV8eJuVGYxvGMdwBpwzEJzBii-hKC-yEl5-Cg3IUBtFG3lDDpPPyLFm2FvTkHPGjqlDaMjVd0xihq3uBz-ma4aNsYTJAX3rO8IEt_JLRyVJRTaKkaEiL9sujP2FnPa2vZH2BzKseqldAhGPYpBawQqM35N1WB8ZmsHfrnFe7ggTfmT_h8LnKNPBTpE8jsS_oYh7UW4JBm2sIktqtr0elX9rOeHniuyOLk2ryUZi7qejr36R8kfL57bd7acnMiwGn0DKWSpY-oSlT1n67F4_q3NOW5LrjXZ019fJyfFohtSOpuM4M9iGrq1pwpopLIIuJBQ5P1XFFOQ6lMLf_y7mZ4jFXbH4o3g1E8fH-vjgZwAAAP__o_gmnA== @@ -470,14 +470,14 @@ vectorized: true │ columns: (pid1, pa1) │ ordering: +pid1 │ estimated row count: 1,000 (missing stats) - │ table: parent1@primary + │ table: parent1@parent1_pkey │ spans: FULL SCAN │ └── • scan columns: (pid1, cid2, cid3, gcid2, gca2) ordering: +pid1 estimated row count: 1,000 (missing stats) - table: grandchild2@primary + table: grandchild2@grandchild2_pkey spans: FULL SCAN query T @@ -500,12 +500,12 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: grandchild2@primary + table: grandchild2@grandchild2_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElVGPozYUhd_7K6z7lHQdmWsDwyCNxKqbbbOaTbbJVK3U5oENboKUBWqI1NVo_nsFTDYkw9hBNNkXFPD9fOxzruNHyP_Zgg_jPz7dv51MyeDdZPGw-PV-SBbj-_FPD-RH8n4--0iyUMmkQPJhNpmStQqTaLWJtxEnvy0m05_JIIsjHJLffxnPx2QwGFTv5K-dZQl5RxCH5O30HWl8Xd0RFMMhmc3JafFtWzHHYWu1aJ1aiH11Fu5riTUECkkayWn4Rebg_wkIFDhQEEDBBgoOLClkKl3JPE9VWfJYAZPoX_AtCnGS7Yry85LCKlUS_Eco4mIrwYeH8PNWzmUYScUsoBDJIoy3lcyzd0Gm4i-h-goUFlmY5D4ZwfKJQrorDtPmRbiW4OMTPV_6fbwtpJKK4bFu_d2v8giaafi-P5k-eM_OBc1I9kPPXjex21cx_m3GFk68LifECRfwb2HtR04sOuz681eyCfPN8ZYDhOXTwUbexcZmgvx42kbDt6TIOLM544yTMIkIkrTYSNVr3eLVdR_m2SWpiqSS0dFMy5Lcl7QVQIBvaq3T_X-Uai0_pHEiFbs5Zrby72IQ4JvhnYrXm_onUJjtCp8ESANOA5sGDg1cGty82tR2j121rHeajtKMIT_df6u2c6SN53eC06ETGFrMsconWiOGNnPs8on2hRoDr98YaF2-M_j56Ygu6eyP6Yi5zHaZy9wL5cKvn4t3-VjE-bG4nQ7N4ZyMGHrM8conehcKR3yHQ4OXT8c-Px27Szr7ozJq_rlV0fA6mvx_zMa-fja3173pWlYzl3mWJrk86x6zyv3IaC1ri_J0p1byk0pXlUz9Oqu46kMk86IexfplktRD5QKbMJ7C2ITFEYzdYK8PjLwP7faStvQ072AZ7wZ7feATyzrSbi9pS08LbYvaer9tfX8LfYM7fdLSw4a09LApLT1tSMsgbUjL7ZPWTR-_9bDBbz1s8ltPG_w2SBv89vr4fdvHbz1s8FsPm_zW0wa_DdIGv1F_YxoMxy5X5kvtLndmV9rkuQE3mG4SN7n-4grRur58-uG_AAAA__8gZppK @@ -536,7 +536,7 @@ vectorized: true │ columns: (pid1, cid2, cid3, gcid2, gca2) │ ordering: +pid1 │ estimated row count: 1,000 (missing stats) - │ table: grandchild2@primary + │ table: grandchild2@grandchild2_pkey │ spans: FULL SCAN │ └── • filter @@ -549,7 +549,7 @@ vectorized: true columns: (pid1, pa1) ordering: +pid1 estimated row count: 1,000 (missing stats) - table: parent1@primary + table: parent1@parent1_pkey spans: FULL SCAN query T @@ -569,7 +569,7 @@ vectorized: true │ ├── • scan │ missing stats -│ table: grandchild2@primary +│ table: grandchild2@grandchild2_pkey │ spans: FULL SCAN │ └── • filter @@ -577,7 +577,7 @@ vectorized: true │ └── • scan missing stats - table: parent1@primary + table: parent1@parent1_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEldGvokYUxt_7V0zOk3THDDMDXCS5CZuu27q5q1u1aZPWB1amSuICHTDpzY3_ewPoVbk4I6XaFyJwfvON33cO8wLZXxvwYPjbl6f3ozHqfRjN5rOfnww0Gz4Nf5ij79HH6eQzWskgDpfraBMy9GkyGqM0kCLOKfplNhr_iHppFFID_frTcDpEvV6vvEd_bE2Ti0dEqYHejz-gk6fLR0S5YaDJFNWLB03FjBqN1bxxac4P1WlwqEWmARjiJBTj4JvIwPsdKGBggIEDBgsw2LDAkMpkKbIskUXJSwmMwr_BMzFEcbrNi8cLDMtECvBeII_yjQAP5sHXjZiKIBSSmIAhFHkQbUqZE-_8VEbfAvkMGGZpEGce6hNGLEYYYSiIQ0RRkq-FhMUOQ7LN93pHma_PaB1k63MBn8Jit8CQ5cFKgEd3-N_t2z5fdh9xw55r2ztKszbSH6NNLqSQxDnXrZ57ZR_5p13ked5oPHf3ifunrXR4te-RU2xwEWOvKzZw_LIc5zXOZ69NdnjTKUF-0cbjOokMhRRhfZ13hfCxahs31ZVa9Tg-C7kSn5IoFpI8nC-7EX_mPZ--Mx5ltFpXPwHDZJt7yKfYZ9jn2Lewb2P_4WJzWFf8qxb7HSf9JCWU1Sqbte0zbXr9TPAWs0yoSWyzuFKzT6hFbKu4UutGo03v3xjUvH1nsOvToW3SOXxo-8QhlkMc4twoF3b_XNzbx8Kvj8VqNTTHOekT6hLbLa7UvVE4_H8YGnr7dKzr02Ft0jmMSv_041ZGw6posv8wG-v-2Qzue9I17GYqsjSJM3HVOWYW_0eEK1FZlCVbuRRfZLIsZarbScmVx0Mosrx6y6ubUVy9KjZ4Pex2gSnrQjudpE01Teu0eUqf79usw6yF36wd7HaBa363pJ1O0qaa5kq_LXVYlhKmXJ2W3WU61LBmOtSwbjrUtGY6NNKa6XC6pPXQxW81rPFbDev8VtMavzXSGr_dLn4PuvithjV-q2Gd32pa47dGWvf1f3N4tDGcvjk82jiuoTWWa2id5xpcY7pOXOf6myNE6fpi990_AQAA__9NRpoc @@ -598,7 +598,7 @@ vectorized: true │ ├── • scan │ missing stats -│ table: grandchild2@primary +│ table: grandchild2@grandchild2_pkey │ spans: FULL SCAN │ └── • filter @@ -606,7 +606,7 @@ vectorized: true │ └── • scan missing stats - table: parent1@primary + table: parent1@parent1_pkey spans: FULL SCAN # Join on multiple interleaved columns with an overarching ancestor (parent1). @@ -632,7 +632,7 @@ vectorized: true │ ├── • scan │ missing stats -│ table: child2@primary +│ table: child2@child2_pkey │ spans: FULL SCAN │ └── • filter @@ -640,7 +640,7 @@ vectorized: true │ └── • scan missing stats - table: grandchild2@primary + table: grandchild2@grandchild2_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsll1vo0YUhu_7K0bnKjTjDjMM2EaKxKrrbb1K8NaJ1EqtL1gztZG84AKWuory3yuMsfnwckyokr3IDYqZeeZ8vO-c8AjJPxuwYfLHp9t3U5dcvZ_eP9z_dquR-8nt5OcH8iP5MJ_dkeU62PiCTF13Mid3k_kvE_JxNnXJKvZC_7A4c8nVVf73T9vA5-SmvLx_pZF37ntSbFoGvqhtyl5pjV1Gc5ehkd9_ncwn5Koa86-drhvqhpjVQ05ryxsy1DQym5-S3edRgFycSbIgudQKdlWh5PhArSr7Ta5pQCGMfOV6X1QC9p_AgYIACgZQkEDBhAWFbRwtVZJEcbblcQ9M_X_B1ikE4XaXZq8XFJZRrMB-hDRINwpsePA-b9Rceb6KmQ4UfJV6wWYfJk_f2cbBFy_-ChTut16Y2GQAiycK0S49nHo67PNXsvaSdfUYh1NHUMeAxdOCQpJ6KwU2f6LPy5FXDy9peiZRJpgUTDBBvNAnnETpWsW17E85iS45fQg2qYpVzKxqQvl7OzOVU_KSbdtT92F0kNgpOalYOZjCKfuoRpVddMQKTpacVONkyU1H7n8Q0fhmw06n7cIo9lWs_Mp5i4wstpzbAA6_po64po5xncesC3Cn4pX6GAVhZoqaKzbq7_SqdIJ2EwerdfUVUJjtUpsUlVFHUsekjkWdIXVG1Bl_0yiyR91nKnGjQbRl3Kp36GxssxKbX35xZIeLw7jOTD17cn3AuGSmzJ5cPuMeISke79H47R41G_bS90i-4j0Sl3tZdPFy8T9gwCwmLWYx6xkuRpI7unj45uJmw17axeIVXWxc7mKz00Q-DeEB4yNmjrInHz3Dy0iKRy9z_c3MzY69tJnNVzSzvNzMRhczF4N4UP7Q2DtZ5E5OLrQykuDRyqM3Jzcb9tJONr6Tj_Qzec5Vso3CRF30Ca5nlSp_pfImJtEuXqpPcbTch8l_zvbc_mPOV0marxr5j2mYL2UJXg5zvRdt9aGHvUIjZfM6rZdpUYH1Oiw6NFx0g2sN70pbfehhr9BI2UZrw2W7WrIV5sN2ucxW2mqHrT5at8OY1giNaN1OI1ojoZGyh320HrXC43a1xn3UaocxtRAaUaudRtRCQiNl88Yk7SIXb5-kHBmlvNcsRWhMMgxHNENwRDQsOFZ6r4HKkYlqIqo1Rmon1dppVDUEx1RrxzHVkOBY6Y3B2qra4umH_wIAAP__jH5T_g== @@ -665,7 +665,7 @@ vectorized: true │ ├── • scan │ missing stats -│ table: child2@primary +│ table: child2@child2_pkey │ spans: FULL SCAN │ └── • filter @@ -673,7 +673,7 @@ vectorized: true │ └── • scan missing stats - table: grandchild2@primary + table: grandchild2@grandchild2_pkey spans: FULL SCAN # Aggregation over parent and child keys. @@ -693,12 +693,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: parent1@primary + │ table: parent1@parent1_pkey │ spans: [/10 - /39] │ └── • scan missing stats - table: child1@primary + table: child1@child1_pkey spans: [/10 - /39] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckkGPmzAQhe_9Fdb0Aqq7YMhlkSIRdWnLKiHbkFUrtRwonrJIBFPbSK2i_PcKs1JCtKTK3uw38_m9GdiD-l1DANG3h-UiToh1F6fb9MvSJmm0jD5siep2VptLbDS7aSvObGqk4qmqObspeoV83KxX5LmJ3K_jhAxl8pjGySdiGY58_RxtouFCfnSu6-OcMNcmi-TuVC3mxL-1gUIjOCb5DhUE34FBRqGVokClhOylvWmI-R8IXApV03a6lzMKhZAIwR50pWuEALb5zxo3mHOUjgsUOOq8qs2zz6HDVla7XP4FCmmbNyogDnPfO_6t8xYorDsdkJBBdqAgOn00UjovEQJ2oK8Lw8ZhhqVNZJm5xyQ09CbDeJNhjhm6RkiOEvnIP-vJ_7W8MNEKZYn3ompQOt54ohp_aStk7-y5rMqn4Xg6hj85hn_NThdlKbHMtZCOPw6QPq6skPWe5uTZk4azaww3qFrRKDzf34svu_3SkJc4fAQlOlnggxSFsRmua8MZgaPSQ9UbLnFjSuYvO4XZFbB3DnsXYX8Eu-ewfxGencHZ4c2_AAAA___MwGdW @@ -798,14 +798,14 @@ vectorized: true │ columns: (pid1, pa1) │ ordering: +pid1 │ estimated row count: 1,000 (missing stats) - │ table: outer_p1@primary + │ table: outer_p1@outer_p1_pkey │ spans: FULL SCAN │ └── • scan columns: (pid1, cid1, cid2, ca1) ordering: +pid1 estimated row count: 1,000 (missing stats) - table: outer_c1@primary + table: outer_c1@outer_c1_pkey spans: FULL SCAN query T @@ -822,12 +822,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: outer_p1@primary + │ table: outer_p1@outer_p1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: outer_c1@primary + table: outer_c1@outer_c1_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMll1r4kwUx--fTzGcK306kkxerA0spHTtYrHaVQsLS1jS5KwGbCY7ibCl-N2XJC6uwWYSBsU7k5zfefn_T5y8Q_prDQ4Mvz2Nb0cT0vk8mi_mX8ddMh-Oh3cL8j-5n00fCd9kKH4kjNw_j8fkYTqa7G4FjDzPR5MvpJNEIesChZiHOPFfMQXnOzCgYAAFEyhYQMEGj0IieIBpykUe8l4Ao_A3ODqFKE42WX7boxBwgeC8QxZlawQHFv7LGmfohyi0PG-ImR-tizJ_23MTEb364g0ozBM_Th2i6T3NJn4cEkZ4tkIB3pbm8bs6-_Qvb2Tlp6vDxC4Db-tRSDN_ieCwLf2g330eLkIUGFbzXOWF91Gb-FhcUas69yOKJT7wKEahXR-mXbwl6JSeTJ8Xw1nhDFBY48-s47Kr7icRLVflT6AwwzhE4ZC76e14OL8bdlxGXbNLiWtQ4lqUuDYlbr8i0X58s8H4LQab8B5PNMYqkcdrWwe1WfNVMRqvit3TmH6iXWHn35XBBe2K0dwvs7FfTO9p7FQvt3F-w24uyDCzuWFWc8Psnmac6g0zz28Y0y_IMau5Y3pTx3raqdxq0a19rNvgWLdK_Rkf9nembepf0DJJPsVmmCY8TrHRya3ng2O4xFLLlG9EgE-CB0WZ8nJacMUxGWKalU_Z7moUl8_yDlvQKrClAvdV4EE9zKqw_i9s1MNGLcwOab1Km0pmSWgVWGJWPSwxqx6WmGWpmGUryS2hVWCJ3PWwRO56WCJ3X0XuayW5JbQKLJG7HpbIXQ9L5B6oyH2jJLeEVoElctfDErnrYdk_f6vD0miLK9GWEt1XogcSut2J6W3_-xMAAP__LoMzBQ== @@ -859,14 +859,14 @@ vectorized: true │ columns: (pid1, cid1, cid2, gcid1, gca1) │ ordering: +pid1,+cid1,+cid2 │ estimated row count: 1,000 (missing stats) - │ table: outer_gc1@primary + │ table: outer_gc1@outer_gc1_pkey │ spans: FULL SCAN │ └── • scan columns: (pid1, cid1, cid2, ca1) ordering: +pid1,+cid1,+cid2 estimated row count: 1,000 (missing stats) - table: outer_c1@primary + table: outer_c1@outer_c1_pkey spans: FULL SCAN query T @@ -883,12 +883,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: outer_gc1@primary + │ table: outer_gc1@outer_gc1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: outer_c1@primary + table: outer_c1@outer_c1_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckm-Lm0AQxt_3UyzzKjZzJKu5_hEKe6Re8fD0qgYKJRTrTq3guXZXoUfIdy_RthfDJdf0zcI-O795dh5mA-ZHBS54n-6CKz9kk_d-kiYfA4slXuAtU_aSXcfRLVNdS_pLkXN2vQoCdhP54W8t52yV-OEHNmlKyZHlf07bAoRaSQqzezLgfgYOCJewRmi0yskYpXfypi_y5U9w5whl3XTtTl4j5EoTuBtoy7YicCFUF6qZOYAgqc3Kqi_bIqiufYRMmxUE7mKLe4356cZp9rWimDJJejYftYe_g4tGl_eZfgCEpMlq47ILOGbO_9ecP2V-nrd91PvRsquVlqRJHkb5fMkTA9ySLuhGlTXpmT0eIH1oyB1WJlqlXtwvDiBU9K2dCD5FYU9ROFPrnS6L72MJEGKqJWmXLaOrwEuW3kRwFK8s3BNsFK9HgoPijYVMLJCJS2Ti7dGknFFSz-xeTKZRtaF_Wr75LiaSBQ2xG9XpnO60ynub4Rr1XC9IMu3wuhgufj087T64D_OTsDOC-SFsnwHbh7BzEp4ffHu9ffErAAD__4rhYh0= @@ -914,14 +914,14 @@ vectorized: true │ columns: (pid1, cid1, cid2, ca1) │ ordering: +pid1 │ estimated row count: 400 (missing stats) - │ table: outer_c1@primary + │ table: outer_c1@outer_c1_pkey │ spans: /0-/40 │ └── • scan columns: (pid1, pa1) ordering: +pid1 estimated row count: 40 (missing stats) - table: outer_p1@primary + table: outer_p1@outer_p1_pkey spans: /0-/39/# parallel @@ -937,12 +937,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: outer_c1@primary +│ table: outer_c1@outer_c1_pkey │ spans: [/0 - /39] │ └── • scan missing stats - table: outer_p1@primary + table: outer_p1@outer_p1_pkey spans: [/0 - /39] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlWFP2zwQx98_n8K6V_TBVewkLSUSUtAIW1FpWVu0SVs0heTWRipx5qTSEOp3n5qAIFmJgyzK3sWOf3e-__-su4fs1woc8L5ejU6HY3JwNpzNZ59HHTLzRt6HOfmfnE8nl0Ssc5Q_Qk5G3vmcXEyG44etlJPr2XD8kRykccQ75Msnb-qVC_J9zZiFJ4R1yOn47PlmSGzWAQqJiHAc3GIGzjfgQMEEChZQsIFCD3wKqRQhZpmQ2yP3BTCMfoPDKMRJus632z6FUEgE5x7yOF8hODAPblY4xSBCaWzjRpgH8apI83hvN5XxbSDvgMIsDZLMIQbrGj0SJBHhRORLlOBv6Pb8Q56n8Dd3ZBlky2pgl4O_8SlkebBAcMwNfeG-T3HWiZARSowqkfwt-Xhk1wFw-WGZq173JcoFXog4QWn0q8z8LkWn9G9yPfemhYtAYYU_8wOXH3ZOZLxYlp9AYbLOHeJy6prUtahrU7dfk-OpVEuj1B1FjEVXpAZndVF25rYruXn7tjBbt0Wva3D2Rn3B998XR-_UF2Z7b6zW3nDWNfhbPVpz_-YM3skcq705dntzel3DfKuXY-3fnON3Msdubw7bZU74wrCzmZYf_MVL7smP3j8w4XZccYpZKpIMW80vti0SowWWumViLUO8kiIs0pTLScEVwyLCLC__clauhknxr3gcr6B1YFsH7uvAg2aY12H2HDYrMK_DZiPMq4qxOm1pmaWgdWCFWc2wwqxmWGGWrWNWT0tuBa0DK-RuhhVyN8MKufs6ch9pya2gdWCF3M2wQu5mWCH3QEfu49fI_VpaB7Z14L4OPGiG-V9zo1Fvf_PfnwAAAP__8S6FSg== @@ -968,14 +968,14 @@ vectorized: true │ columns: (pid1, cid1, cid2, gcid1, gca1) │ ordering: +pid1 │ estimated row count: 200 (missing stats) - │ table: outer_gc1@primary + │ table: outer_gc1@outer_gc1_pkey │ spans: /1-/21 │ └── • scan columns: (pid1, pa1) ordering: +pid1 estimated row count: 20 (missing stats) - table: outer_p1@primary + table: outer_p1@outer_p1_pkey spans: /1-/20/# parallel @@ -991,12 +991,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: outer_gc1@primary +│ table: outer_gc1@outer_gc1_pkey │ spans: [/1 - /20] │ └── • scan missing stats - table: outer_p1@primary + table: outer_p1@outer_p1_pkey spans: [/1 - /20] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlW9Po04Qx5__XsVmHtmf28Dyp1YSE8yJiqmt12LukjtyQZhrSSrLLTQ5Y_reL4BGy1XArGnvGbvsZ2fm-53NPEL2awkWOF9vRqfumBycuTNv9nnUIzNn5HzyyP_kfDq5JnyVo_iRMjJ1Ly49cjVxx09785CR25k7viAHaRyxHvly6UydakG-r1RVxxPCeuR0fPZ6MzwhmtoDCgmPcBzcYwbWN2BAQQMKOlAwgIIJPoVU8BCzjIviyGMJuNFvsFQKcZKu8mLbpxBygWA9Qh7nSwQLvOBuiVMMIhRKcW-EeRAvyzDP1dipiO8D8QAUZmmQZBZRWF8xSZBEhBGeL1CAv6bF-ac4L9ffPZBFkC02L7YZ-GufQpYHcwRLW9M38n25Z5VwEaHAaOMmvyCfj2w7ADY7rGLV675GMccrHicolMEm4z2kaJGRc-6Rya3nTEsfgcISf-YHNjvsnYh4vqg-gcJklVvEZtQ-orZGbZ3aBrXNmiIv1eoS1W6pY8z7PFWYWtdla2xjIzbr3hla584w-0UyH9cObPftcLS_dtC6W6J3f6xqX2H1DGQ80XbvyXB_nujdPTG6e2L2Fe0j34m-e0-O9-eJ0d0TdZsn8_CNqaYxKU_Ym1nuyBPz3xhlW7KcYpbyJMNOg0ot6sRojpV0GV-JEG8ED8sw1XJScuWEiDDLq79MrVZuUv4r38g7aBnYkIEHMvCwGWZ1WH0Naxswq8NaI8w2FVPrtC5lVgstA7eY1Qy3mNUMt5hlyJhlSsndQsvALXI3wy1yN8Mtcg9k5D6SkruFloFb5G6GW-RuhlvkHsrIffweud9Ly8CGDDyQgYfNMPtrbjTq7a__-xMAAP__uZt-IA== @@ -1012,12 +1012,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: child1@primary +│ table: child1@child1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: child2@primary + table: child2@child2_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckVFr2zAQgN_3K8Q9JZtGLIVtIBhobNlwSOwsTqFQ_OBaV0fgWK4kQ0vwfy-2H9KEpCV9k0733Xd32oN7LEHA7Ha1-BVGZPQnTDbJ_8WYJLPF7PeGfCZ_1_GS5FtdKkbmcRgNZ05ukjD6R0a1VmwMFCqjMMp26EDcAYOUQm1Njs4Z24X2fUKonkAEFHRVN74LpxRyYxHEHrz2JYKATXZf4hozhXYSAAWFPtNlX3boQtZW7zL7DBSSOqucIF8hbSmYxh-qOp8VCIK19GNmdsbMrzHzi-aDsKmMVWhRHcnSjnwv5Uz7S7QFzo2u0E74cfslPviRZF_GP60utsMRKMSNF0QyKjmVUyq_Ufmdyh8XR5pes8w1utpUDk9HO1s56OZBVeCwH2cam-PKmrzXDNe45_qAQueHVz5cwqp_6n_7NcyugPkpzN-Ep0dw0Kbtp5cAAAD__6kxEbU= @@ -1035,12 +1035,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: parent2@primary + table: parent2@parent2_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckVFr2zAQgN_3K8Q9JZtGLGVPgoDHloFDYmdxHgrFD6p1dQ2O5EoytAT_92I7kCYkLemTfSd9992d9uCeKxAwv1svf0cxGf2N0m36fzkm6Xw5_7Ml38m_TbIitbSoPSOLJIoPASdJTOpSMTLrPhwoaKMwljt0IO6BQUahtiZH54ztUvv-QqReQAQUSl03vktnFHJjEcQefOkrBAFb-VDhBqVCOwmAgkIvy6ove-gkrG25k_YVKKS11E6Qn5C1FEzjj2WdlwWCYC39mppdUvNb1Pyq-mhstLEKLaoTW9aRn1250P8KbYELU2q0E37af4WPfhSyH-OZLYun4RcoJI0XJGQ05DSc0vDX1WGmt-xxg6422uH5UBcrB90kqAocNuNMY3NcW5P3miFMeq5PKHR-OOVDEOn-qH_o9zC7AebnMP8Qnp7AQZu1394CAAD__9KKEzk= @@ -1057,12 +1057,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: parent1@primary +│ table: parent1@parent1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: child1@primary + table: child1@child1_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckUFr2zAUx-_7FOKdkqERy94ugoDGljGHzM7iHAbDB9V6TQyO5EoytAR_92K7kDokLelRT_q93_s_HcE9VMBh8W-9-h4nZPIzzrbZ39WUZIvV4seWfCa_NukfUkuL2jOyTOOEFPuyUoykCaklI3NSSAYUtFGYyAM64P-BQU6htqZA54ztSsf-QawegQcUSl03vivnFApjEfgRfOkrBA5beVfhBqVCOwuAgkIvy6pv-zKGqG15kPYJKGS11I6TL5C3FEzjT22dlzsEzlr6MTUbq4fQt5jDq-aTsNHGKrSoRrK8I997cmH839Ltl6bUaGfhePoK7_1EhNO5LXd7PxHRFCikjedEMCpCKiIqvlLx7WqY6JY1btDVRjs8D3Wxc9AlQbXDYTPONLbAtTVFrxmOac_1BYXOD7fhcIh1f9X_82uY3QCH53D4JhyN4KDN20_PAQAA__-cfREn @@ -1078,12 +1078,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: child2@primary +│ table: child2@child2_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: grandchild2@primary + table: grandchild2@grandchild2_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElV1r2zwUx--fTyHOVftUQZZs58Uw8Ni6kdImXdPBYPjCjbTEkFqe7MBKyXcftlvSpJkUTWtyY_DLTzr6_SWfRyh_LiCC82_Xl--HI3TycTi5nXy5PEWT88vzD7fof_TpZnyFpvNswRm6GA9HaKbSnD89-DoZjj6jkyLjFKNpxtkpYMglF6P0XpQQfQcKGBhg8AFDABhCSDAUSk5FWUpVf_LYAEP-CyIPQ5YXy6p-nGCYSiUgeoQqqxYCIrhN7xbiRqRcKOIBBi6qNFs007T1xIXK7lP1ABgmRZqXEepAssIgl9XTqOvB7h7QPC3nm8PEFMcMklWCoazSmYCIrvDfFUg3R35hbUeVhJGAEUYYSnOOKJLVXCjX0tkfS18Ptcyl4kIJvjFYUpPPn-z6AGJ6hmN21s63reFKqJm4kFkuFOlucgvxozp5gk_fqWw2X98ChvGyilCzEhz7OA5w3MNxH8eDLRfrRfoOi9xR-kh2ZEEo3daxc-5gY266_94ILPYGoR4JvfpKvQ6hAQmD-kqDt9sq9DhbZXDQrcL2j4vZxPV8kjukS4Iu6ZLu2wXFjhNU76BB-fsHFVqdq_VR6hDaJ2G_vtL-28XlHycu6h00r2D_vHybvJ6PU-flH7EJi7Vhlf82reA4afWP1jB3FHYjykLmpdirHXr10gSfidZYKZdqKq6VnDbTtLfjhmtaDBdl1b5l7c0wb1_VBe4P91xgSl3o0AUe6GFqYYzZwT0XeMuYJR26wAM9zLZh7yXs63X7Wphu-va26cAlLD1sCEsPm8LS04aw9LAhrNAlrK6Lbj1s0K2HTbr1tEG3Hjbo7rno7rvo1sMG3XrYpFtPG3TrYYPugYtuatMsX_9CbbqlLW38-dv0S1va4Jy-ah5a6cnqv98BAAD__2JnI1g= @@ -1100,12 +1100,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: child2@primary +│ table: child2@child2_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: grandchild2@primary + table: grandchild2@grandchild2_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElV9r2zAUxd_3KcR9aoeCLNnOH8PAY-u2lC7pmg4Gww9upCWG1PIkB1ZKvvuw3ZImzaR4Wr0Xg2z_ro7OkXTvQf9cQQRn3y4v3o4n6OT9eHY9-3JximZnF2fvrtFr9OFq-hnNl9mKM3Q-HU_QQqU5f3jxdTaefEQnRcYpRvOM-6eAIZdcTNJboSH6DhQwMMDgA4YAMISQYCiUnAutpap-ua-BMf8FkYchy4t1Wb1OMMylEhDdQ5mVKwERXKc3K3ElUi4U8QADF2WareppGj1xobLbVN0BhlmR5jpCPUg2GOS6fKi6LXZzh5apXu6WiSmOfUg2CQZdpgsBEd3gvxNIdys_ce2ASsJIwAgjDKU5RxTJcimUq3T2R-nbUutcKi6U4DvFkoq0_XJg_Z9SvTyXWS4U6e-qW4kf5Ukt8fSNyhbLxwFgmK7LCNUjHDMcBzju43iI49He-rcL8x0WdkD1RPZkQSjdt-Dg3MHO3PT4_RC02A-EeiT0qif1eoQGJAyqJw1ebnvQbrfHqLPtwY6PiLWJ6PHE9kifBH3SJ_2XC4d1G86gs3D848MJW52f7ZHpETok4bB60uHLReR3GxH1OssoOD4jv01Gj8em9_S2qwNiTUD63yYUdJvQ8L80wAOaroQuZK7FUe3Nq1Yl-EI0Lmm5VnNxqeS8nqYZTmuubhlc6LL5yprBOG8-VQKPhwcuMKUudOgCj8wwbeEYawcPXOA9x1rSoQs8MsNsH_aewr7Zbt8I012_vX06cAnLDFvCMsO2sMy0JSwzbAkrdAmr72K3GbbYbYZtdptpi91m2GL3wMXuoYvdZthitxm22W2mLXabYYvdIxe7aZtm-fwKbdMt29LWy79Nv2xLWzynz5qH0fRk8-p3AAAA__8tKxoO @@ -1123,7 +1123,7 @@ distribution: local vectorized: true · • lookup join -│ table: parent1@primary +│ table: parent1@parent1_pkey │ equality: (pid1) = (pid1) │ equality cols are key │ @@ -1133,12 +1133,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: grandchild1@primary + │ table: grandchild1@grandchild1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: child1@primary + table: child1@child1_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJycktFv0zAQxt_5K6x7atmhNWlhIhKSgRWUqWtGUiQQyoOJj8yQ2cF2JFDV_x0lqdSmaoe6t9ydf_d9-ew1uN8VRDD_crd4Gy_Z6DrOVtmnxZhl88X8_Yo9Zx_S5JaVVmhZ3KtKBuwmiZds-_05i5cf2ahWMkBWKBmM-3EtLGk_mI9Zkl7PU_buK2tLQNBG0lI8kIPoGwSQI9TWFOScsW1r3R2I5R-IJghK141v2zlCYSxBtAavfEUQwUp8ryglIcleTgBBkheq6tbuGee1VQ_C_gWErBbaRewF5BsE0_jdaudFSRAFG3yafDCUP185PKm8E2y0sZIsyYFY3pL_O3LE_i3Zkm6M0mQvw6H9in74EQ8ukIcX4zdWlfe7EhCSxkeMB8hD5FPkM-Qvkb9CfnXy76bn5Np62sY6HfraPq-9XBfG_Gpq9tMozYxuXR31d4X89Ulzs3PMpeRqox0dXsHRzZM2d5Il9ffoTGMLurOm6GT6Mum4riHJ-X4a9kWsu1H3Kvfh4Aw4PITDR-HpAJ4cwtNH4dkBnG-e_QsAAP__pZ1rJA== @@ -1155,7 +1155,7 @@ distribution: local vectorized: true · • lookup join -│ table: parent1@primary +│ table: parent1@parent1_pkey │ equality: (pid1) = (pid1) │ equality cols are key │ @@ -1165,12 +1165,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: child1@primary + │ table: child1@child1_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: grandchild1@primary + table: grandchild1@grandchild1_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckk2P0zAQhu_8CmtOLTtom6R8RUIygoKy6rZLUyQklIOJh6whawfbkUBV_zuKs6JN2RaV43w8874z9gbcjxpSmH26mb_OFmz0NsvX-Yf5mOWz-ezNmj1m71bLa9YIS9pH7GqZLVh5q2oZsY95tnjPRo2S0bgvVFZo-XcVWdn1AII2khbijhyknyGCAqGxpiTnjO1Sm9CQyZ-QThCUblrfpQuE0liCdANe-ZoghbX4UtOKhCR7OQEESV6oOozt9Xlj1Z2wvwAhb4R2KXsCxRbBtH431XlREaTRFv9PORoq761_jnx8VH6n2mpjJVmSA8WiI__V8sAO12QrujJKk72MhzvU9NWPeHSBPL4Yv7Kqut2FgLBsfcp4hDxGniCfIn-K_Bny50e3S845bufp_rbJ0Nf9B9y769yY723DvhmlmdGdqz_-XgR_L4PFk-am55hbkWuMdnT4BA9OnnR3J1lR_47OtLakG2vKINOHy8CFhCTn-2rcB5kOpfA19-HoDDg-hOOTcDKAJ4dwchKeHsDF9tHvAAAA__9MQGdI diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_misc b/pkg/sql/opt/exec/execbuilder/testdata/distsql_misc index 4a9fca33770d..ac032fb9bbc6 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_misc +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_misc @@ -121,7 +121,7 @@ vectorized: true • scan columns: (a int, b int, c float, d decimal) estimated row count: 1,000 (100% of the table; stats collected ago) - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykk1Gr0zAUx9_9FOH_pJKSpe186JOiEwZzd657UKQPsTleC11SkwyUse8uy4Rr5U5y15dCzumv_18PJ0f4Hz0qLD5tVm-Wa_b83bLe1R9XnO0-bxb1C1YvVou3O_aSvd_efWBaBQUOYzWt1Z48qi-Q4MjBUYCjBMccDcfgbEveW3d-5RiBpf6JasbRmeEQzuWGo7WOUB0RutATKuzU1562pDQ5MQOHpqC6Psaco18Prtsr9wsc9aCMr1gmJFNGM8ls-E4OzYnDHsJDgg_qnlDJE79i8RB-MNZpcqTHwZ0J4H-e33qrQmy33V71aE6P_MTaZnYQ89FXrnnlIy-ZPh2ZMh0hM5HfMJ883SNP8sgzUdzgUaR7FEkeRSbKGzzKdI8yyaPMxHzi3j7isSU_WOMpafNm59UlfU-XS-DtwbW0cbaNMZfjXeRiQZMPl668HJYmtqLg37D8L_xqBM_-hfMpycUUuJwCz58EN6dnvwMAAP__eCPGvQ== diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_numtables b/pkg/sql/opt/exec/execbuilder/testdata/distsql_numtables index e3cef2f37c3f..d4c51b6d0d90 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_numtables +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_numtables @@ -58,7 +58,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: [ - /10] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkFFL-0AQxN__n2LZ_4valeQiBTkQojZioLY1CahoHmKylECai3cXsJR8d2mC2AoVfZzZm5kft0HzVqHE4HExvQxncDQJ4yS-nx5DHEyD6wTGBB6MYE1wAjfR_A7qdmWVsRoeboMogDW8tK57ll-AcGEeTYIIrp7AWI2EtSp4lq3YoHxGgSlho1XOxii9tTb9g7B4R-kSlnXT2q2dEuZKM8oN2tJWjBKT7LXiiLOCteMiYcE2K6u-9hPHb3S5yvQaCeMmq42EU0e4zn9MO0LV2q9yY7MloxQd_R4gVtqydsT-tu-NkDDiumAtYSylDGfJOYEvRt6OIPC9gxjeXzAiNo2qDe9hHGp2u5SQiyUPf21Uq3NeaJX3M4Oc97neKNjY4SoGEdbDaQu4GxY_hr1v4bT79xEAAP__JNjA3g== @@ -80,7 +80,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lWGL2jAYx9_vU4QHBne7SJu09TQwcNv1mOD0VoVtDF90NhyCNl0SYSJ-99FWvVM0yXS-s63_5_nlxx-yAvV7Bgzi70-9D90-unnoDkfDr71bNIx78acRijCi6A4tMXqHHpPBF5Qv5looLdG3z3ESo5sleouI7_u36D3y0SB5iBP08QdSWgKGXGS8n865AvYTCGCggCEADCFgiGCMoZBiwpUSsvzLqgp0sz_AfAzTvFjo8vUYw0RIDmwFeqpnHBiM0l8znvA049LzAUPGdTqdVWu2gJ1CTuepXAKGYZHmiqGGR33fh_Eag1jol-FKp88cGFljd4DH6UxzyaUX7W-v3zN00yEbMYyxbn_Uqvxsfp9EoP-CMBRSc-mRg_N36N3J-cHJ-S9jhcy45NmxoUcg-qIhCo8cWEh4npUWos2BMeqQO_rqAaMOPUkZ7lES9yYQ1yZURWh4oXsdLBS7OjSvVwcLwrYO5Nw6UHfR1Fl0WIluuou2UOxE319PtAVhK5qeKzpwFx04i25Wolvuoi0UO9Gt64m2IGxFB-eKDt1Fh86iS8UNR8cWgJ3j9vUcWxC2jsP_cYkcmZ9wVYhc8b3xpyb75Q3Ds2de30hKLOSEP0kxqdbUj4MqV73IuNL1V1I_dPP6Uwn4OkyMYWoOU2M42AuTw3Bgxm6aV4fGdGQOR8awZXPzkkPfG8Mt8-aWMdw2h9uXYBNLx2wlM7eMWGpGLuoZsRQttCw3N41YqkbMXTtkH6_f_A0AAP__W-z62Q== @@ -97,7 +97,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: [ - /9] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUUE9L-0AQvf8-xTA_SltYSVJP7qnVphqMSU0CKppDTIYSSLNxdwOWku8umyC2QkWP7715f5g9qrcKObqPa3_hBTBZenES3_tTiF3fvUpAaQmrKLyDut1qYdDDjRu5MNnBS2vb5zk49hQWwRImRvS9WxfGIxqNpxBGSzeCyyfYIcNaFBRkW1LIn9HBlGEjRU5KCWmofX_gFe_IbYZl3bTa0CnDXEhCvkdd6oqQY5K9VhRRVpC0bGRYkM7Kqo_9nDhvZLnNpKmNm6xWHM6sC-s_ph1D0eqvbKWzDSF3Ovb7_lVZaZIkLee4fOA5zGcHT-Ccx0nkBdfIMGy1UU-umP1lRUSqEbWiow2nku0uZUjFhoZPK9HKnNZS5H3NAMPe1xMFKT2ozgC8epDMwEOz86N59s2cdv8-AgAA__9ZOcVt @@ -114,7 +114,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlGGL2jAYx9_vU4QH5CqLmNTqeYGBt9nbyly9VWEbwxedfTgK2nRJhB3idx9tN--Usw34wntnEv_9__p7Sragf69AgP_9fnIbhMQZB7P57OukTWb-xP8wJ9oochdNv5BsszayWH375Ec-cZxH0iKcMdYm7whrk9twTJzifBJ89slVK21dtck0GvsRef-DPAKFTCYYxmvUIH4CBwouUOgBBQ8o9GFBIVdyiVpLVfxlWwaC5A8IRiHN8o0pthcUllIhiC2Y1KwQBMzjXyuMME5QdRlQSNDE6aqs-U89ylW6jlWBMcvjTAvS6bqMMVjsKMiNeXq4NvEDguA7ag9wl64MKlTd_mF7tS-I44z4P1tCiCCcD0tp-9-lu5H7TJ0QYjaPgvBj-yShe5LwCUyqBBUmh1Qj_hYWuxdeI5QdmXf5kcLpxggyck9y9A44uP2ouO2oykl1up79vBoo9vMaXGxerr0n19qTV3oa2HtqoNh7ur6Yp569p561p0HpaWjvqYFi72l4MU-evSfP2lNhqGOpqAFgr-jmVVyRLxBGqHOZaTzgO_VkVtyfmDxgdd9quVFLvFdyWdZUy2mZKzcS1KY65dUiyKqjAvB5mNeG3YMwPw679c0N1b3atFcf9s7h7teGB_XNg3Oar2vDw_rm4TnNN_WzYg2fSf1Hdty92L35GwAA__-sYBlG @@ -135,12 +135,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: numtosquare@primary +│ table: numtosquare@numtosquare_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ld-K2kAUh-_7FMO52oVZzCRR18BCSmupi9WtelEouciaqQY0k52ZgCK-e0my4KrpTNJRL_Pnm3PO94M5OxBvK_Cg_-tl-HkwQndfB9PZ9OfwHk37w_6XGdpgJCRH3ybjHyjJ1pKJtyzkFD2PB6P3F5Kj8Qht0RPalB8jwJCwiI7CNRXg_QYCGGzA4AAGFzC0IcCQcjanQjCe_7IrgEG0Ac_CECdpJvPXAYY54xS8HchYrih4MAtfV3RCw4jylgUYIirDeFWU-dCfn_J4HfItYJimYSI89ADBHgPL5PvRhxNft2gZiuXxWb4NwT7AIGS4oOCRPf6_FklVi5JX9NeyLctq2CQ5atL-Z5OHc7KE8YiWGR1OCnJS90vFpN9DsXxmcUJ5q3Pc2or-kXe-ff_E48VS3vnkHjCMM-khn2DfPZnzMINjMENFgyP2wNIWIafTVtZ2j2qT-iHbdUMuMn5ouZdNmtw26e41krbr23Zq23YL253L2rZva_vxGrad-rbd2rY7he3Hy9p2bmu7dw3bbn3b7dq2c89Nd5pKtHtb0cS69r6oqD-hImWJoLW2gZVPQKMFLY0IlvE5feFsXpQpH8cFV9zAERWy_GqXD4Ok_JQ3WB9um8BdE7hnAhOipkkDY3YzuG0Cd03gngl8YuyMtk9p6yPtqHU7Spgc-7ZOadckLDWsCUsNa8JSw5qw1LAurLZJWB0T3WpYo1sNa3SrYY1uNazT3TXR_WiiWw1rdKthjW41rNGthnW6eya6SZNleX6HNtmWTWnd5d9kXzaldc7J2fZQSg_2n_4GAAD__8eN5D4= @@ -173,7 +173,7 @@ vectorized: true │ columns: (x) │ ordering: +x │ estimated row count: 1,000 (missing stats) - │ table: numtosquare@primary + │ table: numtosquare@numtosquare_pkey │ spans: FULL SCAN │ └── • filter @@ -186,7 +186,7 @@ vectorized: true columns: (y, str) ordering: +y estimated row count: 1,000 (missing stats) - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN query T @@ -205,7 +205,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: numtosquare@primary +│ table: numtosquare@numtosquare_pkey │ spans: FULL SCAN │ └── • filter @@ -213,7 +213,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEluFr2kAYxr_vrzheGFh6Yi6JmgYKjs0yS6udChsMP6TmZgM2sXcXsJT-7yNJ12jUu8sO67fkkufe557f62tegD8twYf-r7ubL4MhanwbTKaTHzdnaNK_6X-dojVGXDB0NR7dojh9FAl_SgNG0fVoMHxbEAyNhmiNLtEz-vm9P-6jxhp9RvYZukQWYIiTkA6DR8rB_w0EMNiAwQEMLmBowwzDiiVzynnCsldecsEgXINvYYjiVSqy5RmGecIo-C8gIrGk4MM0uF_SMQ1CylpZoZCKIFrmZTas9lYsegzYM2CYrIKY-6gJGEap8FGPwOwVQ5KKsggXwYKCT16xvpGraCkoo6xFtl0U6z5q9EgWiO_7g-HUy3N5u67UL7e8f0YPAX_Y3i_3W3q063jcDMveF5Zge5Jq2ZZlHQzJ-a-Quh8aknvQY7lPGicspIyGWzvNMuW_V_a9AD1yXtSqnvWWsgW9TqI464lK2kv6RzR65PzskkWLh-KybEjccw7G3TY4yh6Tw6SZrFqkWz303tqdrdpEv9cc3V7LW63ZcvUbTuHiveG8EzYcOUHDOcdpOFsfuqsN3c2hd_ShK1y8Q784IXT7BNDd40B39KG3taF3cuiePnSFi_L_1zohdecE1NvHoe7qU-9oU894NzWBKwyUwD_2i8s9aPKjgHeO_zGxx8KY8lUSc6r1qWBlh6Dhgha58CRlc3rHknleprgd5bp8IaRcFE9JcTOIi0eZwU0xqYrJptjdEpN6Ys9ETIiR2sg46crVtjRwRx64UyNwu57YMxFXAq-rNjJeCXxH7UoDb8tpteU_D0-OqyNVd-XirglruVjBWi5WsVaojYyrWHsmrC_krC3FLNyZpHV4KdQKYAq1iphKbuZdxYzszNM60Ih8nhLFQCVGE1WhVlEzm6kquZl3JTWjsUoUc7WjoLYzWGtRk6tV1ORqJTWF3My7ktrOeJVSm71--hsAAP__o1BXlA== @@ -233,7 +233,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslF1r2zAUhu_3K8y5SkAhlu24qa9StgwCadPFGQyGL7ToYAKJ5UkyrIT892GZUTu0shrv0h-vnveRxDmD-n2EBJY_ntcPqydv9GWV7tJv67GXLtfLzztPVafRy9j7ut08ekV10kJpCQQKwfGJnVBB8hMoEAiAQAgEIiAwg4xAKcUelRKy_uVsAiv-BxKfwKEoK12_zgjshURIzqAP-oiQwI79OuIWGUc59YEAR80OR4P5h1-U8nBi8gUIpCUrVOJNpoHv139vKp14CwrZhYCo9CtGaZYjJPRC3Ks85LnEnGkhp7Nuk_T742hBx-9igncxr6tXhZAcJfLO0tnFXoT6H2sSdppQ972nrntvtn4yjW45gJ4-Le94yAEE7tqBs3ZktONbtHv6tLTvhmiH7tqhs3ZstOe3aPf0aWnPh2hH7tqRs3YtPPmwcU-VlvH9_xowb2C2qEpRKLwaNG-v7NcDCHmOzbRSopJ7fJZibzDN48bkzAuOSjdfafOwKppPdcF2mFrDQSdMr8OBndyDDq3pyB6OhvSeWcOxnRwPId9Zw3M7eT6EfG8_K7_nmtgv2TU7u3z6GwAA___56Ne0 @@ -249,7 +249,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslF2Lm0AUhu_7K-RcJWVC_Iqb9WqXbQpCVrfRpYUii9WDBJIZOzNCS8h_LyplTUjGIe6lH6_P-3iGcwDxewc-rH68rB-D0Jh8CeIk_raeGvFqvXpKjJzVVE4-T42vm-jZoPVeMiE5EKCswDDbowD_J1hAwAYCDhBwgcACUgIVZzkKwXjzyqENBMUf8E0CW1rVsrmdEsgZR_APILdyh-BDkv3a4QazAvncBAIFymy7azH_8Q8V3-4z_hcIxFVGhW_M5rZpNm9HtfSNkFGE9EiA1fIdJGRWIvjWkeiXeSxLjmUmGZ8vTrs8Ra9h8raJvseT6VWWfZX1jqgp4wVyLE6-nx7VbayzXxO_Pr8FYTJ5sK63cU7aWPpjsHTH0E5hNndvm8VAo569N3oWtr69rW3vtvbebfYDjXr2d6PtHX17R9vea-2Xt9kPNOrZL0fbu_r2rrZ94z27QXygTE_8_kMX0AXWBkXFqMCzRXT5y2azoLAosdtmgtU8xxfO8hbTXUZtrr1RoJDdU6u7CGj3qCnYD1vKsH0Sts7Dtpo8gHaUaVcddsf0XijDnprsjSHfKcNLNXk5hnyvnpU5cEzUh-ycnR4__QsAAP__YDroHw== @@ -268,7 +268,7 @@ vectorized: true │ └── • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lVFv2jwUhu-_XxEdqSr9ZAROAgVfUXXpFo2GLknVSROqMnKGIkHMHGfahPjvUxKVAip2SsYdcfL6PPh5Ja8h-7kABs7Xh_GN6xmtD24QBl_GV0bgjJ3b0JjxPJWt_6-MO39yb6T5UvJMCuPpk-M7RvFr7H52jMuLH8kvvLgEAimP0YuWmAH7BhQImEDAAgI2EOjBlMBK8BlmGRfFJ-sy4Ma_gXUJJOkql8XylMCMCwS2BpnIBQKDMPq-QB-jGEWnCwRilFGyKMe8YI1WIllG4g8QCFZRmjGj3TG73eLrSS6ZMTJhuiHAc_k6JpPRHIHRDamPcpcsJAoUnd4-R7XOjBHdPxbGWBD6rvfxBcTjKR5FMd-DcjOfC5xHkosOPTiV28mjFz77k6egdXV0mHV02OuMPOUiRoHx3v7TjQbn4HCCx_tn1wtbI3qcxt6jofULQesWouxDu2Of0goNz7YV_fO3QoOyq4E2boVZ34NZ24Ndeuif4kHDs_VwfX4PGpRdD2ZjD1Z9D1ZtD_3Sw-AUDxqerYfB-T1oUHY9WI092PU92LU9FAba71agQdkqGJ5fgQZlV4H9Ty-qN4b5mK14muHBhfX2zt3iIsN4jtWtl_FczPBB8Fk5pnqclLlyIcZMVm9p9eCm1asCcDdMlWFTHTaVYWsvTA_Dlhq7rx5tK9M9dbinDGsm95v86WtleKCePFCGh-rwsAk21XRMVzJ1y6imZrRRz6imaLZmuLppVFM1qu7aIft089_fAAAA__-w0Sxc @@ -285,7 +285,7 @@ vectorized: true · • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: LIMITED SCAN limit: 5 · @@ -299,7 +299,7 @@ vectorized: true · • scan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: LIMITED SCAN limit: 5 · @@ -314,7 +314,7 @@ vectorized: true · • revscan missing stats - table: numtostr@primary + table: numtostr@numtostr_pkey spans: [ - /999] [/9001 - ] limit: 5 · @@ -329,7 +329,7 @@ vectorized: true • scan columns: (x) estimated row count: 1,000 (missing stats) - table: numtosquare@primary + table: numtosquare@numtosquare_pkey spans: FULL SCAN # Verifies that unused renders don't cause us to do rendering instead of a @@ -342,7 +342,7 @@ vectorized: true · • scan missing stats - table: numtosquare@primary + table: numtosquare@numtosquare_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyMT81K9EAQvH9PMdRp93PEjcc5regKgbhZkxwEyWHMNEsgmcnOD0RC3l2SQdSD4Kmpqu6q6gnu0kHg8HLK7tIj2zykZVU-Z1tWHrLDfcVG9ljkT2zzCTm7Zf-XMbIrlkRRh94bdwnS0hYc2ig6yp4cxCsS1ByDNQ05Z-xCTetCqkaIHUerh-AXuuZojCWICb71HUGgkm8dFSQV2ZsdOBR52Xar7bfI_WDbXtp3cJSD1E6wa3DkwQu2T1DPHCb4rxDn5Zkgkpn_vUhBbjDa0Y8Ovznv5pqD1Jnis84E29DJmmaNiTBf71ZCkfNRTSJIdZTmev73EQAA___Tc4Tr @@ -369,7 +369,7 @@ vectorized: true └── • scan columns: (y, str) estimated row count: 1,000 (missing stats) - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN query T @@ -395,7 +395,7 @@ vectorized: true └── • scan columns: (y, str) estimated row count: 1,000 (missing stats) - table: numtostr@primary + table: numtostr@numtostr_pkey spans: FULL SCAN # Regression test for #20481. @@ -413,7 +413,7 @@ vectorized: true │ └── • scan missing stats - table: numtosquare@primary + table: numtosquare@numtosquare_pkey spans: [/11 - ] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkU2L1EAQhu_-iqJOM9qSdObWpx13IwazyZpEVtEgbVKEQKY72x8wMuS_SxLBHWEG99hv1VPPC31C-zSgwPjLQ7pPMtjcJWVVfkq3UMZpfFtBo71ym9dbeF_k97D5k3LYl6AVranyB6ftk5eG4PFDXMRwhO8-DHcEPIS8uIsLePcVjutKC2lyn1TAwy0yVLqlTB7IoviGHGuGo9ENWavNHJ2WhaQ9oggZ9mr0bo5rho02hOKErncDocBK_hyoINmSCUJk2JKT_bCcfdbvZjT9QZpfyLAcpbICAs7fYj0x1N79vW6d7AgFn9j_Nyi1cWQCfi6_id4gw0qPHwXwuVjunYBMK7pojV5i3XedoU46bYLo3Hybf86qH0X-WG62F127l7gKsqNWls48ly6HU82Q2o7Wf7Tam4YejG4WzfrMF24JWrJunfL1kah1NBd8DvOrcHQdjq7Cu3_genr1OwAA__-JxwGY diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_ordinality b/pkg/sql/opt/exec/execbuilder/testdata/distsql_ordinality index ffe74e06bdd6..91b186b44ff0 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_ordinality +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_ordinality @@ -43,7 +43,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -56,7 +56,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkF9ro0AUxd_3UwznaRfukpjdp3kybLJUsDFVoS2ND1O9BME4dmYETfC7lyj0H7Skj_fcOb9z5p5gnypIrO-24TLYiJ-rIEmTm_CXSNbh-l8qOhI9iSOJHbQpylpVpet3EP_j6Fp0_VHcBumViOJVsFmGQXoPQq0L3qgDW8gHeMgIjdE5W6vNWTqND4Kig5wTyrpp3VnOCLk2DHmCK13FkEjVY8Uxq4LNbA5CwU6V1Yjt-qPfmPKgTA9C0qjaSvEbhKh1UvgL8v-Q_xfZQNCte42wTu0Z0hvo8hrRy79n3rsWn9EX36HHbBtdW76IPB8yAhd7ng5pdWty3hqdjzHTGI2-USjYumnrTUNQT6tzwbdm70vz4oM5G348BwAA__8gULfl diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_single_flow b/pkg/sql/opt/exec/execbuilder/testdata/distsql_single_flow index 838a2513939d..9dbe644220cc 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_single_flow +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_single_flow @@ -36,12 +36,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykkt9r2zAQx9_3V4h7Ssa1seRsD4KCyuZRjyzp7MAGIw-qdUsNruVJMmyE_O_D9qC1WdL9eJPu7nPf7x13AP-tAgnJ59vVdbpms7dpvs0_ruYsT1bJmy17yd5lmw8ssOucBY6_HoJ9ukmyhAV-qdkVC-LyDhBqa2itH8iD_AIcEATsEBpnC_Leui586ItS8x1khFDWTRu68A6hsI5AHiCUoSKQsLYXtlnEgGAo6LLqy44Itg2PkA96TyCXR3zSmJ9vvNV3FWWkDblFNGoPQTWufNDuByDkja69ZBdwSpT_qyj_D1FxUvRRq62tM-TITHf3fMlvnN9of__eljW5hRgbr-hrmCk-v3Ll_j7MlJgDwqYNkimOSqCKUS1RvUL1-uQ88WieZ04iI9_Y2tMf3UTUDUNmT8NyvG1dQbfOFr3M8N30XB8w5MOQXQ6ftB5SncGnMD8LxyOYT2HxF7CYwvFZOJrY3h1f_AwAAP__UoE-6Q== @@ -93,12 +93,12 @@ vectorized: true │ ├── • scan │ estimated row count: 10,000 (100% of the table; stats collected ago) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ └── • scan estimated row count: 10,000 (100% of the table; stats collected ago) - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykkd-r2jAUx9_3V4TzpCPTJm57CAiRrcMOp64VNhh9iM2ZFmrTJSlsSP_30faCV9F78d63nB-f8z3fkyO4PwUICH-uF7NoSQafo2STfF8MSRIuwk8b8pZ8iVffiCezhHhGHx6c_JiHcUg8GykyJZ6PtkChNBqX6oAOxC9gkFKorMnQOWPb1LFriPRfEAGFvKxq36ZTCpmxCOIIPvcFgoCN2hYYo9JoxwFQ0OhVXnRjvaxsflD2H1BIKlU6Qd5B2lAwtT8NdF7tEARr6MtE2StE-U3Rk1ZdGqvRoj7TSVvyuZYrm8-V2381eYl2zM8XL_C3H0g2nNp8t_cDyYdAYVV7QSSjklM5ofI9lR-o_HjTz-SeI8boKlM6vPR1dXLQmkG9w_44ztQ2w7U1WSfTh6uO6xIane-rvA-isit1v_wYZnfA_BLmT8KTMzho0ubN_wAAAP__9MUM1w== @@ -133,12 +133,12 @@ vectorized: true │ │ │ └── • scan │ estimated row count: 10,000 (100% of the table; stats collected ago) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ └── • scan estimated row count: 10,000 (100% of the table; stats collected ago) - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykkFFr2zAQx9_3KY57SjatieRsDEFAYXWZR5p0cWCD4Qc1umUG1_IkGTZCvvuwPWhtmmxhb7qTfve7vw7ofxQoMf5yt1wkKxhdJ-k2_bQcQxov4_dbeAk3m_UtBFikEDj7cxDw-UO8iWEU-NU9zIGPYbG6bksNcwjiSo-RYWkNrfQDeZRfkWPGsHJ2R95b17QO7YPE_EQ5ZZiXVR2adsZwZx2hPGDIQ0EocavvC9qQNuQmU2RoKOi8aMcGVbn8QbtfyDCtdOklvMbsyNDW4XGgD3pPKPmR_bv0Ji8COXIT3jd2fQlKNMmllMlq--6kUlyifJpT_EfO6KT00VWX1hlyZHqerCH_9uSZzW_J7emjzUtyk6i_eUHfwkjxV-O5y_ffuyMyXNdBguJMCaYipmZMvWHq7clIs0v-cUO-sqWnYbRnJ0-bPGT21P2Pt7Xb0Z2zu1bTleuWaxuGfOhueVckZXfVLPgU5mfhqAfzISwugMUQjs7Cs8Ha2fHF7wAAAP__f31KBg== @@ -175,12 +175,12 @@ vectorized: true │ │ │ └── • scan │ estimated row count: 10,000 (100% of the table; stats collected ago) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ └── • scan estimated row count: 10,000 (100% of the table; stats collected ago) - table: t@primary + table: t@t_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykktFv0zAQxt_5K073tIG31kmKkKVKniCDTG0ykkogoT6Y5CiRsjjYjgSq-r-jJEhbKpox9hZ_d7_77nO8R_ujQoHh59vVVRTD2bso22QfV-eQhavw7QZewnWarMHBVQaOQxTHYQrrMH0fwk0SxX8KHiQxOH6pYAnOu1Tw6UOYhp2SwxI4Mqx1QbG6I4viC3aCh1uGjdE5WatNJ-_7pqj4iWLOsKyb1nXylmGuDaHYoytdRSgw1he6mQXIsCCnyqpvOzDUrbuHrFM7QrE4sAeD-fTgjfpaUUqqIDObj8ajk40p75T5hQyzRtVWwAWeMuVPMb0uK0eGzIyPHQddgPS7OxRCRPHmzUlL739zes_I6Z80vfdqa20KMlQc_67HW_6y-ZrMjm50WZOZ-ePNK_rmziR_db405e778IkMk9YJkJxJj0mfyYDJBZOvT0YKRpEeeYgp2UbXlv7pJc67PFTsaLgfq1uT063ReW8zHJOe64WCrBuqi-EQ1UOpW_AhzCdhbxr2JuFgBPNj2H8C7B3DwSQ8P1p7e3jxOwAA__9d9n-X diff --git a/pkg/sql/opt/exec/execbuilder/testdata/distsql_union b/pkg/sql/opt/exec/execbuilder/testdata/distsql_union index c19b03177f12..f44da8df88bf 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/distsql_union +++ b/pkg/sql/opt/exec/execbuilder/testdata/distsql_union @@ -44,7 +44,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • sort @@ -52,7 +52,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0ll-L2kAUxd_7KcJ9aumEeGcm-ydPu-1aEKxu1UJL8SE1wyK4TjqJoCt-92IUdi3mTmZiH5PxnHPPnR-YLRR_FpBA98dj_743CN4_9MaT8bf-h2Dc7Xc_T4J18GU0_BqsNy_B90FvOAju-_0zZ8PRQ3cUfPoZrIHBUmdqkD6rApJfgMCAAwMBDCQwiGHKIDd6popCm_1PtpWgl60h6TCYL_NVuX89ZTDTRkGyhXJeLhQkMEl_L9RIpZkyUQcYZKpM54sqZr15ucvN_Dk1G2AwztNlkQRhtE8ersokuEOY7hjoVflqX5Tpk4IEd6z5CGNtSmWi-DT9Dj_W2nMX-7cN8XIVhUdFdOgoa_1fbbXJlFHZOdMzQwx0qPOIn66gLr7zv-LjRvHxSTw63HCDC454GAlnii1DHK_4ypdil46XLCk8SqJDS1nr3xIk9OCYN18yb7JjEUbSGSTLEMcdX_uC5NARL1lSeJREh5ay1r8lSNwDJNF8yaLJjmVY_f-5gWQZ4rjjG1-QHDriJUsKj5Lo0FLW-rcESXiAJJsvWTbZcRw6Y2QZ4bjhW1-MHBri5SoKj4ro0FHW-reESLb8PDvjPFJFrpeFaug8ZaCyJ3XoUuiVmalHo2dVzOFxWOmqF5kqysMpHh56y8PRfsC3YiTF8kSM_4o5KRZ0smiTLElxTItjUsyv6LmvSPU1Lb6m76pDD35Dqm_p6NtW0UhTZtk40pght0BKg4a2dBo1lJZ0GjZrOo2bTU3jhhbekAaO226dJg4tyCHNnC2dt2KO08xxC3OcZo7b0mnmuIU5TjNnTXdjbrp79zcAAP__3g8zPw== @@ -70,12 +70,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslk-P2jAQxe_9FNacWtUo2En4k9O2hUpIFLZApVYVh5RYq0hsTG0jwSK-e0U4pLDs2A45kvDm_fzmKfIB9N81JDD8-Tj-NJqQ94PRfDH_Pv5A5sPx8MuC7MjX2fQb2e1fyI_JaDq58Xw6Gwxn5PMvsgMKhczEJH0WGpLfwIACBwohUIiAQgxLChslV0JrqU5_OZSCUbaDpE0hLzZbc3q8pLCSSkByAJObtYAEFumftZiJNBMqaAOFTJg0X5c2u_3Lw0blz6naA4X5Ji10QlrByXm6NQl5YLA8UpBbU43XJn0SkLAjrYcQN4bAfRAGuTZ5sTIBu8oAMQjrGcTOBtGbBtXcbSFVJpTILqYujxgCdz9j7HPGuVRGqICz6_Ef35zfuZjP3HvCHHoS8FYQepfVA6LTIAT3gaja9Cprx7o6G3Rq1pW7x8hdYgxbQeS9Sw-IboMQ3AeiiprX3KWzQbfmLkP3GEOXGKNW-Z3326UHRK9BCO4DUUUd1tyls0Gv5i4j9xgjlxjjlvcmPRD6jSFwH4Qq5qjmHp0N-g1cB24YzITeyEKLq2vB7cnt03VBZE_ifLfQcqtW4lHJVWlz_jktdeWDTGhzfhuef4yK86sT4P9ihoo5LuaoOLoQs2txeI84QsUxjh3jZ7YcuoOq-7i4i4p7uLh3T2L9e8QM7xizlQxvGbMkzu7qGburaAxvGuta0PGusY5FjpfNxo63zabG68aZBR0vHG9bPi144yzsHC_ctXp5fPcvAAD__4tHN40= @@ -97,7 +97,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -105,7 +105,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysl99u2kwQxe-_p1jN1VfVyMyu-WepUtqGqEgppEDVVi0Xrr2KLBGbro1EEvHuFSDhQJOZXceX2D575uz8ZrN5hOLPEkIYfr-5fj8ai_8vR7P57Mv1GzEbXg8_zsVGXE0nn8Xm_kF8-zScDsVG_Fq32yoWSnwdjyZj7kP9TigxmV4Op-LDD7EBD7I80ePoThcQ_gQEDyR4oMCDADzowMKDlcljXRS52X3yuBeMkg2EbQ_SbLUud48XHsS50RA-QpmWSw0hzKPfSz3VUaKN3wYPEl1G6XJvs7l_uFiZ9C4y9-DBbBVlRSha_s55si5DcYGw2HqQr8tq-aKMbjWEuPXsS7hKl6U22vidU__D851PtSthGI7G8_6LxtLF-Gl2bC68qhUemfQxHz5wMb5MizLN4tKXZ8mJZJ16Bh1rg-6LBtW66yw3iTY6OVl1saVKUPYZey4ZZ7kptfEVni__9sX1-yfrowOhFoD6suUr5_lkijgi2m16Pl3SNxlf1YqPTH7nCWWMqwH6By_LCbU26NacUGnfQGnTP9XyA2d8mSKO_es1ja9DemwyvqoVH5n8zvgyxhVdsia-1ga9mvgq-wYqm_4Frf0dxg1fpohj__pN4-uQHpuMr2rFRya_M76McUWXqomvtUG_Jr6BfQMDm_51Ws7wMiUcuzdoGl6H7NhceFUrPDLpndFljCuygproWhsMGrjaP2Mw1cUqzwp9dsV_fuX27uqvk1t9-D-hyNcm1jcmj_c2h5-TvW7_INFFeXiLhx-j7PBqV-BTMZLiDi2WpFjRYkWKA1ockOLuiRjPxZ3XiLukuEeX3aM3TNLqPqke0OIBTQnTLGQg4yijMUMmONKgMR1DmjROTaOGzIggDRsyXUMaN2R4Qxo47DNymjhu52jkGLWkiZMMcZImTnInG02cZMZF0shJ5nSTrzre5KvON0kTJxniJHPEcW2jiZPMuEgaOdVm_iTRzDE7p2jkztWL7X9_AwAA__-dZI_i @@ -127,7 +127,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -135,7 +135,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysl99u2kwQxe-_p1jN1VfVyMyuzR9LldI2REVKIQWqtmq5cPEqskRsujYSScS7VwYJAk1mdh1fYvvsmbPzm83mEYo_S4hg8P3m-v1wJP6_HE5n0y_Xb8R0cD34OBMbcTUZfxab-wfx7dNgMhAb8WvdbqvFOxGIr6PheMR9qQWK8eRyMBEffogNeJDliR7Fd7qA6CcgeCDBAwUeBOBBCHMPViZf6KLITfXJ404wTDYQtT1Is9W6rB7PPVjkRkP0CGVaLjVEMIt_L_VEx4k2fhs8SHQZp8udzeb-4WJl0rvY3IMH01WcFZFo-ZXzeF1G4gJhvvUgX5fH5YsyvtUQ4dazL-EqXZbaaOOHp_7755XPYVOiKBqOZr0XfaWL79Po2Fx2VSs7MuErdrj0gYvzZVqUabYofXkWnYgW1jMIrQ06Lxoc111nuUm00cnJqvMtVYKyz9h1yTjNTamNr_B8-bcvrt87WR8dELUg1JctXznPJ1PEgdFOw_PpEr7J9KpWemTiu08o43wcoH_wspxQa4NOzQmV9h2UNg1ULT9wxpcp4tDAbsP4OoTHJtOrWumRie-OL-N8pEvWxNfaoFsTX2XfQWXTwKC1u8O44csUcWhgr2F8HcJjk-lVrfTIxHfHl3E-0qVq4mtt0KuJb2DfwcCmgWHLGV6mhEP7-g3D6xAdm8uuamVHJrw7uozzkaygJrrWBv0GrvbPGEx0scqzQp9d8Z9fuV1d_XVyq_f_JxT52iz0jckXO5v9z_FOt3uQ6KLcv8X9j2G2f1UV-FSMpDikxZIUK1qsSHFAiwNS3DkR47k4fI24Q4q7dNldesMkre6R6j4t7tOUMM1CBjKOMhozZIIjDRrTMaRJ49Q0asiMCNKwIdM1pHFDhjekgcMeI6eJ43aORo5RS5o4yRAnaeIkd7LRxElmXCSNnGRON_mq402-6nyTNHGSIU4yRxzXNpo4yYyLpJFTbeZPEs0cs3OKRu5cPd_-9zcAAP__k7-P3A== @@ -151,12 +151,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslVGLm0AUhd_7K4b71MKImRnNbnzK0qYQsGabpFAoPtg4LILr2BkF3ZD_XmJodxOy44zmUa9nzjf3HJI9qD85BLD4-Rg-LCP08ctys918Dz-hzSJcfN6iBqMWfV2vvqGmfUE_ouUqQg9h-G_cYtT8HwOGQqQ8Sp65guAXEMBAAQMDDB5g8CHGUEqx40oJefxk3wmWaQPBBENWlHV1fB1j2AnJIdhDlVU5hwC2ye-cr3mSculOAEPKqyTLO5umfZmXMntOZAsYNmVSqAA57tF5VVcBmlM8JxAfMIi6enVQVfLEISAHPIzCt6QgeE7fpaDvUryaKy6zJEd1IWTKJU_P_OPDFdxIOKJ0yeTiy-sIEwMEe2_fyJudeRPzEIhBCC51XDakDBYcU2sOizqQ29aBDKgDNV8FNVkFc1xvSCQWHHfWHBaR0NtGQgdEwsxXwUxW4TndT5p1JBYc99YcFpGw20bCBkTima_CM1mF7wwJxIJiZklhEYd32zi8kf9hV05ec1WKQnHDk2MMPH3ip_soUcsdf5Ri19mcHledrnuRclWdpvT0sCy6UZfUWzEZI6ZaMdOLmVZMpmfqyaXa06qnemt_jHg65tJ3WvFML74fI56NwSb6jpG-kulb1isf1TPSUzS_R65vWq9c37VL9vjw4W8AAAD__7dTQPQ= @@ -175,7 +175,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • sort @@ -183,7 +183,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0ll1v2jwUx--fT2Gdq1aPUTiO05dc0a1MQmLQQSdtmrjIiFUhUZw5QYJWfPeJgETZmmPH1u6al39-53_8k8orlL-WkEL_28PwbjBiF_eD6eP0y_CSXUz7w_7HR7Zhnybjz2yzfWHjyX1_wj58Z9tL9nU0GI_Y3XBIvvhyefp7AxxWOlej7FmVkP4ABA4COMTAQQKHBGYcCqPnqiy12b_yWgcG-QbSLofFqlhX-9szDnNtFKSvUC2qpYIUHrOfSzVRWa5M1AUOuaqyxbLGbLYvvcIsnjOzBQ7TIluVKetEe_J4XaWsh7wXw2zHQa-rE6GssicFKe64-xRTbSplouR8gB7-f2I1gkQb0Nu66NFXNI4Re_RFr8KykXQCaJMro_K_Pz_bvTPOSHd0EYnzfTThu_8KnzjhkzM8tjhuh9OORCeKffy2zHE876twv9sU9mrsarhbY_SqLBtJgYqhh-HCfePCZeFxJ5I-ilnmOC78OlyxFoXRq7GrYm6N0auybCQFKiY8FIvdNx67LFx26n-lrRWzzHFc-E24Yi0Ko1djV8XcGqNXZdlIClQs9lBMum9cuiw86fgIZpniuO7bcMFa1EWPvq56ufVFr8KykRSolwz8GfjOlyeqLPSqVI5fnnFQ-ZM6dCn12szVg9HzGnO4HNe5-kauyurwFA8Xg9Xh0X7At2Ekw_IsjH-GBRmOaXIcQpZkOKHDCRkWV_TcV2T6mg5f02fVpQe_IdO3NPo2CI20ZZaNI60ZCouktGhoo9OqobTQadmsdFo3W5rWDS2-IS2csJ06bRxalEPaORtdBDknaOeExTlBOydsdNo5YXFO0M5Z6e2cm-3--x0AAP__SitYcQ== @@ -201,12 +201,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslkuP2jAUhff9FdZdDapRsJPwyGraQiUkClOgUquKRUqsUSQmobaReIj_XhEWKczMtZ1kxyPnns_nHkU-gfq7gQhGP58mn8ZT8jAcL5aL75MWeViMJqMvS7InX-ezb2R_OJLZfDiak8-_yKFFfkzHsyn60LFVft4DhSxPxDR-EQqi38CAAgcKPlAIgEIIKwpbma-FUrm8PHIqBONkD1GHQpptd_ry84rCOpcCohPoVG8ERLCM_2zEXMSJkF4HKCRCx-mmsNkfjo9bmb7E8gAUFts4UxFpexfn2U5H5JHB6kwh3-lyvNLxs4CInWk1hLAxBO6CMEyVTrO19thdBoiBX80gtDYI3jUo5-6yXCZCiuRm6uqMIXD7M4YuZ1zkUgvpcXY__uO787s385l9T5hFTzze9nznsjpAdBuE4C4QZZteZW1ZV2uDbsW6cvsYuU2MftsLnHfpANFrEIK7QJRR84q7tDboVdylbx-jbxNj0C7e8267dIDoNwjBXSDKqP2Ku7Q26FfcZWAfY2ATY9h23qQDwqAxBO6CUMYcVNyjtcGggevAGwZzobZ5psTdteDtyZ3LdUEkz-J6t1D5Tq7Fk8zXhc3166zQFT8kQunrv_71yzi7_nUB_F_MUDHHxRwVBzdidi_264gDVBzi2CF-ZsOhu6h6gIt7qLiPi_t1EhvUETO8Y8xUMrxlzJA4q9UzVqtoDG8a6xnQ8a6xrkGOl83EjrfNpMbrxpkBHS8c7xheLXjjDOwcL9y9enX-8C8AAP__pOo-EA== @@ -225,7 +225,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • sort @@ -233,7 +233,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0ll1v2jwUx--fT2Gdq1aPUTiO05dc0a1MQmLQQSdtmrjIiFUhUZw5QYJWfPeJgETZmmPH1i7z8s_v_I9_ErxC-WsJKfS_PQzvBiN2cT-YPk6_DC_ZxbQ_7H98ZBv2aTL-zDbbFzae3Pcn7MN3tr1kX0eD8YjdDYf0i5y9XJ4uN8BhpXM1yp5VCekPQOAggEMMHCRwSGDGoTB6rspSm_0rr3VgkG8g7XJYrIp1tb894zDXRkH6CtWiWipI4TH7uVQTleXKRF3gkKsqWyxrzGb70ivM4jkzW-AwLbJVmbJOtCeP11XKesh7gvdimO046HV1gpRV9qQgxR13H2SqTaVMlJzP0MP_T7hGkGgDetsYfSo3jhF79EWvwrKRdAJokyuj8r8_P9u9M85Id3QRifN9NOG7_wqfOOGTMzy2OG6H045EJ4o9FbeMcjzyq3DF23T2K-0ouVtj9KosG0mBlqGH5MJ948Jl4XEnkp6WWUY57vw63LIWndGvtKNlbo3Rq7JsJAVaJjwsi903HrssXHbqH1QfyyyjHHd-E25Zi87oV9rRMrfG6FVZNpICLYs9LJPuG5cuC086no5ZBjlu_DbcsRaN0aeyo2FufdGrsGwkBRomA_8SvvPliSoLvSqV45dnHFT-pA5dSr02c_Vg9LzGHC7Hda6-kauyOjzFw8VgdXi0H_BtGMmwPAvjn2FBhmOaHIeQJRlO6HBChsUVPfcVmb6mw9f0WXXpwW_I9C2Nvg1CI22ZZeNIa4bCIiktGtrotGooLXRaNiud1s2WpnVDi29ICydsp04bhxblkHbORhdBzgnaOWFxTtDOCRuddk5YnBO0c1Z6O-dmu_9-BwAA__9mrFxM @@ -272,12 +272,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9v2jwUh-_fTxGdq1ZvUGIn4U-kSXQr05AYdISLTVMuUuIVJEoyJ0ilFd99SijrkoBPTIrvCuSxfzl-To9fIPm9AhcG3-9GN8OxdnU79Gbet9G1duUNRoNPM22rfZ5OvmpP2-drbTieDaZe9u3NaHT0icn0djDVPv7QtqDDOgrZOHhkCbg_gYAOFHSwQAcbdHDA1yHm0ZwlScSzR15yYBg-gWvqsFzHmzT72tdhHnEG7guky3TFwIVZcL9iUxaEjBsm6BCyNFiu8m2ets_9mC8fA54l8OJgnbhay8h2nmxSV-tT8Hc6RJv0dfm3Ve-32iJIFsX1-gT8na9DkgYPDFyy08-L6SiNSU_GfFtns454yDgLCyv5GYk9cuRdvwTJwmPpJDZI6URm25i5RXVAhxX7lV71yfUHvnxY5H_9fXVSevW317Jkqu9FPGXcIE65Uv-fXN-uUbZjFXld9EiIcdSKYoOa5Rof3d4pbE_qy0VqyGXQlmFdpAskgrYVB6UngyroA6KoD5D6H_qgfW4f0PrnS-ucr9Uy7IuIKBG0ozgoPRlUgYhUkYhI_Q8ids4V0ap_vlad87Vb-Vh-fxElgnYVB6UngyoQ0VIkIlL_g4jdc0W065-vXed8ndZFNJSI2VMak56MqUBCW5GESPUPEvbe43p6ZP0pS-JonbBaN08zqxkLH9j-DJJow-fsjkfzfJv9x0nO5deNkCXp_le6_zBc5z_l51of7jSBCWlEO43onpgmEjUjcnCnCVyqmSztNKJ7YpqWafNf2irAZhm2hLAt3tkWwpSIt3aa9IcYRvpDDGP9gdBIfyA00h_tJv0hhpH-EMNYfyA00h8IjfRHR2hpVyxpt0l_9JoYLoYRw8UwZjhCI4YjNDYBZMZm9T-pzNyUpdEhIDU5pXFEc1KZIgVVCRWLTsRjBDGdVOaIjOoIjbiO0JjsGI7YjuGY7pUZKqW7mMZ0F9Oo7giO6Y7gmO6VQVrUvY3oXpkpUrpXZoqU7mIa011Mo7ojOKY7gmO6V-aplO5iGtNdTKO6IzimO4JjulemavGubYp1p5XZItTd3_33JwAA__80IHd3 @@ -295,12 +295,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mF1v4kYYhe_7K6y5SlQjMx98WaqUbUNVJBq2wEWrKhdemCZILKa2kcJG-e8V0KwTD37PTGxzlwCP5_hlzqMxzyz9d81CNvzz8_jT6M67uh3N5rM_xtfe1Ww4Hv4y9_ber9PJ797T_tu1N7qbD6ezw6vn3p1Mb4dT7-e_vD3z2SZe6rvoq05Z-DfjzGeC-Uwynynmsw6799k2iRc6TePk8JHnIzBaPrGw7bPVZrvLDi_f-2wRJ5qFzyxbZWvNQjaPvqz1VEdLnQRt5rOlzqLV-rjM0_7bzTZZfY2SQ4LZNtqkodcKDitPdlno3Qh2_-KzeJfll0-z6EGzkL_4H4vQqS2CcIlwu0qz1WaRBbwwgxteWCBnvuy9xyh9PPP5PIT8WIhOrSFUaYj8OrtNnCx1opfvrnS8SmlMgWaVR-g0FQFNKo_QrRDB_1DK36L0caazyTaQhUnN91sdvqn_p_GY-Wyt_8mubvj1T8nq4fH41_dtXn5bPZcdNouTTCeBNKb2Y-n1-xZjOzeR_y96JsRd3Iq3gWoXZ3x2-cG75bm9SLiFSALRCqSzzRxCdGsMIVxC5CrhDfrMOkS3QZ_x-mSCZlXmsxojoEmV-cwtQmWf8Qv5DOywV58ZU7P1mbDvsrDpsmwFylkoDiF6NYYQLiHyLosGhWIdotegUER9bUazKhNKjRHQpMqE4hahslDEhYQCdtirUIyp2QpF2ndZ2nRZtY6PRG5CcQjRrzGEcAmRd1k2KBTrEP0GhSLrazOaVZlQaoyAJlUmFLcIlYUiLyQUsMNehWJMzVYoyr7LyqbLnZazThwiDGqLIFwi5D1WDcrEOsSgQZmo-pqMZlUmkxojoEmVycQtQmWZqAvJBOywV5kYU_vIzzdnrj_V6TbepNrql5n2YWZ6-aBP30Ea75KF_pzEi-Myp38nR-74wlKn2eldefpntDm9dQj4FuYkLGhYFGH-FlbvYO4Gc1mFFrwSPahCyx5NS5LuVIE5GDlNC1GFlu1KdJ-mFblNuzTccYBFEe6ScI8uSI-EwT33SVhxeukBSXPQbE5LhYPFuaEVFzMAGqkB4MgNCAdyADiyA6flAvQAaOQHgCNBABwZAuGgLtwwzPsti0ZHK6aAG5rgtGR4FxSG1gy6ddozog0Wp03DBwA3VONUdpqGZadxWHaAo7LTOCq7MCzrUnZAo7IDHJUd4KjsCAc7XoBzKzo9GqqhcKPsglaNUODYTKsG3TptGtEHi9OmEeBEIwzVOJ35aRoe-mkcnvoBjo79NA7LbljWqew0DctO47DsNA7LDnC04-mzrARfuwQPyJwuu6RVI8FJWtKqAbcuadNIcKyQtGlkB-CGalzKDmhUdoCjsiMclB3g8CHfsKzTUz5Nw8d8GofP-TQOH_QBjnY8fZaV6Hujz7IF3Cw7rRoFTtKKVk3x1u9ffvgvAAD__zV_Boc= @@ -316,12 +316,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElkFv2jAYhu_7FdZ3aiWjYCfQEmkS3co0JAYdcNg05ZASryDRJIuD1LTiv08J0zoC-Ivn4d1K48d-_eWR8r6A_LEGHwZf7kY3wzG5uB3O5rPPo0tyMRuMBu_npCAfppNP5Kl4JpPp7WBK3n0lxSUZjueD6axccDMaIYuBQpxEYhw-Cgn-N2BAgQMFFyh4QKEDAYU0SxZCyiQrl7xUwDB6Ar9NYRWnm7z8d0BhkWQC_BfIV_lagA_z8H4tpiKMROa0gUIk8nC1ro55Kp77abZ6DLMCKMzSMJY-aTnlyZNN7pM-h2BLIdnkv7Z_3fW-IMtQLvf36zMItgEFmYcPAny2pX8Xs2M1Jj8Z83WfTZxkkchEtLdTUJLYkiN3_RjK5Uzkk9RhtTcyL1Lh76sDFNbie37RZ5dvs9XDsvrr99VZ7eqv13INrnUk8zhpJanDOvUBHD3b2zubNX_zrMGbd3jLcc-iqEbQruWg_GRQC5IyS5Ly5vPnTebvthzvLKJoBL2yHJSfDGpBFG5JFLf5_N0m8_da1Tfn34uiEfTaclB-MqgFUVxLonjN5-81mX-ndRZNNGL2rMbkJ2NakMT7D93oSKKpkGkSS9Go-bTLO4noQexmJJNNthB3WbKojtn9nFRc9RWPhMx3T_nuxzCuHlVzbw53TeCeCcyMcrOOmmYaI2N6cNcE7pnAzCh3bWQHNK_T7T9pVw27Spjtz6xdpz0TwdUwIrgaRgRXw5jgCI0I3jERXA0jgqthRHA1jAmO0IjgXRPBr0wUVcOIomoYUVQNY4oiNKLotYmiahhRVA0jiqphTFGERhTtmSjKjHoCQiOSIjRiKUJjmmI41hXMyoJZWzCrC4Z9wawwMKPGwA4qg5atahqzVU1jtqpp1FYEx2zVKUuHU9dpS7o0ZqtWX9LGMVsPyoPS1mD75mcAAAD__yJddcg= @@ -336,12 +336,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmMFu6kYUhvd9CuusEsnIzIwNxFKl3DZURaLhFli0qrLwxdMEiYtd20ghUd69wkh1Ysfn98R2ugvgz_P7ZL7DGZ4p_WdHPk3_-Dr_Mru1Lm5mq_Xq9_mldbGazqc_r62j9cty8Zv1eHyyFsub6dL66U_reGnNbtfT5ep0AX8h2bSPQn0bfNcp-X-RIJsk2aTIJpds8ujOpjiJNjpNo-R0yXMOzMJH8oc2bffxITu9fWfTJko0-c-UbbOdJp_WwbedXuog1IkzJJtCnQXbXb7M4_HpOk6234PkSDat4mCf-tbAOa28OGS-dS3p7sWm6JAVt0-z4F6TL17sj0XwOosgTSLcbNNsu99kjijV4FqUFiiYb0frIUgf3rm-CKE-FsLrNIRbG6K4z2EfJaFOdPjmTvldamNKVKsigtdXBFSpIsKoRQT7Qyl_DdKHlc4WsaNKlVofY-2_0v_LfE427fTf2cW1uPwx2d4_5H_9t83rH2vcbWVvo0EUO8orF-DdtSdv1hbNLRcNLHfkwFHGrcYgxKjDENIkROG56LHZNA4x6rHZiO5MR7WqazYdRkCVqms2ZhFaNxvxSc1GNndNNnFNDRzXWHiDEOMOQ0iTEIVrskfhG4cY9yi87M42VKs64TuMgCpVJ7xZhNbCy08SXjV3TTVxzR3k876Z8AYhJh2GkCYhCtdUj8I3DjHpUXjVnW2oVnXCdxgBVapOeLMIrYVXnyS829w1t4lr3sBYd4MIV51FkCYRCs_cHmVvHOKqR9nd7kxDtaqTvcMIqFJ1sptFaC27-z_8dvBOoqVO42if6ka_DAxPz6TDe32uURodko3-mkSbfJnzy0XO5W-EOs3On6rzi9n-_NEp4GtYsLDkYVmGxWvYfQMLM1jIVvRVG1qO2tBK8bRiaa8NLFotLYet6HEbWoHN4rLbFPy_PANYluERC4OHHvNqjni9JiwtBE9f8fQQ9IVKVzFxG9BIboQDuwGO9AY48ltUWqqJ4IBGhgMcKY5wsN0BjiQXlcb6dssivNJiOLwiuuB7DHp0vsmICdCNbzNiDPBKozGylaehrQBHtvI4tJXHoa2VJmtkK09DW3kc2gpwtGV5HNrKf8FIAYYofmwt4RVbJT-4gkeXfKeRHph7-U4jXYBXOo3R3MzTcHAGOJqceRyOzjyObJWVLmtiK6CRrQBHtiIcbVkeR7ZK_gtGTgDOT7IlvGorP8qiR-c7jQKnVAUOyGCOVvxQA-oOaGQrwoGtAEe2AhyedPmDMjrqgiN-u8XhYRfg6LQLfiNAu4b_glGodPwoW8Irtip-li0_-t3LD_8GAAD___KEBw0= @@ -363,7 +363,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -371,7 +371,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmF2P2kYYhe_7K6z3alc1MjNjvixF2rQhChKFFJDaquXCgekuEsHUNhJktf-9MmSXtU3m-DWsuQsfz8zkeJ4zwz5S9N-SPOr--bn_vjewbj70xpPx7_1b62bc7Xd_nVhb6-No-Ju13X2z_vjUHXWtrfXPpl5XM0veWr3BpDsaJ1973-9DRL9LmOHoQ3dk_fKXtSWbVsFcD_yvOiLvbxJkkySbFNnkkk0Nmtq0DoOZjqIgTL7yuAd68y15dZsWq_UmTt6e2jQLQk3eI8WLeKnJo4n_ZalH2p_r0KmTTXMd-4vlfprt7tvdOlx89cMd2TRe-6vIs2pOMvNwE3vWnaDpk03BJj4OH8X-vSZPPNnFl_BxsYx1qEOnkZ7_8H4yzzEWz_N6g0k7M_FxrC8768GPHtID7Rd6XJzkLO51PuJyAalSAQmQ0OwyAbk_XNxxnM0qCOc61PPUSNOERF858T_85EcPYx0P147MZDzZrbWX9odsWup_45s7cfsuXNw_7P9VIPMGJ_NxEMY6dGQjm9TPPxy_WSC2U4l8H_TEIgZBLVg7qp7N-OT0rdT0grGtC-xqR9YcxRYfLOJlXzevIT4noUtGpEpFJEBGb6K-qFZ9UZH6IPNn9Ztl1ZfFd5YssrFUzXHZ7oFFvGys1jXcYyQkLhmRKhWRABm9iXuyWvdkRe6BzJ_da5V1TxXfWarIxnJr-2spzz2wiJeN1b6Ge4yExCUjUqUiEiCjN3FPVeueqsg9kPmze-2y7rnFd5ZbZGM1amzzwBJetlXnGuYx8hGXC0iVCkiAhN7EO7da79yKvAOZP3vXucRPzRPjj3S0DlaRLvQrsp5kpuf3-vAMomATzvTnMJjtpzm8HO65_RtzHcWHT8XhRW91-ChZ4GtYZGHxGnZTsOTBQpxFt86hpTqL7phpaUxcmRNXjMQFD84kzqVb59CZxLl0x0y7xsQb5sQbRrhpnrlpftZAr5aRbpvh9jlummHkJqCBm2YauQlo4GbH3IZ1UIe5MuXYCWikJ8KBnwBHgiIcGCpylZoOXoLgzZ0KJBW5dklP7oLJc_XCOgXNNDwGAY7OQTMOD0KAA9uEuVtFEwSfa1eWbmYa6gZwpJsZh7oBHOlmPlkEOFpErmRZuplLVoKSlZySzV--WCXLxoFuAEe6IRxdPM0lK0HJylzJcnQDNNIN4UA3gCPdEA50k-YDRoIDRprvr0A3aS5ZCUpWcko2v-VYJcvGkW6skmXjSDdzyUpQspJzgc8_ddYNno0j3Vh3eDaOdDMfMAocMMr8J5GsbtOnn_4PAAD__ygb0uo= @@ -392,7 +392,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -400,7 +400,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy82Ftv4kYYBuD7_gprrhLVyMzBBCytlG3DapEobAGprdpcsDBNkFhMbSPBRvnvFbCJw8Hf62HGuQvg198h9iPwE0v_m7OItf_80v3Y6XlXd53haPh799q7Gra77V9H3tr7NOj_5q03370_PrcHbW_t_bOq1-XEE9depzdqD4bbw9Dh-sP2-P7grj3wfvnLWzOfLeKp7o2_6ZRFfzPOfCaYzyTzmWI-C9m9z5ZJPNFpGifbQ552gc50zaK6z2aL5Srbvn3vs0mcaBY9sWyWzTWL2Gj8da4HejzVSVBnPpvqbDyb78qsN99vl8ns2zjZMJ8Nl-NFGnm1YFu5v8oi75az-2efxassP32ajR80i_izX76FT7N5phOdBOFh_f372zr5WqIo6vRGzcLCwqTw29m5u-HlRcNzMP0ED69MCt_N0my2mGSBOJr8ZLI883XjPY7TxzPH502ElzUROm2iUdhEfp7VIk6mOtHTgzPtzlLYpkS7ylu4qaoFtKm8haZFC_5FXX4ep49DnfWXgTra1Giz1NEbAz92u8xnc_1vdnXLrz8ks4fH3V8l7q-WyRU2jJNMJ4E62drPxXjVS-zt3Ep-nPVMF724Fi-DsH685PP1D_XkBoiVMCwQtUAaEw6aeFWs4Zpwk-ldji8vGp-D-Y0RB4VzP3mFiJduolEh4tydoGhXRYg7bAFtqghxsxasEefvhDi4wl4QP9laacRFeUZEGUVkLVDGiIImXhW5cY2owfTc5fjyovE5mN8YUVA490tUiGjpJm4qRFS4EwztqghRhy2gTRUhataCNaLinRAFV9gLoidbK42oLM-ILKOIqu1-8pshCpp4VaTpGlGD6bnL8eVF43MwvzGioHDul6wQ0dJNNCtEVLoTDO2qCFGHLaBNFSFq1oI1ovKdEAVX2AuiJ1srjagqz4gqo0hYMyYUtPBqSMs1oQazc3fDy4uG52B6Y0BB4dwuVSGgpZtoVQiocqcX2lURoA5bQJsqAtSsBWtA1TsBCq6wF0BPtnbR89gzBQY6XcaLVJd61FrfLk1PH_T-n5DGq2SivyTxZFdm_7K_y-3emOo023_K9y86i_1H2wbfhjkZDumwIMOSDksyrOiwOg7zt-HGQZibhfmNTVpYpaVVWoF0SKatwrxpkxZWaWmVViDdIC9TEL4xCIvjcJMMt-gbpEWjUKf75rQpIUKFVoULEKdd4Q0Qp2XhgBZ-cpMdxoGJnL7cAE0gjWwCcYQTiCOdQBzxxE9uNROfQBoBBeJIKBBHRIE4MorTzvAWiNPSHMVPnOK0NaIOvkSA7y-AKkFbI4A1grZGAGsEbY0A1gjaGoG-f1lZA9LIGhBH1oA4sgbEkTXCyhqQRtaAOLIGxJE1II6sEbQ1AlgjaGsEsEbQ1khgjbSzRtLWSGCNBL-XgDWStkYCayRtjQTWSCtrQBpZA-LIGhBH1oA4skZaWQPSyBoQR9aAOLIGxJE1krZGAmskbY0E1kjaGgWsUXbWKNoaBaxRtDUKWKPA0xn0eIa2RgFrlJU1IA2f79hZA-LwCY-dNcrKGpBG1oA4sgbEkTUgjqxRtDUKWKNoaxSwRtHWhMCa0NCa--ef_g8AAP__HWJhhQ== @@ -422,7 +422,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -430,7 +430,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmF1v4kYYhe_7K0bvVaIamZkxX5ZWYttltUgUtoDUVi0XXpgmSCx2bSOFRPnvlWEDsU3meAwxd8vH43n3eJ4zJk8U_bcil3p_fh187A_Zzaf-ZDr5fXDLbia9Qe_XKduyz-PRb-xh-8j--NIb99gD-2dTr8s5k7esP5z2xpPkax8HA4ioD4zfstH4U2_MfvmLbcmitb9QQ--7isj9mzhZJMgiSRY5ZFGDZhYFoT9XUeSHyVeedkB_8UBu3aLlOtjEydszi-Z-qMh9ongZrxS5NPW-rdRYeQsV2nWyaKFib7naLfOwfewG4fK7FyYTTAJvHbmsZicrjzaxy7rc6gqaPVvkb-LjClHs3Sly-bNVfIrPy1WsQhXajfQI-_eTpY7JuK7bH07bhymyIxyv-m3L7r3oPn3JLqfZ83FMYTLm67D4RdOSpdLiIK45k5dNy3lzzON1Nms_XKhQLVJXmiUk-sqJ_-sXL7qfqHgU2CIT-HQbKDdtFlm0Uv_GN11--yFc3t3v_nW8AW-m3zBJf-KHsQpt0cgm9fOb128WiO1UIj8uemKIoV_zA1vWsxmfXL6VWp4b7PECW9wWNVuWqQQwx2GTN69bCSZxXTgvWSovDgJ751Lg1ZYCr6gUQPovpdAsWwqi-DYTRXaZrNlOGSvBHIdd1rqulQZx8QvnJUvlxUFg72ylqNZKUZGVIP0XK1tlrZTFt5ksssuc2u4J19hKMMdhl7Wva6VBXPzCeclSeXEQ2DtbKau1UlZkJUj_xcp2WSud4tvMKbLLGrUyToIpDnusc10nDcLiF01LlkqLg7je2UinWiOdiowE6b8Y2bnET9oT1x-rKPDXkSr0a7WeZKYWd2p_DyJ_E87V19Cf75bZvxztuN0bCxXF-0_5_kV_vf8oGfA1zLMwfw07KViYwZyfRbfOoYU8i-7oaaFNXOoTlwaJczM4k7gp3TqHziRuSnf0tKNNvKFPvKGFm_qVm_p7DfRqaem2Hm6f46YeRm4CGripp5GbgAZudvRtWAd1mCtTEzsBjfREOPAT4EhQhANDea5S08ELELy-U4GkPNcu6cUdsHiuXoxOQT0Nj0GAo3NQj8ODEODANq7vVt4Ewefa1Ug3PQ11AzjSTY9D3QCOdNOfLBwcLTxXska66UtWgJIVJiWbf_gyKlljHOgGcKQbwtGDp75kBShZkStZE90AjXRDONAN4Eg3hAPdhP6AEeCAEfrnV6Cb0JesACUrTEo2v-WMStYYR7oZlawxjnTTl6wAJStMHuDzd93oCd4YR7oZPcMb40g3_QEjwQEj9X8Syeo2e_7p_wAAAP__PE7xoQ== @@ -451,7 +451,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -459,7 +459,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy82F1v2lYcBvD7fQrrXCWakTkv5sVSJbqFqkgMOkDapi0XFM4SJIqZbaTQKN99AhocXvx_jn3s3DWEh_P0qf0T9TOL_1uygHX__NL_2Bs4N3e98WT8e__WuRl3-91fJ87W-TQa_uY8bb87f3zujrrOk_PPpl6XM0feOr3BpDsa796G3q4_OPzWGY7uuiPnl7-cLXPZKpzrwfSbjlnwN-PMZYK5TDKXKeYyn927bB2FMx3HYbR7y_M-0Js_saDussVqvUl2L9-7bBZGmgXPLFkkS80CNpl-XeqRns515NWZy-Y6mS6W-2Oett8762jxbRrtGozX01UcODVvd_JwkwROh7sdwe5fXBZukvSEOJk-aBbwF9e8xafFMtGRjjz_tMLh9d1R6TJBEPQGk9axRXYFkafC2yF4qUvIQktwMMXMkeZLqDwV7hZxsljNEk-czdDhZwekma9b53EaP155f1rCL1bCL7VEI7NE-jmbVRjNdaTnJ5-0_5TMmhJtlVZoVlUBLZVWaFlUcAu1_DyNH8c6Ga49dbbUZLvWwRsdP_b7zGVL_W9y0-G3H6LFw-P-T-nNlvnXaue5wsZhlOjIUxer_ZxtWt1gt2uT_PjUKy0GYS1ce379fOTr55-iynOIZgCaJ2qeLII76HEkrVEd7nmmKHkLWWgLDsaw4B1USGXlFfJuXKJRIe-8PFvRVlm8l1gBLZXFe74K1rzzd-IdXGGvvF-sZsy7MDdFmJAia54qwivocSSlWR2vOabgJW8hC23BwRgWvIIKqWyiQl6NSzQr5FWUZxvaKovXEiugpbJ4zVfBmlfxTryCK-yV14vVjHmV5qZIE1JUbf_0IDevoMeRlFZ1vOaYgpe8hSy0BQdjWPAKKqSyyQp5NS7RqpBXWZ5taKssXkusgJbK4jVfBWte5TvxCq6wV14vVjPmVZmbokxI8WtFcAUtjqC0q8M1xxC81CVkoSU4mMKCVlAhVU1VSKtxiXaFtKryXENbZdFaYgW0VBat-SpY06reiVZwhb3SerFaoee-Vw4Y6XgdrmJt9Ei3vhtNzx_04R8hDjfRTH-Jwtn-mMOPw31u_8Jcx8nht_zwQ291-NWu4NswJ8M-HRZkWNJhSYYVHVbnYf423DgJ83xh3rRJC6u0tEorkPbJtFWYt2zSwiotrdIKpBvkZQrCzRxhcR5ukeE2fYO0aRTqdG9Om-IjVGhVuABx2hXeAHFaFg5o4Rc32WkcmMjpyw3QBNLIJhBHOIE40gnEEU_84lbL4xNII6BAHAkF4ogoEEdGcdoZ3gZxWpqz-IVTnLZG1MGXCPD9BVAlaGsEsEbQ1ghgjaCtEcAaQVsj0PcvK2tAGlkD4sgaEEfWgDiyRlhZA9LIGhBH1oA4sgbEkTWCtkYAawRtjQDWCNoaCayRdtZI2hoJrJHg_0vAGklbI4E1krZGAmuklTUgjawBcWQNiCNrQBxZI62sAWlkDYgja0AcWQPiyBpJWyOBNZK2RgJrJG2NAtYoO2sUbY0C1ijaGgWsUeDpDHo8Q1ujgDXKyhqQhs937KwBcfiEx84aZWUNSCNrQBxZA-LIGhBH1ijaGgWsUbQ1ClijaGt8YI2f05r7l5_-DwAA__9zsYA8 @@ -475,12 +475,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEll2L2kAUhu_7K8K52oUJcfLhroGCS2upYHVrvCiUXGTNVAU3SWcimBX_e0ncrfWjczIdTS9j8sy8M-cB3w2In0vwofftcfDQHxo3H_vBJPg6uDWC3qD3YWKsiVEYn8ajL8a6eDH6w0lvHJS_PwwGb58UxFj__gQIJGnMhtEzE-B_BwoEbCDgAAEXCHgQEsh4OmVCpLz8ZFMB_XgNfovAIslWeflzSGCacgb-BvJFvmTgwyR6WrIxi2LGrRYQiFkeLZbVNuvipZvxxXPECyAQZFEifMO0yp1Hq9w3ujbpUgi3BNJV_rrDfuGnwphHYn64ZJeSrg3hNiQg8mjGwKdb8m9hPcWwrztrhbX_Gna_1CpJecw4iw8WC0sS--TMiT9HYh6wfJRZ9Gg6kyJj_qE8QGDJfuQ3VfDb93wxm789yK5hfz5H43xnwg9TM80s6h3fxNm93YO9aX0RaA0RLNu0nCt6qxC3rRz38ubSZs2lTZtr1x-HXWccjmm5V7RHIe6dctzL22M3a4_dtD1O_XE4dcbhmtWf1bXsUYh7rxz38vY4zdrjNG2PW38cbp1xeOYV3VEI21EMe3lz3GbNcf9n3zoTbcxEliaC1WpTrfJwLJ6x3WWJdMWn7JGn02qb3eOo4qo2EDOR797au4d-Ur2qBlAfbuvAHR2YauWmnpymCldG1eC2DtzRgalW7qMrO6HtY7r1J-3IYUcK08M7ax3Tro7gchgRXA4jgsthTHCERgT3dASXw4jgchgRXA5jgiM0InhbR_A7HUXlMKKoHEYUlcOYogiNKHqvo6gcRhSVw4iichhTFKERRTs6ilKtnoDQiKQIjViK0JimGI51Bb2yoNcW9OqCZl_QKwxUqzHQk8qgZKucxmyV05itchq1FcExW1XK0umtq7QlVRqzVakvKeOYrSflQWpruH33KwAA___e7YZe @@ -495,12 +495,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmFFv4kYUhd_7K6z7tCsNgpmxgViqlFU3VZFosg08VKry4IVpgsRiahsJNsp_rzBtndj4nhlsp4_gfMzxjc_HDM-U_rWmkG5-_zL9NLn1PnyezOaz36YfvdnN9OanubcX3sH7-f7uV29_-O5Nbuc397Pj-_9cPghv_99lErSJl-Y2-mZSCv8gSYIUCdIkyCdBAT0I2ibxwqRpnBz_5DkHJss9hQNBq812lx3ffhC0iBND4TNlq2xtKKR59HVt7k20NEl_QIKWJotW63yZ_eH79TZZfYuSAwmabaNNGnq9_nHlu10WetdKXEt6eBEU77JihTSLHg2F8kVcliJwTCHFtapNoVxSfF6l2WqzyPqyNIlzaxTY14P3FKVP55Eiir4sStBBFL82SvFRu02cLE1ilm8-LP-U2rDKYm5FiqCrFBYjK1IMG6QQFwX9JUqfZia72_Z1aV7zw9aEr2TwaTolQWvzZ_Yhv4mPPyarx6d_X9g1YNTulG_jXrzt66A8ibNrj9-sLe0dIC0c0Fe9vr7ERQ45hs45HGwEchQKkJ3byDrKsHMbyfY8YDG3Ohu1mMJiZHU2ckvR2EbyvW2k7JuobJqoe33_EiM45Bg553AwAshR1FB1bgTrKKPOjaDa66LF3OqM0GIKi5HVGcEtRWMjqPc2grZvorZpot_LzxPORnDIMXbO4WAEkKOooe7cCNZRxp0bQbfXRYu51RmhxRQWI6szgluKxkbQ720E376Jvk0Tg94lPnBIceWYwsEGIEVRQb9zG1hHuercBn57PbSYW50NWkxhMbI6G7ilaGwD___8_eJMtHuTbuNNaqx-nRgcb84sH81pWGm8SxbmSxIv8mVOL-9yLn9jadLsdFWfXkw2p0vHgK9hycKKh1UZlq9h_w0s3WCpGtFXTWg1bEJrzdOapYMmsGy0tBo0okdNaA0eFp99TMH_K3CAVRkesjC46RFfzSFfrzFLS8nTVzw9AF6oWMWl24BG5UY4aDfAUb0BjvotK0p1KTigUcMBjiqOcPC4AxyVXFbE-vaRRXhFMRxeKbrkHYNunZeMHIO68ZqRI4BXROPUVp6GbQU4aiuPw7byOGxrRbJObeVp2FYeh20FOHpkeRy2lf-CURJsovhtawmvtFXxG1dw64o3jQrAvpc3jfIBXjGN076Zp-HGGeBo58zjcOvM46itqmJZl7YCGrUV4KitCEePLI-jtir-C0aNAc7vZEt4ta38VhbdOm8aDU6pGhyQwT5a85saMHdAo7YiHLQV4KitAIcnXf6gjI664IjfbHF42AU4Ou2C3wjQU8N_wWg0On4rW8IrbdX8XrZ86w8vP_wdAAD__3KVI_s= @@ -519,12 +519,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9v2jAQwN_3KaJ7KppRYifhT6RJ7VamITHoCA-bJh5S4hUkSjInSNCq330iFLEQ4otJ6zco_p0vd7_r5RmSv0vwoPfzbnDTHxpXt31_4v8YNIwrvzfofZkYG-PrePTd2GyfjNH4tjc2Pv8ytg2jP5z0xv7uwM1gID381Dh-3gCBVRTyYfDIE_B-AwUCDAjYQMABAi5MCcQimvEkicTuyHMG9MMNeBaBxSpep7s_TwnMIsHBe4Z0kS45eDAJ7pd8zIOQC9MCAiFPg8Uyu2azfbqOxeIxEFsg4MfBKvGMprm7ebROPeOawvSFQLROX8Mfo95vjXmQzPPxsvNTAkkaPHDw6Au5LE1Xa5qsNM1jnPUqEiEXPMxFmu5I7MiZZ_0WJHOfp6PYpCcdmWxj7uUtAgJL_ie9uqaNT2LxMM8-lT768bFsler7kUi5MKl7WqmPpfGdCmU7V5HXoGeSGEbNKDaZdVrjs9e7uetpdbloBblM1jTtd5kChURbmhNlpYlqmAOqaQ6Q-h_moHXpHLDq_WVV-ms3TeddRFRItK05UVaaqAYRmSYRkfofRGxfKqJdvb92lf46zWwtv72ICol2NCfKShPVIKKtSUSk_gcRO5eK6FTvr1Olv27zXTRUSLOrNU1WmqYGCR1NEiLVP0jYfYvX0zPxxzyJo1XCK715Wrua8fCB73uQRGsx43cimmXX7L-OMi573Qh5ku5_Zfsv_VX2U9bX6nC7DkxpLdqtRXflNFWoGVWD23Xgk5qp0m4tuiun2Slt_U_bOdg6hW0p7MhvdqQwo_Kr3TrzIYeR-ZDD2HwgNDIfCI3MR6vOfMhhZD7kMDYfCI3MB0Ij89GWWtqRS9qpMx_dOobLYcRwOYwZjtCI4QiNbQCVtVn8T6qyN1VpdAkobU5lHNGcFrZITlXK5KJT-RpBTKeFPaKiOkIjriM0JjuGI7ZjOKZ7YYcq6S6nMd3lNKo7gmO6Izime2GR5nVvIboXdoqS7oWdoqS7nMZ0l9Oo7giO6Y7gmO6Ffaqku5zGdJfTqO4IjumO4Jjuha2af9e25Lqzwm6R6j59-fAvAAD__yMAfUs= @@ -542,12 +542,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mE1v6kYUhvf9FdZZJaoRzIz5slQptw1VkWi4BRatqix8YZogcTG1jQSJ8t8roJETBp93Jrazy4cfz-vDvI_GPFP674pCGvz5dfRleOdd3Q6ns-kfo2vvajoYDX6ZeTvv18n4d2-3f_LGk9vBxPv5L29_7Q3vZoPJ9HABd-HTdf7zjnxaxwt9F33XKYV_kyCfJPmkyKeAfGrTvU-bJJ7rNI2TwyXPR2C42FHY8mm53myzw5_vfZrHiabwmbJlttIU0iz6ttITHS100myRTwudRcvVcZnd_ulmkyy_R8mefJpuonUaeo3mYeXxNgu9G0H3Lz7F2yy_fZpFD5pC8eJ_LEK7sgjSJcLtMs2W63nWFGczMBbImW977zFKHy9cn4dQHwvRrjREUBgiv892HScLnejFuzsd71IYU6JZ5RHadUVAk8ojdEpE8D-U8rcofZzqbLxpqrNJzfYbHb4xwZfRiHxa6X-yqxtx_VOyfHg8_mSxzbsuO2waJ5lOmsqY2o-F9-9ZjO3SRP6_6YUQd3Ej3jSD1vmMLy7ff7e8sBeJsBBJUzaaytlmDiE6FYaQLiFylYgafWYdolOjz0R1MkGzKvJZhRHQpIp85hahtM_EJ_kM7LBXnxlTs_WZtO-ytOmyajQDZ6E4hOhWGEK6hMi7LGsUinWIbo1CkdW1Gc2qSCgVRkCTKhKKW4TSQpGfJBSww16FYkzNVijKvsvKpstB4_hK5CYUhxC9CkNIlxB5l1WNQrEO0atRKKq6NqNZFQmlwghoUkVCcYtQWijqk4QCdtirUIyp2QolsO9yYNPldsNZJw4R-pVFkC4R8h4HNcrEOkS_RpkE1TUZzapIJhVGQJMqkolbhNIyCT5JJmCHvcrEmNpHvr65cP-JTjfxOtVW38y0DjPTiwd9-gzSeJvM9dcknh-XOf06PnLHPyx0mp3-q06_DNenfx0CvoUFC0selueweAsH72DhBgtVhpaiFN0vQ6suTyuWbpeBBRg5T0tZhlatUnSPpwN2m3Z4uO0Ay3O4w8JdviBdFgbP3GPhQPBL91lagGYLXioCLC4MrbiYAdBIDQBHbkA4kAPAkR0ELxegB0AjPwAcCQLgyBAIB3URhmHeb1k0Ol4xZ7ihCcFLRnRAYXjNoEfnPSNbYHHeNKIPcEM1TmXnaVh2HodlBzgqO4-jskvDsi5lBzQqO8BR2QGOyo5wsOMlOLei06OhGg43yi551cgAHJt51aBH500je2Bx3jQSnGikoRqnMz9Pw0M_j8NTP8DRsZ_HYdkNyzqVnadh2Xkclp3HYdkBjnY8f5ZV4GNX4AVZ8GVXvGoUOEkrXjXg0RVvGgWOFYo3jWoD3FCNS9kBjcoOcFR2hIOyAxy-5BuWdXrL52n4ms_j8D2fx-GLPsDRjufPsgp9bvxZ9gw3y86rJgAn6YBXzfmj37_88F8AAAD__zvnDFs= @@ -566,12 +566,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9v2jAQwN_3KaJ7KppRYifhT6RJ7VamITHoCA-bJh5S4hUkSjInSNCq330iFLEQ4otJ67em8c--3P2O8zMkf5fgQe_n3eCmPzSubvv-xP8xaBhXfm_Q-zIxNsbX8ei7sdk-GaPxbW9sfP5lbBtGfzjpjf3dgpvBQL6YGE-N4-MGCKyikA-DR56A9xsoEGBAwAYCDhBwYUogFtGMJ0kkdkueM6AfbsCzCCxW8Trd_XtKYBYJDt4zpIt0ycGDSXC_5GMehFyYFhAIeRosltkxm-3TdSwWj4HYAgE_DlaJZzTN3cmjdeoZ1xSmLwSidfq6_XHX-60xD5J5fr9s_ZRAkgYPHDz6Qi4L09UaJisN87jPehWJkAse5naa7khsyZlv_RYkc5-no9ikJxWZbGPu5UUCAkv-J726po1PYvEwz_4q_fTjZ9kq2fcjkXJhUvc0Ux9L93cqpO1cRl43PRPEMGpGscms0xyfPd7NHU-ry0UryGWypmm_SxcoBNrSHCgrDVRDH1BNfYDk_9AHrUv7gFWvL6tSX7tpOu8iokKgbc2BstJANYjINImI5P8gYvtSEe3q9bWr1NdpZmP57UVUCLSjOVBWGqgGEW1NIiL5P4jYuVREp3p9nSr1dZvvoqFCmF2tYbLSMDVI6GiSEMn-QcLuW1xPz-w_5kkcrRJe6eZp7XLGwwe-r0ESrcWM34lolh2zfxxlXHbdCHmS7t-y_UN_lb3K6lodbteBKa1Fu7XorpymCjmjanC7DnySM1XarUV35TQ7pa3_aTsHW6ewLYUd-cmOFGZUfrRbpz_kMNIfchjrD4RG-gOhkf5o1ekPOYz0hxzG-gOhkf5AaKQ_2lJLO3JJO3X6o1vHcDmMGC6HMcMRGjEcobEJoDI2i7-kKnNTlUaHgNLkVMYRzWlhiuRUpUwuOpWPEcR0WpgjKqojNOI6QmOyYzhiO4ZjuhdmqJLuchrTXU6juiM4pjuCY7oXBmle9xaie2GmKOlemClKustpTHc5jeqO4JjuCI7pXpinSrrLaUx3OY3qjuCY7giO6V6Yqvm7tiXXnRVmi1T36cuHfwEAAP__dYp-EA== @@ -589,12 +589,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mE9v6kYUxff9FNZdJaoRzIz5Z6lSXhuqItHwCixaVVn4wTRB4mFqGwkS5btXQCMnDL5nJrazC4l_nuPLnJ_Geab03xWFNPjz6-jL8M67uh1OZ9M_Rtfe1XQwGvwy83ber5Px795u_-SNJ7eDiffzX97-2hvezQaT6eEC9kLfe7rOP-7Ip3W80HfRd51S-DcJ8kmST4p8CsinNt37tEniuU7TODlc8nwEhosdhS2fluvNNjv8-t6neZxoCp8pW2YrTSHNom8rPdHRQifNFvm00Fm0XB2X2e2fbjbJ8nuU7Mmn6SZap6HXaB5WHm-z0LsRdP_iU7zN8tunWfSgKRQv_scitCuLIF0i3C7TbLmeZ01xNgNjgZz5tvceo_TxwvV5CPWxEO1KQwSFIfL7bNdxstCJXry70_EuhTElmlUeoV1XBDSpPEKnRAT_Qyl_i9LHqc7Gm6Y6m9Rsv9HhGxl8GY3Ip5X-J7u6Edc_JcuHx-NPFtu867LDpnGS6aSpjKn9WHj_nsXYLk3k_5teCHEXN-JNM2idz_ji8v13ywt7kQgLkTRlo6mcbeYQolNhCOkSIleJqNFn1iE6NfpMVCcTNKsin1UYAU2qyGduEUr7THySz8AOe_WZMTVbn0n7LkubLqtGM3AWikOIboUhpEuIvMuyRqFYh-jWKBRZXZvRrIqEUmEENKkiobhFKC0U-UlCATvsVSjG1GyFouy7rGy6HDSOr0RuQnEI0aswhHQJkXdZ1SgU6xC9GoWiqmszmlWRUCqMgCZVJBS3CKWFoj5JKGCHvQrFmJqtUAL7Lgc2XW43nHXiEKFfWQTpEiHvcVCjTKxD9GuUSVBdk9GsimRSYQQ0qSKZuEUoLZPgk2QCdtirTIypfeTfNxfuP9HpJl6n2uo_M63DzPTiQZ--gzTeJnP9NYnnx2VOH8dH7viLhU6z01_V6cNwffrTIeBbWLCw5GF5Dou3cPAOFm6wUGVoKUrR_TK06vK0Yul2GViAkfO0lGVo1SpF93g6YLdph4fbDrA8hzss3OUL0mVh8Mw9Fg4Ev3SfpQVotuClIsDiwtCKixkAjdQAcOQGhAM5ABzZQfByAXoANPIDwJEgAI4MgXBQF2EY5v2WRaPjFXOGG5oQvGREBxSG1wx6dN4zsgUW500j-gA3VONUdp6GZedxWHaAo7LzOCq7NCzrUnZAo7IDHJUd4KjsCAc7XoJzKzo9GqrhcKPskleNDMCxmVcNenTeNLIHFudNI8GJRhqqcTrz8zQ89PM4PPUDHB37eRyW3bCsU9l5Gpadx2HZeRyWHeBox_NnWQW-dgVekAVfdsWrRoGTtOJVAx5d8aZR4FiheNOoNsAN1biUHdCo7ABHZUc4KDvA4Uu-YVmnt3yehq_5PA7f83kcvugDHO14_iyr0PfGn2XPcLPsvGoCcJIOeNWcP_r9yw__BQAA__8-7g0g @@ -610,12 +610,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElkFv2jAYhu_7FdZ3aiWjYCfQEmkS3co0JAYdcNg05ZASryDRJIuD1LTiv08J0zoC-Ivn4d1K48d-_eWR8r6A_LEGHwZf7kY3wzG5uB3O5rPPo0tyMRuMBu_npCAfppNP5Kl4JpPp7WBK3n0lz5dkOJ4PprNywc1ohCwGCnESiXH4KCT434ABBQ4UXKDgAYUOBBTSLFkIKZOsXPJSAcPoCfw2hVWcbvLy3wGFRZIJ8F8gX-VrAT7Mw_u1mIowEpnTBgqRyMPVujrmqXjup9nqMcwKoDBLw1j6pOWUJ082uU_6HIIthWST_9r-ddf7gixDudzfr88g2AYUZB4-CPDZlv5dzI7VmPxkzNd9NnGSRSIT0d5OQUliS47c9WMolzORT1KH1d7IvEiFv68OUFiL7_lFn12-zVYPy-qv31dntau_Xss1uNaRzOOklaQO69QHcPRsb-9s1vzNswZv3uEtxz2LohpBu5aD8pNBLUjKLEnKm8-fN5m_23K8s4iiEfTKclB-MqgFUbglUdzm83ebzN9rVd-cfy-KRtBry0H5yaAWRHEtieI1n7_XZP6d1lk00YjZsxqTn4xpQRLvP3SjI4mmQqZJLEWj5tMu7ySiB7GbkUw22ULcZcmiOmb3c1Jx1Vc8EjLfPeW7H8O4elTNvTncNYF7JjAzys06apppjIzpwV0TuGcCM6PctZEd0LxOt_-kXTXsKmG2P7N2nfZMBFfDiOBqGBFcDWOCIzQieMdEcDWMCK6GEcHVMCY4QiOCd00EvzJRVA0jiqphRFE1jCmK0Iii1yaKqmFEUTWMKKqGMUURGlG0Z6IoM-oJCI1IitCIpQiNaYrhWFcwKwtmbcGsLhj2BbPCwIwaAzuoDFq2qmnMVjWN2aqmUVsRHLNVpywdTl2nLenSmK1afUkbx2w9KA9KW4Ptm58BAAD__1VGdco= @@ -630,12 +630,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElkFv2jAYhu_7FdZ3aiWjYCfQEmkS3co0JAYdcNg05ZASryDRJIuD1LTiv08J0zoC-Ivn4d1K48d-_eWR8r6A_LEGHwZf7kY3wzG5uB3O5rPPo0tyMRuMBu_npCAfppNP5Kl4JpPp7WBK3n0lz5dkOJ4PprNywc1ohCwGCnESiXH4KCT434ABBQ4UXKDgAYUOBBTSLFkIKZOsXPJSAcPoCfw2hVWcbvLy3wGFRZIJ8F8gX-VrAT7Mw_u1mIowEpnTBgqRyMPVujrmqXjup9nqMcwKoDBLw1j6pOWUJ082uU_6HIIthWST_9r-ddf7gixDudzfr88g2AYUZB4-CPDZlv5dzI7VmPxkzNd9NnGSRSIT0d5OQUliS47c9WMolzORT1KH1d7IvEiFv68OUFiL7_lFn12-zVYPy-qv31dntau_Xss1uNaRzOOklaQO69QHcPRsb-9s1vzNswZv3uEtxz2LohpBu5aD8pNBLUjKLEnKm8-fN5m_23K8s4iiEfTKclB-MqgFUbglUdzm83ebzN9rVd-cfy-KRtBry0H5yaAWRHEtieI1n7_XZP6d1lk00YjZsxqTn4xpQRLvP3SjI4mmQqZJLEWj5tMu7ySiB7GbkUw22ULcZcmiOmb3c1Jx1Vc8EjLfPeW7H8O4elTNvTncNYF7JjAzys06apppjIzpwV0TuGcCM6PctZEd0LxOt_-kXTXsKmG2P7N2nfZMBFfDiOBqGBFcDWOCIzQieMdEcDWMCK6GEcHVMCY4QiOCd00EvzJRVA0jiqphRFE1jCmK0Iii1yaKqmFEUTWMKKqGMUURGlG0Z6IoM-oJCI1IitCIpQiNaYrhWFcwKwtmbcGsLhj2BbPCwIwaAzuoDFq2qmnMVjWN2aqmUVsRHLNVpywdTl2nLenSmK1afUkbx2w9KA9KW4Ptm58BAAD__1VGdco= @@ -651,12 +651,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElkGPmkAYhu_9FeQ7aTIGZwB3JWmym9amJla34qFJw4GV6WriAmUwkd3sf2_Abqyo8zGdCEeEZ-adb57E9xXE7w24MPrxMLkfT43O57G38L5PuoY3mow-LYyd8WU--2Z0Ou_PxMj3P-3yl64xni5Gc694cT-ZGOc_6gKBKA75NHjmAtyfQIEAAwIWELCBgAM-gSSNl1yIOC0-eS2BcbgDt09gHSXbrPjZJ7CMUw7uK2TrbMPBhUXwuOFzHoQ8NftAIORZsN6U2-zyl7skXT8HaQ4EvCSIhGv0zGLn2TZzjTtK7hj4bwTibfZ3h8PCj7mxCsTqeMl3xCcgsuCJg0vfyP-FdVoIyy6GPSy1jeI05CkPjxbzCxL75MyJvwZi5fFslpi0cjuLPOHusT9AYMN_ZZ0yePdjun5avT8cxlCZweFwlsbhziSfxr04MalTHcPZve2jvWl9C2gNC0zWM60rSqsQd9BKXHYxbgPa0ka1ZfXvgtW5C6tn2ldURyHuTStx2cW4DajDGlXHqn8XVp27sHvlf9S11FGIe9tKXHYxbgPqWI2qY9e_C7vOXTi9K4qjEHbYQlh2MWwD2titdawzueZcJHEkeK0G1S9OxsMnvp-UiLfpkj-k8bLcZv84K7myAYRcZPu3bP8wjspX5fTrwwMdeKgDU63c1JHTVGFkVA0e6MBDHZhq5a6M7IRmVbr_L23JYUsK0-OZ9au0rSO4HEYEl8OI4HIYExyhEcEdHcHlMCK4HEYEl8OY4AiNCD7QEfxGR1E5jCgqhxFF5TCmKEIjit7qKCqHEUXlMKKoHMYURWhE0aGOolSrJyA0IilCI5YiNKYphmNdQa8s6LUFvbqg2Rf0CgPVagz0pDIo2SqnMVvlNGarnEZtRXDMVpWydDp1lbakSmO2KvUlZRyz9aQ8SG313z78CQAA__9Al4gH @@ -671,12 +671,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmFFv4kYUhd_7K6z7lEiDYGZsIJYqZdVNVSSabAMPlao8eGGaILGY2kYKG-W_VxitnNj4nhlsZx_H5vOcucw5vuMXSv9bU0g3f3-ZfprcehefJ7P57K_ppTe7md78Nveevd_v7_70Li5-jIW3P1563n-_9Ca385v72eHG6R9ckqBNvDS30TeTUvgPSRKkSJAmQT4JCuhB0DaJFyZN4-Twk5ccmCyfKRwIWm22u-xw-UHQIk4MhS-UrbK1oZDm0de1uTfR0iT9AQlamixarfNpnvffr7fJ6luU7EnQbBtt0tDr9Q8z3-2y0LuW4lrRw6ugeJcVM6RZ9GgolK_iPBVBmyqUi4rPqzRbbRZZX5YqcWqOAvu6956i9Ok0UkjR50kJOpDi10opHrXbxMnSJGb57mH5U2rFKou6FSqCrlRYlKxQMWygQpwl9I8ofZqZ7G7b16V6zfdbE77Jg0_TKQlam3-zi3wRl78mq8enH4PCAbWLG7Vb4tu4F2_7OiiX4eTc43dzS_sAkBYB0Fe9vj4niBx0DNvVoVx0FP6XnUeRtZRh51Ek2wsBi7rVRVGLKixKVhdFbioaR5H80ChS9jZUNjbUvb5_Thw46Bi1q0O56Cg8qDqPA2spo87jQLVnRIu61cVBiyosSlYXB24qGseB-tA40PY21DY29Hv5McI5Dhx0jNvVoVx0FB7UnceBtZRx53Gg2zOiRd3q4qBFFRYlq4sDNxWN40B_aBz49jb0bWwY9M4JAwcVV22qUC4qCv_5nUeBtZSrzqPAb8-EFnWri4IWVViUrC4K3FQ0jgL_p32zOKHr3qTbeJMaqy8Sg8PKzPLRHCuVxrtkYb4k8SKf5ji8y7n8wtKk2fGuPg4mm-Otg8C3sGRhxcOqDMu3sP8Olm6wVI3oqya0GjahteZpzdJBE1g2mloNGtGjJrQGm8Vntyn4vwIHWJXhIQuDRY94aw55e41ZWkqevuLpAciFSqq4eBvQyNwIB-4GOLI3wJG_ZSVSXQwOaORwgCOLIxxsd4Ajk8tKsL7fsgivRAyHV4wu-YxBS-dDRo6B3fiYkSOAV4LGya08Dd0KcORWHodu5XHo1krIOrmVp6FbeRy6FeBoy_I4dCv_glESNFF821rCK25VfOMKlq74pFEB6Hv5pFE-wCtJ49Q38zRsnAGOOmceh60zjyO3qkrKurgV0MitAEduRTjasjyO3Kr4F4waA5zvZEt41a18K4uWzieNBqdUDQ7IoI_WfFMD6g5o5FaEA7cCHLkV4PCkyx-U0VEXHPGbTQ4PuwBHp13wjQDtGv4Fo1Hp-Fa2hFfcqvletrz0h9df_g8AAP__x5IlpA== @@ -697,12 +697,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lt9uokAUh-_3Kci5arNjYAbwD8kmdls3a-LWrnjRzYYLKrPVxAo7YKJtfPcNWLdF7BxGlLtS-GYOZ76fhxeI_87Bgd793eCqf6td3PTdsftzcKlduL1B73qsrbVvo-EPbbV-vtR699e9u7F2NRj8v73SrtzcM8PRTW-kff2lrYHAIgz4rf_EY3B-AwUCDAiYQMACAjZ4BCIRTngchyJ95CUD-sEKHIPAbBEtk_TfHoFJKDg4L5DMkjkHB8b-w5yPuB9woRtAIOCJP5tn26zWz91IzJ58kVbgRv4idrSGnu48XCaO1mXgbQiEy-R1-bdVH9ba1I-n-fW6FLyNRyBO_EcODt2Q48q0FcuklcpkH5b5ts5yEYqACx7kVvJSEnvkwLt-9-Opy5NhpNO9ExmvI-68kwcIzPmf5KJLL7-I2eM0--vD9357J1Ol9W4oEi50au-36fOH61slenaoHa-LHijiNmyEkc6M_QYf3N7ObU_Lm0VLmKWzhm6eJQIKhTaVCz1lCGi9IaB1hABp_i4EzWNDwMofLitzuGZDt85ioUKhLeVCT2khq9dCVoeFSPN3FraOtdAsf7hmmcO1Gtk0Pr2FCoW2lQs9pYVmvRaadViINH9nYftYC63yh2uVOVy7cRYHFcrsKJZ5SgOteg206jAQaf3OwM4pPkkPrD_icRQuYl7qa9NIG8aDR749gDhcigm_E-Ek22Z7Ocy47Csj4HGyvcu2F_3F9lZaYHm4VQWmtBJtV6I7cpoq9Iypwa0q8F7PVGm7Et2R02yfNt7TZg429mFTClvy07KkMKPyre0q-ZDDSD7kMJYPhEbygdBIPppV8iGHkXzIYSwfCI3kA6GRfLSklrblkrar5KNTxXA5jBguhzHDERoxHKGxCaAyNou_pCpzU5VGh4DS5FTGEc1pYYrkVKVMLjqVjxHEdFqYIyqqIzTiOkJjsmM4YjuGY7oXZqiS7nIa011Oo7ojOKY7gmO6FwZpXvcmonthpijpXpgpSrrLaUx3OY3qjuCY7giO6V6Yp0q6y2lMdzmN6o7gmO4IjulemKr5b21DrjsrzBap7t7m078AAAD__2ZMc04= @@ -720,12 +720,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mF1v4kYYhe_7K6y5SlQjMzPmy1KlpBuqRqIhBS62qnLhhWmCxGJqGylslP9eYcp68eD3zMQ2d0mcx3P8MufRmDeW_LtiARt-fhzd3j84V3f309n0z9G1czUdjoafZs7O-W0y_sN53X27doafPw0fZ98vvTq305Pr48ndcOL8-pezYy5bRwv1EH5VCQv-Zpy5TDCXSeYyn7msw55ctomjuUqSKN7_y1sG3C9eWdB22XK92ab7Pz-5bB7FigVvLF2mK8UCNgu_rNREhQsVe23msoVKw-UqW-Z19-1mEy-_hvE-wXQTrpPAaXn7lcfbNHBuBHt6d1m0TfPbJ2n4rFjA392PRehYRuClEYRNhLtlki7X89TjhRloC-TMl53zEiYvZ_4_DyE_FqJTawi_NER-n-06ihcqVouTO2V3KY0p0KzyCJ2mIqBJ5RG6FSK4H0r5e5i8TFU63niyMKnZbqOCowBuRyPmspX6J7264de_xMvnl-wngz3es9le0yhOVexJbWQ_l96_bzCzc-P4_6ZnQjxErWjj-e3igM8uPzhZnptbhBtYxBMtT1qrzCJE1zqEqcxAiNwjvEGZGYfoNigzXp9J0KzKZFZjBDSpMpnZRagsM34JmYHtdZSZNjJTmQnzIguTIsuW51vbxCJEzzqEqU1AiLzIokGbGIfoNWgTUV-V0azKbFJjBDSpMpvYRahsE3EJm4DtdbSJNjJTm0jzIkuTIvut7E3IziYWIfrWIUxtAkLkRZYN2sQ4RL9Bm8j6qoxmVWaTGiOgSZXZxC5CZZvIS9gEbK-jTbSRmdrENy-yb1LkTsvaJRYRBpYRTE0CIuQl9hs0iXGIQYMm8eurMZpVmUlqjIAmVWYSuwiVTeJfwiRgex1Noo3sI1_ZnLn_RCWbaJ0oo29j2vuBqcWzOnwASbSN5-oxjubZModfxxmX_WGhkvRwVRx-uV8fLu0D_ghzEpY0LIow_xH2T2BuB3NZhRa8Ej2oQsseTUuS7lSBORg5TQtRhZbtSnSfpn1ym3ZpuGMBiyLcJeEeXZAeCYNn7pOwz-mlByTNAc1pqXBkFU0rNmYANFIDwJEbEA7kAHBkB07LBegB0MgPAEeCADgyBMJBXbhmmNMti0ZHK6aAa5rgtGR4FxSG1gx6dNozfAAWp00j2gDXVGNVdpqGZadxWHaAo7LTOCq70CxrU3ZAo7IDHJUd4KjsCAc7XtDnVoFOj5pqKFwru6BVI3xwbKZVgx6dNo0ARxJBm0b0Aa6pxurMT9Pw0E_j8NQPcHTsp3FYds2yVmWnaVh2Godlp3FYdoCjHU-fZSX42CV9li3gWtkleEUGR2FJqwY8uqRNIztgcdo0EpxKpKYam7IDGpUd4KjsCAdlBzh8ydcsa_WWT9PwNZ_G4Xs-jcMXfYCjHU-fZSX63OizbAHXy06rxgdHYZ9WTfHRn95_-i8AAP__7rUCXg== @@ -741,12 +741,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lkFv2jAYhu_7FdZ3aiWjYCfQEmkSXcs0JFY64NBpyiElXkGiSRYHqWnFf58SprUE8BfPw7fS5LFff36kvK8gf63Ah8H93ehqeEvObobT2fTb6JycTQejwfWMFOTzZPyVPBcvZDy5GUzIp--kOCeD--vB3YxcjUbIm0AhTiJxGz4JCf4PYECBAwUXKHhAoQMBhTRL5kLKJCtfea2AYfQMfpvCMk7XefnvgMI8yQT4r5Av85UAH2bhw0pMRBiJzGkDhUjk4XJVbfNcvPTTbPkUZgVQmKZhLH3Scsqdx-vcJ30OwYZCss7_LP-26kNBFqFc7K7XZxBsAgoyDx8F-GxD_y1mx2pMfjTm2zrrOMkikYloZ6WgJLFXDpz1SygXU5GPU4fVbmRWpMJ_5w1QWImf-VmfnX_Mlo-L6q-_52a1c7-dyTU404HAt0krSR3WqZ_-4N7ezt6s-bWzBtfu8JbjnsRPjaBdy0H50aAWDGU2DOXNh8-bDN9tOd5JLNEIemE5KD8a1IIl3IYlbvPhu02G77WqT83_t0Qj6KXloPxoUAuWuDYs8ZoP32sy_E7rJI5oxOxZjcmPxrRgiGe7Dx2IMxEyTWIpGrWddnkgET2K7YBkss7m4i5L5tU225_jiqu-3JGQ-fYp3_4YxttHZcDmcNcE7pnAzCg366hppjEyrgd3TeCeCcyMctdGtkfzOt1-T7vqebtKmO3OrF2nPRPB1TAiuBpGBFfDmOAIjQjeMRFcDSOCq2FEcDWMCY7QiOBdE8EvTBRVw4iiahhRVA1jiiI0ouiliaJqGFFUDSOKqmFMUYRGFO2ZKMqMegJCI5IiNGIpQmOaYjjWFczKgllbMKsLhn3BrDAwo8bA9iqDlq1qGrNVTWO2qmnUVgTHbNUpS_t3ptOWdGnMVq2-pI1jtu6VB6WtwebD7wAAAP__fn1wWA== @@ -761,12 +761,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mNFu4kYUhu_7FNa5SiQjMzM2EEuVst1QNRINKXCxVZULL54mSCx2bSOFjfLuFUatN3Z8fk9sc7cBPs8_Z-c7nOGF0n-25NP0y_3s0-2ddXFzu1wt_5hdWhfL6Wz6eWUdrF8X89-t58N3a764mS6sX_60DpfW9Mvn6f0KfIps2kWhvgu-6ZT8v0iQTZJsUmSTSzZ59GBTnERrnaZRcvzISw7chs_kD23a7OJ9dnz5waZ1lGjyXyjbZFtNPq2Cr1u90EGoE2dINoU6CzbbfJnnw_frONl8C5ID2bSMg13qWwPnuPJ8n_nWtaSHV5uifVY8Ps2CR02-eLU_FsHrLII0iXCzSbPNbp05olSDa1FaoGC-HqynIH165_NFCPWxEF6nIdzaEMVz9rsoCXWiwzdPyp9SG1OiWhURvL4ioEoVEUYtItgfSvlbkD4tdTaPHVWq1OoQa_8_9z_NZmTTVv-dXVyLy5-TzeNT_q__z3j9nsbdlvUuGkSxo7zy7t9de_JmbdFccdFAcUcOHGXcZwxCjDoMIU1CFJKLHjtN4xCjHjuN6E5zVKu6TtNhBFSpuk5jFqF1pxHn6DSyuWiyiWhq4LjGthuEGHcYQpqEKESTPdreOMS4R9tld6qhWtXZ3mEEVKk6280itLZdnsN21Vw01UQ0d5CP-Wa2G4SYdBhCmoQoRFM92t44xKRH21V3qqFa1dneYQRUqTrbzSK0tl2dw3a3uWhuE9G8gbHrBhGuOosgTSIUkrk9mt44xFWPprvdaYZqVWd6hxFQpepMN4vQ2nT33L8XvBNnodM42qW60a8Bw-OGdPioTwVKo32y1vdJtM6XOf05z7n8hVCn2eldefrjdnd66xjwR1iwsOJhWYbFj7D7BhZmsJCt6Ks2tBy1oZXiacXSXhtYtFpaDlvR4za0AofFZY8p-P_yDGBZhkcsDDY95u0a8XpNWFoMefqKpwXoC5WuYuI2oJHcCAd2AxzpDXDkt6i0VBPBAY0MBzhSHOHguAMcSS4qjfXtkUV4pcVweEV0wfcYtHW-yYgx0I1vM2IC8EqjMbKVp6GtAEe28ji0lcehrZUma2QrT0NbeRzaCnB0ZHkc2sp_wUgBhigwtgreVskPrmDrku800gVzL99ppAfwSqcxmpt5Gg7OAEeTM4_D0ZnHka2y0mVNbAU0shXgyFaEoyPL48hWyX_ByAnA-Um2hFdt5UdZtHW-0ygwyiq-0yhwQ1b8UAPqDmhkK8KBrQBHtgIc3nT5izK66oIrfrvF4WUX4Oi2C34jQKeG_4JRqHT8KFvCK7YqfpYtb_3h9ad_AwAA__--BQGd @@ -788,7 +788,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -796,7 +796,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmF1v2kgUhu_3V4zOVaI1MjNjvixVSrelKhIbsoC0Xe1y4cJsgkQxaxsJGuW_rwwNCZjO62OIuSsfz8zp6_OcGfJI8X8z8qn95a77vnMrrj52BsPBH91rcTVod9sfhmIlPvV7v4vV-rv483O73xYr8c-yWtVjoa5F-8uH9t1QvO924ffNuxTo9T-2--K3v8SKHJqHE3MbfDMx-X-TJIcUOaTJIY8cqtHIoUUUjk0ch1H6lccN0JmsyK86NJ0vlkn69sihcRgZ8h8pmSYzQz4Ng68z0zfBxERulRyamCSYzjbbrNbfbxbR9FsQrcmhwSKYx76ouOnOvWXiixtJoyeHwmXysnycBPeGfPnk5C_h03SWmMhEbm1__-376T67GH3f79wOmwf7viz1dS0egvhhf51NnS-1KU5tr-OR58tHF8pHgoDSvjlHQt5Pq3tZZzkPo4mJzGRvpVFKoq8c-S9-DuKHgUl6C1cdhDxcL4z_Sh5yaGb-Ta5u5PW7aHr_sPlXjsRrnMQHYZSYyFW1w5h-_en69RyZHYvjx6JHirgNK-HC1dXDgI9u39jbXjKaOkdPu6riarb1oIhdV9cvYD0noHMmpAslJEFEb-O9LNd7WYb3IPFn7-tFvVf5-0rlaStdcT22eKCIXVs1LiAeIyB5zoR0oYQkiOhtxFPliqfKEA8k_ixeo6h4On9f6Txt5VU2t1GeeKCIXVs1LyAeIyB5zoR0oYQkiOhtxNPliqfLEA8k_ixes6h4Xv6-8vK0Va3C1g6UsGuq1gW0Y8Qjz5ePLpSPBAG9jXReudJ5ZUgHEn-WrnWOn5dH1u-beBHOY5Prl2M1DcxM7s32AcThMhqbuygcb7bZvuxtuM0bExMn20_l9kVnvv0oLfA1LA9h-Rr29mDJg6U8iW6cQit9Et2y08qauLYnrhmJKx58kDiXbpxCHyTOpVt22rMmXrMnXrPCdfuzrtufNdCrYaWbdrh5ipt2GLkJaOCmnUZuAhq42bJPwyoYh5lhyrET0EhPhAM_AY4ERTgwVGZG6n7wCgRvn6lAUpmZLvube2DzzHhhnYJ2Gh6DAEfnoB2HByHAgW3SPltlHQSfma4s3ew01A3gSDc7DnUDONLNfrJIcLTIzJBl6WYfsgoMWcUZstnLF2vIsnGgG8CRbghHF0_7kFVgyKrMkOXoBmikG8KBbgBHuiEc6KbsB4wCB4yy31-Bbso-ZBUYsoozZLObs4YsG0e6sYYsG0e62YesAkNWcS7w2ZZj3eDZONKNdYdn40g3-wGjwQGj7X8SOdRt9PTL_wEAAP__Gz3Neg== @@ -817,7 +817,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -825,7 +825,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy82F9v4kYUBfD3fgprnhLVyMwfE7C0UrYbVotEQwpI3arNAwvTBInF1DYSbJTvXgELDn98j4cZ8rYhHM-5d81PxC8s_W_CItb8-tD-2Lr3ru5avX7vj_a1d9Vrtpuf-t7C-9zt_O4tlj-8P780u01v4f0zr1bl0BPXXvPrp-ZDH75Xf1i9udO9a3a93_7yFsxn03ik7wffdcqivxlnPhPMZ5L5TDGfhezRZ7MkHuo0jZPVW17WgdZowaKqz8bT2Txbvfzos2GcaBa9sGycTTSLWH_wbaK7ejDSSVBlPhvpbDCerI9ZLH_czpLx90GyZD7rzQbTNPIqwerkzjyLvFvOHl99Fs-z_PJpNnjSLOKvfvkKn8eTTCc6CcL98zevr87ZrTCKotZ9v154rjA59-3o3N3s8qzZORh-dU-g6ZXJyXfjNBtPh1kgDkY_Gi3PfFt6z4P0-cT78xLheSVCpyVqhSXy68yncTLSiR7tXWl9lcKaEu0qr3BzqQpoU3mFukUF_6yWXwbpc09nnVmgDjbVX850tAXwY7vNfDbR_2ZXt_z6QzJ-el7_q8Snq2Fye_XiJNNJoI5W9muxXNUSSzu1j59XPdHiPq7EsyCsHm749Pn7dHIDwkoIFohKII39BiV2htUc-20yvMvp5VnTczC-ueDg5BxPfkHBS5eoXVBw7o5PtKsiwR1WQJsqEtysgrXg_D0EB7fXVvCjlZUWXJRHRJQxRFYCZSwoKLEz5MaxoAbDc5fTy7Om52B8c0HByTle4oKCli5xc0FBhTu-0K6KBHVYAW2qSFCzCtaCivcQFNxeW0GPVlZaUFkeEVnGEFVZ_6VvJigosTOk7lhQg-G5y-nlWdNzML65oODkHC95QUFLl6hfUFDpji-0qyJBHVZAmyoS1KyCtaDyPQQFt9dW0KOVlRZUlUdElTEkrBj7CSrsBGk49tNgdO5udnnW7BwMb64nODmHS11Qz9IlGhfUU7mjC-2qSE-HFdCmivQ0q2Ctp3oPPcHttdXzaGVnPYM9cUBXp7N4mupSj1erq43p0ZPe_A-k8TwZ6ockHq6P2fzYWefWL4x0mm1-yzc_tKabX60Kvg1zMqzosCDDkg5LMhzSYXUY5m_Dtb0wNwvzG5u0sEpLq7QC6ZBMW4V53SYtrNLSKq1AukbepiB8YxAWh-E6GW7QH5AGjUKV7s1pU0KECq0KFyBOu8KBDZyWhQPU-NGHbD9eA3H6dgM0gTSyCcQRTiCOdAJxxBM_-qiZ-ATSCCgQR0KBOCIKxJFRnHaGN0CcluYgfuQUp60RVfAlAnx_AVQJ2hoBrBG0NQJYI2hrBPoCRVsjgDXCyhqQRtaAOLIGxJE1II6sEVbWgDSyBsSRNSCOrAFxZI2grRHAGkFbI4A1grZGAmuknTWStkYCayT4ewlYI2lrJLBG0tZIYI20sgakkTUgjqwBcWQNiCNrpJU1II2sAXFkDYgja0AcWSNpaySwRtLWSGCNpK1RwBplZ40CT2aANYq2RqHnK7Q1ClijaGsUsEZZWQPS8PmOnTUgDp_w2FmjrKwBaWQNiCNrQBxZA-LIGkVbo4A1irZGAWsUbU0IrAkNrXl8_eX_AAAA___oPFwV @@ -847,7 +847,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -855,7 +855,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmF1v4kYYhe_7K0bvVaIamZkxX5ZWYrvLapFoSAGpW7VcePE0QWKxaxspJMp_rwwbCDaZ4zHE3G0Ij-fdwzxnhjxR_N-CXOp9ux187N-wq8_98WT8x-CaXY17g96nCVuzL6Ph7-xh_cj-_Nob9dgD-2dVr0v1gfFr1vv2qXc7YR8HAwjMmLxmw9Hn3oj99hdbk0XLwFc33g8Vk_s3cbJIkEWSLHLIogZNLQqjYKbiOIjStzxtgL7_QG7dovkyXCXpy1OLZkGkyH2iZJ4sFLk08b4v1Eh5vorsOlnkq8SbLzbLPKwfu2E0_-FF6QTj0FvGLqvZ6crDVeKyLre6gqbPFgWrZL9CnHh3ilz-bBWf4st8kahIRXbjcITt6-lS-yRd1-3fTNq7KbIj7J_6fc3uvfj-8JFdTtPn_ZjCZMzXYfGzpiVLpcVBXDMmz5uW8-aY--eslkHkq0j5B0-apiR6y5H_61cvvh-rZBjaIhP4ZB0q95VVZNFC_Ztcdfn1h2h-d7_51z79N6NvmEQ_DqJERbZoZGP69c3nNwtkdiyOnw89MsRNUAtCW9azAR9dvnWwPDfY4AX2ty1qtizTB2CO3Q5vXrYPTOI6c16yVF4cBPbOjcCrbQReRSOA6F8aoVm2EUTxPSaKbDFZs50ySoI5dlusdVklDeLiZ85LlsqLg8DeWUlRrZKiCiVB9C9KtsoqKYvvMVlkizm1zcXWWEkwx26LtS-rpEFc_Mx5yVJ5cRDYOyspq1VSVqEkiP5FyXZZJZ3ie8wpssUatTJCgil2G6xzWSENwuJnTUuWSouDuN5ZR6daHZ0qdATRv-jYOcfX2CPPH6k4DJaxKvQNtZ4Gpvw7tf0A4mAVzdRtFMw2y2x_HG64zQu-ipPtb_n2h_5y-6t0wNcwz8L8NewcwNwM5vwkunUKLeRJdEdPC23iUp-4NEhcmMGZxE3p1il0JnFTuqOnHW3iDX3iDS3c1H_WTf1nDfRqaem2Hm6f4qYeRm4CGripp5GbgAZudvRtWAd1mCtTEzsBjfREOPAT4EhQhANDea5SD4MXIHh9pwJJea5dDhd3wOK5ejE6BfU0PAYBjs5BPQ4PQoAD27i-W3kTBJ9rVyPd9DTUDeBINz0OdQM40k1_snBwtPBcyRrppi9ZAUpWmJRs_vJlVLLGONAN4Eg3hKOLp75kBShZkStZE90AjXRDONAN4Eg3hAPdhP6AEeCAEfr7K9BN6EtWgJIVJiWbX9yoZI1xpJtRyRrjSDd9yQpQssLkAp_fckY3eGMc6WZ0hzfGkW76A0aCA0bq_ySS1W36_Mv_AQAA__9SNOwx @@ -876,7 +876,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • filter @@ -884,7 +884,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy82N9v2lYcBfD3_RXWfUo0I3N_mIClSnQNVZFYyABpnbY8ULhLkChmtpFCo_zvE1Bw-OHvufa189YQDvf01P6I-oXF_81ZwDpf73sfu3fO1W13OBr-0bt2roadXufTyFk7nwf9353n9Q_nzy-dQcd5dv5Z1etSf3D4tdP5-qlzP4Jvnjjy2ukPbjsD57e_nDVz2SKc6rvxdx2z4G_GmcsEc5lkLlPMZT57cNkyCic6jsNo85aXbaA7fWZB3WWzxXKVbF5-cNkkjDQLXlgyS-aaBWw0_jbXAz2e6sirM5dNdTKezbfHPK9_tJfR7Ps42jQYLseLOHBq3ubk_ioJnDZ324I9vLosXCXpCXEyftQs4K-ueYvPs3miIx15_nGF3eubo9IVgyDo3o2ahxbZFUSeCm-H4KUuIQstwcEUE0eaL6HyVLidxclsMUk8cTJDm58ckGa-rZ2ncfx04f1pCb9YCb_UEo3MEunnrBZhNNWRnh590vZTMmtKtFVa4aaqCmiptELTooJbqOWXcfw01El_6amTpUbrpQ72Mn7s9ZjL5vrf5KrNrz9Es8en7Z_SOy3z79TKc3kNwyjRkafOJvs1G7S6wWiX9vj5qRda3IW1cOn59dOFL59_LCrPwZmBZp6oebKI7KDHwbNGdbLnmaLkLWShLTgYw8J2UCFllVdou3GJRoW28_JgRVtl2V5iBbRUlu35Kljbzt_DdnB57W0_m8zYdmEOijDxRNY8VcRW0OPgyU11tuaYgpe8hSy0BQdjWNgKKqSsiQptNS5xU6GtojzY0FZZtpZYAS2VZWu-Cta2ivewFVxee1vPJjO2VZqDIk08UbXtQ4PctoIeB0-a1dmaYwpe8hay0BYcjGFhK6iQsiYrtNW4RLNCW2V5sKGtsmwtsQJaKsvWfBWsbZXvYSu4vPa2nk1mbKsyB0WZeOLXisgKWhw0aVUna44heKlLyEJLcDCFhaugQkqaqtBV4xKtCl1V5aGGtspytcQKaKksV_NVsHZVvYer4PLau3o2WaFnvRcOGOh4GS5ibfQYt75ZTE8f9e5fIA5X0UTfR-Fke8zux_42t31hquNk91u--6G72P1qU_BtmJNhRYcFGZZ0WJJhnw6r0zB_G24chXm-ML-xSQurtLRKK5D2ybRVmDdt0sIqLa3SCqQb5GUKwjc5wuI03CTDLfoGadEo1OnenDbFR6jQqnAB4rQrHNjAaVk4QI2f3WTH8QaI05cboAmkkU0gjnACcaQTiCOe-NmtlscnkEZAgTgSCsQRUSCOjOK0M7wF4rQ0J_EzpzhtjaiDLxHg-wugStDWCGCNoK0RwBpBWyPQFyjaGgGsEVbWgDSyBsSRNSCOrAFxZI2wsgakkTUgjqwBcWQNiCNrBG2NANYI2hoBrBG0NRJYI-2skbQ1Elgjwf-XgDWStkYCayRtjQTWSCtrQBpZA-LIGhBH1oA4skZaWQPSyBoQR9aAOLIGxJE1krZGAmskbY0E1kjaGgWsUXbWKPBkBlijaGsUer5CW6OANYq2RgFrlJU1IA2f79hZA-LwCY-dNcrKGpBG1oA4sgbEkTUgjqxRtDUKWKNoaxSwRtHW-MAaP6c1D6-__B8AAP__bm96zA== @@ -900,12 +900,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEll1v2jAUhu_3K6xz1UqOgp2ElkiTqDqmIbHSFS4qTblIiVeQaJLFQSKt-O9TwhjlYz7xDNllah77tc8j9X0D-XMOPvQe7wc3_Tty8ak_Go--DS7JqDfo3Y7JkpKCfH4YfiXL4pX0Hm9792NyMxhs1gtKln_WgUKcROIufBES_O_AgAIHCg5QcIGCBwGFNEsmQsokK3_yVgH9aAl-i8IsThd5-eeAwiTJBPhvkM_yuQAfxuHTXDyIMBKZ3QIKkcjD2bw6Zlm8dtNs9hJmBVAYpWEsfWLZ5cnDRe6TLqNdDsGKQrLIf5-w3fipINNQTne33CABBZmHzwJ8tqL_FtbTDMtpl5mG5X8Nu91qESdZJDIR7WwWlCT2kyM3_hLK6Ujkw9Rme9MZF6nw35kDFObiR35Rpb78mM2ep5sP1cC2l3MMLnck-V1iJanNvP1nOHq2u3M2q28Bq2GBzS3bOaO0GnHb2nFPry1rVlvWqLa8_ix4nVk4lu2eUR2NuFfacU-vDm9WHd6oOk79WTh1ZuFa1f-oc6mjEfdaO-7p1XGaVcdpVB23_izcOrPwrDOKoxG2oxn29Nq4zWrj_reOdSTXg5BpEktRq0G1ypuJ6FmsX0omi2wi7rNkUh2z_hxWXNUAIiHz9Spff_Tj9VIZsD7cNoE7JjAzys08Nc00nozrwW0TuGMCM6Pce092QPN9uvWedtTv7ShhtvtmrX3aNRFcDSOCq2FEcDWMCY7QiOCeieBqGBFcDSOCq2FMcIRGBG-bCH5loqgaRhRVw4iiahhTFKERRa9NFFXDiKJqGFFUDWOKIjSiaMdEUWbUExAakRShEUsRGtMUw7GuYFYWzNqCWV0w7AtmhYEZNQZ2UBm0bFXTmK1qGrNVTaO2Ijhmq05ZOpyZTlvSpTFbtfqSNo7ZelAelLYGqw-_AgAA__-poYDu @@ -920,12 +920,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmFFv4kYUhd_7K6z7tCsNgpmxgViqlNUuVSPRJA08rFTlwQvTBInF1DYSbJT_XmGUemPH98xgO30k7MecuevzMcMTpf-sKaTJ19vpp6tr78OXq9l89uf0ozebTCef595eeAfvt7ubP7z94Yc3-fp5cjt_ee8gvP1_75GgTbw019F3k1L4F0kSpEiQJkE-CQroXtA2iRcmTePk-E-ecuBquadwIGi12e6y45_vBS3ixFD4RNkqWxsKaR59W5s7Ey1N0h-QoKXJotU6X2Z_-HG5TVbfo-RAgmbbaJOGXq9_XPlml4XepRSXiu6fBcW7rFghzaIHQ6F8FuelCBxTKHEpa1MolxRfVmm22iyyvixN4q2dFti3g_cYpY9vI0UUfV6UoIMofm2U4qN2mzhZmsQsX31Y_im1YZXF3IoUQVcpLEZWpBg2SCHOCvp7lD7OTHaz7evSvOaHrQlfTPBpOiVBa_N39iHfwcdfk9XD48sLuxKO2h3xddyLt30dlMfw5trjV2tLewFICwH0Va-vzxGRQ46hcw4HFYEcRf9l5yqyjjLsXEWyPQlYzK1ORS2msBhZnYrcUjRWkXxXFSn7GiqbGupe3z9HBw45Rs45HHQAchQdVJ3rwDrKqHMdqPaKaDG3Oh20mMJiZHU6cEvRWAfqXXWg7WuobWro9_JrhLMOHHKMnXM46ADkKDqoO9eBdZRx5zrQ7RXRYm51OmgxhcXI6nTglqKxDvS76sC3r6FvU8Ogd44MHFJcOKZwUAFIUfTP71wF1lEuOleB314JLeZWp4IWU1iMrE4Fbikaq8D_336zeCPXnUm38SY1Vr9IDI47M8sHc5pUGu-ShblN4kW-zOnlTc7lf1iaNDu9q04vrjant44Bf4YlC2seVmVY_gz7r2DpBkvViL5oQqthE1prntYsHTSBZaOl1aARPWpCa_Cw-OxjCv6_AgdYleEhC4NNj_h2Dfl6jVlaDnj6gqcl8ELFKi7dBjQqN8JBuwGO6g1w1G9ZUapLwQGNGg5wVHGEg8cd4KjksiLW148swiuK4fBK0SXvGLR1XjJyBOrGa0aOAV4RjVNbeRq2FeCorTwO28rjsK0VyTq1ladhW3kcthXg6JHlcdhW_gtGSXCIAsdWybdV8QdXsHXFm0b54NzLm0YFAK-YxunczNPw4AxwdHLmcXh05nHUVlWxrEtbAY3aCnDUVoSjR5bHUVsV_wWjxgDnT7IlvNpW_iiLts6bRoOjrOZNo8ENWfOHGjB3QKO2Ihy0FeCorQCHN13-ooyuuuCK32xxeNkFOLrtgt8I0FPDf8FoNDr-KFvCK23V_Fm2vPX751_-DQAA__-aVB6L @@ -944,12 +944,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lk9v2koQwO_vU6zmFPQW2bu2-WPpSclLqIpEQ4o5pKo4OHgbkAh210bCifLdK0woMSY7Xkx8g7C_2fHMbzJ-gfj3Alzo3d8Nrvq35OKm742974MGufB6g971mKzJl9HwG1mnz2Q4uumNyP8_SNogvfvr3t2YXA0Gf0-m5Mo7evy5sf-8BgrLMBC3_pOIwf0JDChwoGABBRsoODChEMlwKuI4lJsjLxnQD9bgmhTmy2iVbP48oTANpQD3BZJ5shDgwth_WIiR8AMhDRMoBCLx54vsmnX6fBnJ-ZMvU6DgRf4ydknT2Nw8XCUuuWQweaUQrpK38PuoDymZ-fEsHy87P6EQJ_6jAJe90tPSdDTT5JXS5B-muY-zWoYyEFIEuUiTDYkdOfKsX_145olkGBnsoCPjNBLuO4-AwkL8Si4uWeM_OX-cZZ8-bM_-mSyd0nuhTIQ0mHNYpn8_jG-XqNmxcrwFPZLEbdgMI4ObhwU-er2Tu56VN4uVMMvgTcP6lBHQSLSlneg5h4DVOwSsjiFAir8bgtapQ8DLN5eXaa7VNOxPsVAj0bZ2oue0kNdrIa_DQqT4Owvbp1polW-uVaa5djPbxue3UCPRjnai57TQqtdCqw4LkeLvLOycaqFdvrl2meY6zU9xUCPNrmaa5zTQrtdAuw4DkdLvDOye45X0SPyRiKNwGYtSb5vmpmAieBTbBsThSk7FnQyn2TXbr8OMy94yAhEn21_59kt_uf1pk2B5uF0FZqwS7VSiu2qaadSM68HtKvBBzXRppxLdVdP8kDbf01YONg9hSwnb6m7ZSpgz9dVOlflQw8h8qGFsPhAamQ-ERuajVWU-1DAyH2oYmw-ERuYDoZH5aCst7agl7VSZj24Vw9UwYrgaxgxHaMRwhMY2gM7aLP4n1dmbujS6BLQ2pzaOaM4KWySnKuNq0Zl6jSCms8Ie0VEdoRHXERqTHcMR2zEc072wQ7V0V9OY7moa1R3BMd0RHNO9sEjzurcQ3Qs7RUv3wk7R0l1NY7qraVR3BMd0R3BM98I-1dJdTWO6q2lUdwTHdEdwTPfCVs2_a5tq3Xlhtyh1n7z-8ycAAP___hN5LQ== @@ -967,12 +967,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mE1v6kYYhff9FdasEtXIzIz5slQp6Q1VI9GQAotbVVn4wjRB4mJqGwkS5b9XmHKdePB7ZmI7u3z48Ry_zHk05oUl_65YwIZf70fXt3fOxc3tdDb9c3TpXEyHo-GXmbNzfpuM_3B2-2dnPLkZTpxf_3L2l87w65fh_ezHVXvnenr20ufL_Ocdc9k6Wqi78LtKWPA348xlgrlMMpf5zGUd9uCyTRzNVZJE8eGSlwy4XexY0HbZcr3Zpoc_P7hsHsWKBS8sXaYrxQI2C7-t1ESFCxV7beayhUrD5SpbZrd_vtrEy-9hvGcum27CdRI4Le-w8nibBs4VZw-vLou2aX77JA0fFQv4q_uxCB3LCKI0grCJcLNM0uV6nnq8MAPtGXPm2955CpOnM9fnIeTHQnRqDeGXhsjvs11H8ULFavHuTtldSmMKNKs8QqepCGhSeYRuhQjuh1L-HiZPU5WON54sTGq236jg5ILr0Yi5bKX-SS-u-OUv8fLxKfvJoGY9m-01jeJUxZ7URvZz6f37BjM7N47_b3omxF3Uijae3y4O-Ozyg3fLc3OLcAOLeKLlSWuVWYToWocwlRkIkXuENygz4xDdBmXG6zMJmlWZzGqMgCZVJjO7CJVlxj9DZmB7nWSmjcxUZsK8yMKkyLLl-dY2sQjRsw5hahMQIi-yaNAmxiF6DdpE1FdlNKsym9QYAU2qzCZ2ESrbRHyGTcD2OtlEG5mpTaR5kaVJkf1W9iZkZxOLEH3rEKY2ASHyIssGbWIcot-gTWR9VUazKrNJjRHQpMpsYhehsk3kZ9gEbK-TTbSRmdrENy-yb1LkTsvaJRYRBpYRTE0CIuQl9hs0iXGIQYMm8eurMZpVmUlqjIAmVWYSuwiVTeJ_hknA9jqZRBvZR76yOXP_iUo20TpRRt_GtA8DU4tHdfwAkmgbz9V9HM2zZY6_jjMu-8NCJenxv-L4y-36-K9DwLcwJ2FJw6II87ew_w7mdjCXVWjBK9GDKrTs0bQk6U4VmIOR07QQVWjZrkT3adont2mXhjsWsCjCXRLu0QXpkTB45j4J-5xeekDSHNCclgpHVtG0YmMGQCM1ABy5AeFADgBHduC0XIAeAI38AHAkCIAjQyAc1IVrhnm_ZdHoaMUUcE0TnJYM74LC0JpBj057hg_A4rRpRBvgmmqsyk7TsOw0DssOcFR2GkdlF5plbcoOaFR2gKOyAxyVHeFgxwv63CrQ6VFTDYVrZRe0aoQPjs20atCj06YR4EgiaNOIPsA11Vid-WkaHvppHJ76AY6O_TQOy65Z1qrsNA3LTuOw7DQOyw5wtOPps6wEH7ukz7IFXCu7BK_I4CgsadWAR5e0aWQHLE6bRoJTidRUY1N2QKOyAxyVHeGg7ACHL_maZa3e8mkavubTOHzPp3H4og9wtOPps6xEnxt9li3getlp1fjgKOzTqik--sPrT_8FAAD__xTXCD0= @@ -991,12 +991,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8ll9v2jwUh-_fT2Gdq6LXKNhJ-BNpUruWaUisdMBFp4mLlHgFiZLMCRK06nefCEU0hPjEpPVd0-Sxfzl-DicvEP9dgAfd-7v-Ve-WXNz0RuPRz36NXIy6_e71mKzJt-HgB1lvnslgeNMdkq-_yKZGuvfX3bsxuer31U9S8lw7XK6BwjIMxK3_JGLwfgMDChwo2EDBAQouTChEMpyKOA7l9pGXFOgFa_AaFObLaJVs_z2hMA2lAO8FknmyEODB2H9YiKHwAyGtBlAIROLPF-k2683zZSTnT77cAIVR5C9jj9St7c6DVeKRSwaTVwrhKnlb_rDqw4bM_HiWXS99fkIhTvxHAR57pefFdI3G5IUxD-uslqEMhBRBZqXJlsQeOfGu3_14NhLJILLY0YmMN5Hw3lkEFBbiT3JxyWpf5Pxxlv5V-N6Hd7J1Sj8KZSKkxdzjMv1fuL5TomanyvG26IkQt2E9jCzeOC7wye3dzPasvFmshFkWr1v2p7SARtCm4aC8MKiBJmAmmgAp_r4Jmuc2AS9_uLzM4dp1y_kUCzWCtgwH5YVBDVjITViIFH9vYetcC-3yh2uXOVynnk7jj7dQI2jbcFBeGNSAhbYJC5Hi7y1sn2uhU_5wnTKH69Y_xUGNmB2jMXlhTAMGOiYMREq_N7DzEZ-kJ9YfijgKl7Eo9bXZ2BZMBI9idwBxuJJTcSfDabrN7nKQculXRiDiZHeX7y56y92tbcDycKsKzFgl2q1Ed9Q006gZ14NbVeCjmunSbiW6o6b5Md14T9sZuHEM20rYUZ-Wo4Q5U2_tVukPNYz0hxrG-gOhkf5AaKQ_mlX6Qw0j_aGGsf5AaKQ_EBrpj5bS0rZa0naV_uhUMVwNI4arYcxwhEYMR2hsAuiMzfwvqc7c1KXRIaA1ObVxRHOWmyIZVRlXi87UYwQxneXmiI7qCI24jtCY7BiO2I7hmO65Gaqlu5rGdFfTqO4IjumO4JjuuUGa1b2J6J6bKVq652aKlu5qGtNdTaO6IzimO4JjuufmqZbuahrTXU2juiM4pjuCY7rnpmr2W7uh1p3nZotS98nrf_8CAAD__zWpeKA= @@ -1014,12 +1014,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: xyz@primary + │ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mF9v6jYYxu_3KSJftVpQsB3-RZrUs1OmVWKlAy7ONPUiB7wWiUNYEiRo1e8-EYbSxuR97CbhrhR-8ZMXPz85vLLk3xUL2PDbw-jL3b1zdXs3nU3_HF07V9PhaPh15uyc3ybjP5zd_sUZT26HE-fXv5z9tTP89nX4MKM_5Tov1_nLHXPZOlqo-_CHSljwN-PMZYK5TDKX-cxlHfbosk0czVWSRPHhI68ZcLfYsaDtsuV6s00P_3502TyKFQteWbpMV4oFbBZ-X6mJChcq9trMZQuVhstVtsxu_3KziZc_wnjPXDbdhOskcFreYeXxNg2cG84e31wWbdP88kkaPikW8Df3cxE6tUUQNhFul0m6XM9TjxdmoC2QM9_3znOYPJ_5fB5Cfi5Ep9YQfmmI_DrbdRQvVKwWH66UXaU0pkCzyiN0moqAJpVH6FaI4H4q5e9h8jxV6XjjycKkZvuNCk4m-DIaMZet1D_p1Q2__iVePj1nfxns8Z7N9ppGcapiT2oj-7n0-n2DmZ0bx_8XPRPiPmpFG89vFwd8dvnBh-W5uUW4gUU80fKktcosQnRrDCFsQuQe4Q3KzDhEt0GZ8fpMgmZVJrMaI6BJlcnMLkJlmfFLyAxsr5PMtJGZykyYF1mYFFm2PN_aJhYhejWGEDYh8iKLBm1iHKLXoE1EfVVGsyqzSY0R0KTKbGIXobJNxCVsArbXySbayExtIs2LLE2K7LeyJyE7m1iE6NcYQtiEyIssG7SJcYh-gzaR9VUZzarMJjVGQJMqs4ldhMo2kZewCdheJ5toIzO1iW9eZN-kyJ2WtUssIgxqiyBsIuQl9hs0iXGIQYMm8eurMZpVmUlqjIAmVWYSuwiVTeJfwiRge51Moo3sMz_ZnLn-RCWbaJ0oo19j2oeBqcWTOn4BSbSN5-ohjubZMseX44zL_rFQSXp8Vxxf3K2Pbx0Cvoc5CUsaFkWYv4f9DzC3g7msQgteiR5UoWWPpiVJd6rAHIycpoWoQst2JbpP0z65Tbs03LGARRHuknCPLkiPhME990nY5_TSA5LmgOa0VDiyiqYVGzMAGqkB4MgNCAdyADiyA6flAvQAaOQHgCNBABwZAuGgLlwzzMcti0ZHK6aAa5rgtGR4FxSG1gy6ddozfAAWp00j2gDXVGNVdpqGZadxWHaAo7LTOCq70CxrU3ZAo7IDHJUd4KjsCAc7XtDnVoFOj5pqKFwru6BVI3xwbKZVg26dNo0ARxJBm0b0Aa6pxurMT9Pw0E_j8NQPcHTsp3FYds2yVmWnaVh2Godlp3FYdoCjHU-fZSX42iV9li3gWtkleEQGR2FJqwbcuqRNIztgcdo0EpxKpKYam7IDGpUd4KjsCAdlBzh8yNcsa_WUT9PwMZ_G4XM-jcMHfYCjHU-fZSX63uizbAHXy06rxgdHYZ9WTfHWH99--i8AAP__trkHsA== @@ -1035,12 +1035,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lkFv2jAYhu_7FdZ3aiWjYCfQEmkSXcs0JFY64NBpyiElXkGiSRYHqWnFf58SprUE8BfPw7fS5LFff36kvK8gf63Ah8H93ehqeEvObobT2fTb6JycTQejwfWMFOTzZPyVPBcvZDy5GUzIp-_k5ZwM7q8HdzNyNRohbwKFOInEbfgkJPg_gAEFDhRcoOABhQ4EFNIsmQspk6x85bUChtEz-G0Kyzhd5-W_AwrzJBPgv0K-zFcCfJiFDysxEWEkMqcNFCKRh8tVtc1z8dJPs-VTmBVAYZqGsfRJyyl3Hq9zn_Q5BBsKyTr_s_zbqg8FWYRysbten0GwCSjIPHwU4LMN_beYHasx-dGYb-us4ySLRCainZWCksReOXDWL6FcTEU-Th1Wu5FZkQr_nTdAYSV-5md9dv4xWz4uqr_-npvVzv12JtfgTAcC3yatJHVYp376g3t7O3uz5tfOGly7w1uOexI_NYJ2LQflR4NaMJTZMJQ3Hz5vMny35XgnsUQj6IXloPxoUAuWcBuWuM2H7zYZvteqPjX_3xKNoJeWg_KjQS1Y4tqwxGs-fK_J8DutkziiEbNnNSY_GtOCIZ7tPnQgzkTINImlaNR22uWBRPQotgOSyTqbi7ssmVfbbH-OK676ckdC5tunfPtjGG8flQGbw10TuGcCM6PcrKOmmcbIuB7cNYF7JjAzyl0b2R7N63T7Pe2q5-0qYbY7s3ad9kwEV8OI4GoYEVwNY4IjNCJ4x0RwNYwIroYRwdUwJjhCI4J3TQS_MFFUDSOKqmFEUTWMKYrQiKKXJoqqYURRNYwoqoYxRREaUbRnoigz6gkIjUiK0IilCI1piuFYVzArC2ZtwawuGPYFs8LAjBoD26sMWraqacxWNY3ZqqZRWxEcs1WnLO3fmU5b0qUxW7X6kjaO2bpXHpS2BpsPvwMAAP__sUVwWg== @@ -1055,12 +1055,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8mNFu4kYUhu_7FNa5SiQjMzM2EEuVst1QNRINKXCxVZULL54mSCx2bSOFRHn3CqPWiR2f3xPbudsAn-efs_MdzvBM6T9b8mn67Xb25frGOru6Xq6Wf8zOrbPldDb9urIO1q-L-e_W4-HJmi-upgvrlz-tp3Nr-u3r9HYFPkU27aJQ3wQ_dEr-XyTIJkk2KbLJJZs8urMpTqK1TtMoOX7kOQeuw0fyhzZtdvE-O758Z9M6SjT5z5Rtsq0mn1bB961e6CDUiTMkm0KdBZttvszj4ekyTjY_guRANi3jYJf61sA5rjzfZ751KenuxaZonxWPT7PgXpMvXuyPRfA6iyBNIlxt0myzW2eOKNXgUpQWKJjvB-shSB_e-XwRQn0shNdpCLc2RPGc_S5KQp3o8M2T8qfUxpSoVkUEr68IqFJFhFGLCPaHUv4WpA9Lnc1jR5UqtTrE2v_P_S-zGdm01X9nZ5fi_Odkc_-Q_-v_M16_p3G3Zb2JBlHsKK-8-3fXnrxZWzRXXDRQ3JEDRxn3GYMQow5DSJMQheSix07TOMSox04jutMc1aqu03QYAVWqrtOYRWjdacRndBrZXDTZRDQ1cFxj2w1CjDsMIU1CFKLJHm1vHGLco-2yO9VQreps7zACqlSd7WYRWtsuP8N21Vw01UQ0d5CP-Wa2G4SYdBhCmoQoRFM92t44xKRH21V3qqFa1dneYQRUqTrbzSK0tl19hu1uc9HcJqJ5A2PXDSJcdBZBmkQoJHN7NL1xiIseTXe70wzVqs70DiOgStWZbhahtenuZ_9e8E6chU7jaJfqRr8GDI8b0uG9PhUojfbJWt8m0Tpf5vTnPOfyF0KdZqd35emP693prWPA17BgYcXDsgyL17D7BhZmsJCt6Is2tBy1oZXiacXSXhtYtFpaDlvR4za0AofFZY8p-P_yDGBZhkcsDDY95u0a8XpNWFoMefqCpwXoC5WuYuI2oJHcCAd2AxzpDXDkt6i0VBPBAY0MBzhSHOHguAMcSS4qjfXtkUV4pcVweEV0wfcYtHW-yYgx0I1vM2IC8EqjMbKVp6GtAEe28ji0lcehrZUma2QrT0NbeRzaCnB0ZHkc2sp_wUgBhigwtgreVskPrmDrku800gVzL99ppAfwSqcxmpt5Gg7OAEeTM4_D0ZnHka2y0mVNbAU0shXgyFaEoyPL48hWyX_ByAnA-Um2hFdt5UdZtHW-0ygwyiq-0yhwQ1b8UAPqDmhkK8KBrQBHtgIc3nT5izK66oIrfrvF4WUX4Oi2C34jQKeG_4JRqHT8KFvCK7YqfpYtb_3u5ad_AwAA__8MwAGf @@ -1076,12 +1076,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEllFr4kwUhu-_XzGcK4WROJNoa-CDlq7LCm7tVi8Kixepma2CTbKZCKal_31JsmKNOiezg8nlJHlm3jnngZx3kL_X4MLw6WF8O7onrS-j6Wz6Y9wm0-F4eDcjW_L1cfKdtFq7NSVp8WibvrXJ8Olu-DAjt-MxOf1FGygEoS_uvVchwf0JDChwoGADBQco9GBOIYrDhZAyjLNP3nNg5G_B7VJYBdEmyR7PKSzCWID7DskqWQtwYeY9r8Wj8HwRW12g4IvEW63zY7bp200Ur169OAUK08gLpEs6VnbyZJO45IbRGw7zDwrhJvl7wn7j55QsPbk83HKHzCnIxHsR4LIP-m9hew2E5WfD7rfaBGHsi1j4B5vNMxL75MSNv3lyORXJJLJYqTuzNBLuJ3mAwlr8Slp56vb_8epluVvsa1AqwP5mtsHNTsS-DzthZLFeuQYnz3YOzmbVFWAVFLB4x7IvaKxG3H4jcfnZuDU4y-pzlldvBK_SCLtjORf0RiPuVSNx-dm4NXjD6_PGrt4Iu0ojnE7-a7qUNxpxrxuJy8_GrcEbuz5vnOqNcKo0ote5oDUaYQcNhOVnw9bgjNPMXHUi1KOQURhIUWlq6mbXEv6LKMokw028EA9xuMiPKZaTnMv_-r6QSfGWF4tRULzKAlaH-ybwwARmRrlZT00zjZJxPbhvAg9MYGaUu1SyI5qX6e5n2lbX21bC7LBm3TLtmAiuhhHB1TAiuBrGBEdoRPCeieBqGBFcDSOCq2FMcIRGBO-bCH5loqgaRhRVw4iiahhTFKERRa9NFFXDiKJqGFFUDWOKIjSi6MBEUWY0JyA0IilCI5YiNKYphmOzgtmwYDYtmI0LhvOC2cDAjCYGdjQyaNmqpjFb1TRmq5pGbUVwzFadYem4ZzrTki6N2ao1L2njmK1Hw4PS1vnHf38CAAD___1ogpc= @@ -1096,12 +1096,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: xyz@primary +│ table: xyz@xyz_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEmFFv4kYUhd_7K6z7lEiDYGZsIJYqZbVL1Ug0SQMPK1V58MI0QWIxtY0UNsp_rwBFXmx8zwy2s4_G-XzP3Mw5vuNXSv9bUkijr_fjTze33sWXm8l08vf40puMxqPPU-_F--Ph7i_v4uL9Wnjbw08v2x-X3ujr59H91Dt995IEreK5uY2-m5TCf0iSIEWCNAnySVBAj4LWSTwzaRonuz953QM38xcKe4IWq_Um2_38KGgWJ4bCV8oW2dJQSNPo29I8mGhukm6PBM1NFi2W-zIv2x_X62TxPUq2JGiyjlZp6HW6u8p3myz0rqW4VvT4JijeZHmFNIueDIXyTZynImhShXJR8WWRZovVLOvKQidO1cixb1vvOUqfTyO5FH2elKAFKX6llPxRm1WczE1i5kcP2z-lUqyy6FuuImhLhUXLchX9GirEWUL_jNLnicnu1l1d6Nd0uzbhexh8Go9J0NL8m13sV3D5e7J4en6_yLd_5coGzfb3Nu7E664Oij04WXt4VFvau19auL-rOl19Tgo56Og3q0O56MjNL1vPIWsp_dZzSDaXABZ9q8qhBlVYtKwqh9xU1M4h-XE5pOw9qGw8qDtd_5wscNAxaFaHctGRG1C1ngXWUgatZ4FqzoUWfavKggZVWLSsKgvcVNTOAvVxWaDtPahtPOh39qcH5yxw0DFsVody0ZEbULeeBdZShq1ngW7OhRZ9q8qCBlVYtKwqC9xU1M4C_XFZ4Nt70LfxYNA5JwkcVFw1qUK5qMjN57eeA9ZSrlrPAb85B1r0rSoHGlRh0bKqHHBTUTsH_F_zneKEqAeTruNVaqy-QvR2yzLzJ3NoUxpvkpm5T-LZvszh8m7P7X-YmzQ73FWHi5vV4dZO4M-wZGHNw6oIy59h_wiWbrBUteirOrTq16G15mnN0kEdWNYqrXq16EEdWoPN4rPbFPy_AgdYFeE-C4NFD3h39Xl7DVla9nj6iqclyIVSqrh4G9DI3AgH7gY4sjfAkb9lKVJdDA5o5HCAI4sjHGx3gCOTy1KwHm9ZhJcihsNLRpd8xqCl8yEjB8BufMzIIcBLQePkVp6GbgU4ciuPQ7fyOHRrKWSd3MrT0K08Dt0KcLRleRy6lX_BKAmGKDC2St6tih9cwdIVnzTKB3MvnzQqAHgpaZzmZp6GgzPA0eTM43B05nHkVlVKWRe3Ahq5FeDIrQhHW5bHkVsV_4JRQ4Dzk2wBL7uVH2XR0vmk0WCU1XzSaHBC1vxQA_oOaORWhAO3Ahy5FeDwpMsflNFRFxzx6xWHh12Ao9Mu-EaAdg3_gtGodfwoW8BLbtX8LFtc-uPbb_8HAAD__-F9IDQ= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/experimental_distsql_planning_5node b/pkg/sql/opt/exec/execbuilder/testdata/experimental_distsql_planning_5node index c86d5dd96cd7..26cc6fd63fd2 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/experimental_distsql_planning_5node +++ b/pkg/sql/opt/exec/execbuilder/testdata/experimental_distsql_planning_5node @@ -52,7 +52,7 @@ vectorized: true · • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyk0s1K80AYBeD9dxXhrD5lQv5dZKVohUBta9OFIFnEzEsJTTNxJilKyb1LJ4vaUnW0y_k588wLZwv1WiHG6Gk2vkkm1v-7JF2kj-MLKx2NR7cL69K6n08frNUGDLXgNMnXpBA_wwODD4YADCEYImQMjRQFKSXk7spWBxL-hthlKOuma3fbGUMhJCHeoi3bihBjkb9UNKeck3RcMHBq87LSzGpz3chynct3MKRNXqvYsh0fWc8gunb_pmrzJSH2evaFu-e6WkhOkvgBlfUnfjYRtmic6Ojiado_oD3zkb2fR3Z82wkMh_bNZd9ADmwnNJQDczkwkEPbiQzl0FwODeTI_kPBTrhzUo2oFRn1x90VkPiShrYq0cmCZlIUmhmWU53TG5xUO5x6wyKp9ZH-4Oew92346iDsHof9c-TgnHB4Tjj6VTjr_30EAAD__2R3o50= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain b/pkg/sql/opt/exec/execbuilder/testdata/explain index 2425cb62a97d..9284c64fd92a 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain @@ -611,7 +611,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -623,7 +623,7 @@ vectorized: true • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -634,7 +634,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/1 - /1] [/3 - /3] statement ok @@ -647,13 +647,13 @@ distribution: local vectorized: true · • lookup join -│ table: t2@primary +│ table: t2@t2_pkey │ equality: (k) = (x) │ equality cols are key │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -670,7 +670,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -709,7 +709,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 2 (missing stats) - table: t@primary + table: t@t_pkey spans: LIMITED SCAN limit: 2 @@ -724,7 +724,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -751,7 +751,7 @@ vectorized: true └── • scan columns: (v) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN statement ok @@ -772,7 +772,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 10 (missing stats) - │ table: tc@primary + │ table: tc@tc_pkey │ key columns: rowid │ └── • scan @@ -816,7 +816,7 @@ vectorized: true • scan columns: (k int, v int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -828,7 +828,7 @@ vectorized: true • scan columns: (k int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -845,7 +845,7 @@ vectorized: true └── • scan columns: (k int, v int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -902,7 +902,7 @@ vectorized: true └── • scan columns: (k int, v int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -933,7 +933,7 @@ vectorized: true └── • scan columns: (k int, v int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -965,7 +965,7 @@ vectorized: true • scan columns: (k int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -983,7 +983,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -995,7 +995,7 @@ vectorized: true • scan columns: (v int) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: LIMITED SCAN limit: 1 @@ -1016,7 +1016,7 @@ vectorized: true └── • scan columns: (x int, y int) estimated row count: 1,000 (missing stats) - table: tt@primary + table: tt@tt_pkey spans: FULL SCAN # TODO(radu): we don't support placeholders with no values. @@ -1148,7 +1148,7 @@ TABLE tc ├── rowid int not null default (unique_rowid()) [hidden] ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX tc_pkey │ └── rowid int not null default (unique_rowid()) [hidden] └── INDEX c ├── a int @@ -1167,7 +1167,7 @@ TABLE tc ├── rowid int not null default (unique_rowid()) [hidden] ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX tc_pkey │ └── rowid int not null default (unique_rowid()) [hidden] └── INDEX c ├── a int @@ -1177,7 +1177,7 @@ TABLE t ├── v int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX t_pkey └── k int not null inner-join (hash) ├── columns: a:1 b:2 k:6 v:7 @@ -1321,7 +1321,7 @@ vectorized: true │ └── • scan missing stats - table: tc@primary + table: tc@tc_pkey spans: FULL SCAN # Verify that subqueries are handled correctly, namely that we can have @@ -1337,7 +1337,7 @@ NULL vectorized: true NULL · NULL • scan NULL missing stats -NULL table: t@primary +NULL table: t@t_pkey NULL spans: FULL SCAN # Tests with EXPLAIN inside EXPLAIN. @@ -1361,7 +1361,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/10 - /10] [/20 - /20] [/30 - /30] [/40 - /40] … (4 more) @@ -1384,7 +1384,7 @@ vectorized: true • upsert │ into: u(k, v) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: u_pkey │ └── • cross join (left outer) │ @@ -1393,7 +1393,7 @@ vectorized: true │ └── • scan missing stats - table: u@primary + table: u@u_pkey spans: [/1 - /1] locking strength: for update @@ -1406,7 +1406,7 @@ vectorized: true • insert │ into: u(k, v) │ auto commit -│ arbiter indexes: primary, u_v_key +│ arbiter indexes: u_pkey, u_v_key │ └── • lookup join (anti) │ table: u@u_v_key @@ -1420,7 +1420,7 @@ vectorized: true │ └── • scan missing stats - table: u@primary + table: u@u_pkey spans: [/1 - /1] # Make sure EXPLAIN (VERBOSE) works when there is a constrained scan of a @@ -1473,7 +1473,7 @@ vectorized: true · • scan estimated row count: 1,000,000 (100% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: FULL SCAN query T @@ -1484,7 +1484,7 @@ vectorized: true · • scan estimated row count: 150,000 (15% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /150000] query T @@ -1495,7 +1495,7 @@ vectorized: true · • scan estimated row count: 20,000 (2.0% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /20000] query T @@ -1506,7 +1506,7 @@ vectorized: true · • scan estimated row count: 1,234 (0.12% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /1234] query T @@ -1517,7 +1517,7 @@ vectorized: true · • scan estimated row count: 980 (0.10% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /980] query T @@ -1528,7 +1528,7 @@ vectorized: true · • scan estimated row count: 100 (0.01% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /100] query T @@ -1539,7 +1539,7 @@ vectorized: true · • scan estimated row count: 99 (<0.01% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /99] query T @@ -1550,7 +1550,7 @@ vectorized: true · • scan estimated row count: 1 (<0.01% of the table; stats collected ago) - table: percent@primary + table: percent@percent_pkey spans: [/1 - /1] # Regression test for #61248: insert fast path with no rows. @@ -1641,7 +1641,7 @@ TABLE tc ├── rowid int not null default (unique_rowid()) [hidden] ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - ├── PRIMARY INDEX primary + ├── PRIMARY INDEX tc_pkey │ └── rowid int not null default (unique_rowid()) [hidden] └── INDEX c ├── a int @@ -1651,7 +1651,7 @@ TABLE t ├── v int ├── crdb_internal_mvcc_timestamp decimal [hidden] [system] ├── tableoid oid [hidden] [system] - └── PRIMARY INDEX primary + └── PRIMARY INDEX t_pkey └── k int not null memo (optimized, ~14KB, required=[presentation: info:10]) ├── G1: (explain G2 [presentation: a:1,b:2,k:6,v:7]) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze b/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze index 7f3915a645ac..d07e1b018e34 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze @@ -23,7 +23,7 @@ regions: KV rows read: 0 KV bytes read: 0 B missing stats - table: kv@primary + table: kv@kv_pkey spans: [/2 - ] statement ok @@ -50,7 +50,7 @@ regions: KV rows read: 3 KV bytes read: 24 B missing stats - table: kv@primary + table: kv@kv_pkey spans: [/2 - ] statement ok @@ -92,7 +92,7 @@ regions: │ MVCC step count (ext/int): 0/0 │ MVCC seek count (ext/int): 0/0 │ estimated row count: 1,000 (missing stats) -│ table: kv@primary +│ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan @@ -108,5 +108,5 @@ regions: MVCC step count (ext/int): 0/0 MVCC seek count (ext/int): 0/0 estimated row count: 1,000 (missing stats) - table: ab@primary + table: ab@ab_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze_plans b/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze_plans index 0645e78b98f3..1359b93065da 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze_plans +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_analyze_plans @@ -93,7 +93,7 @@ regions: │ KV rows read: 5 │ KV bytes read: 40 B │ missing stats - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan @@ -105,7 +105,7 @@ regions: KV rows read: 5 KV bytes read: 40 B missing stats - table: kw@primary + table: kw@kw_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsm99u4rgXx-9_T2H5qqMJE5yElkYaiZlqfqvOtjDqn5FGK1Sl5CyNgIRJTGm36mPtC-yTrRLKFAjYMdNZu9h3JI6Tk4-Pzzc-Pjzg7PsQ-_j808mnows0uH03sFBw298bTN8N3qD_n3VO0eAWfe4ct9Fgijrt4hL0HuXt6LezzuUX9PFbcRJbOE5CaAcjyLD_BybYwg62sIst7GELN3DXwuM06UGWJWl-yUPR4Ti8w37dwlE8ntD8dNfCvSQF7D9gGtEhYB9fBNdDOIMghNSuYwuHQINoWDxmcNsap9EoSO-xhc_HQZz5qGbnD-5MqI9auRm_f0U0GoGP6v_8nc2Oe0lMIaZREpea0mSaoRSC0EdPna_vKcxPNdFHbOHTr0dHKKMwRr1kElO0B3fUjmL6xkf1wsLZBQCDTReMgjs0glGS3qNgOEx6AYXQR_Xi7tcB7d1AhpIJHecvkV9fWDU_QXD30cKzoxnJOanre3QTZDfLjFr59V0LZzToA_bJo7Ud-v0V9NMyepsY-Ez4zkb4z_dJ0hBSCFfv8zZ_cKWr1ozjKaR9-JxEMaQ2WZlDQ_iT7rXI2zfv06h_M_v5PIZWKx9QuIPepDxkLJJ5W_Z9iCiMxiiMsgGaZEEftgb9DNEV8eAP_X4K_YAmqU0apbGxcGfG8cldP7S_XbU7F1fty5OTvRbJOZxfnu61nPzXUeeyffH0ewOQX-w-3s-5DxuPU_85POeXp1fHOSA3PzqDOIS08CDUcuyW-4LQnoE0KgCZxOuQrKXRTmrJ2HZW_GRbsxsbzd5fMptUj8GEL3-2U7NdE4OrCqAA_IMKAmjgiwggkSOAZKcEkOPBiwK4v1sCKOw-HAEkr10AnerBzKmgJG7N9kwwq6okAvCbFZTEwBdREkeOkjg7pSQcD15UkoPdUhJh9-EoifPalcStHszcCkri1eyGCWZVlUQA_mEFJTHwRZTElaMk7k4pCceDF5WkuVtKIuw-HCVxX7uSeNWDmVdBSRo1E8qq6ogA-gZfR2o2QUEcIoISegOpGYaqiuLJURRvpxSF48uLinK4W4oi7D4cRfFeu6JwdvzOIBsncQYr2z3r71zPaUHYhxndLJmkPfiSJr3iMbPDTtGvSDeGkNFZqzM7OI7nTRkNKGu76FdOovosaFS3vrnR-hjoNEkHaBhQiHv3P8yfn58GEV1-sRAySKNgGP0VlN963u0p5Pcgui1ee6FpHvt_tBXvPG8dQZajWO388kiIK5kJYTBpvggTIszE-El54sv2EylMiEAwdJQLhmzrmxut13ZAV4Lhf89ESjDkMDF-wguGmjBxVpnUF5ksI6mvdnaZQD2VPivXTBG29aSuozZymDQMk1LYMH5SZqKln3jMULqCZLVzg9nZ2V8OxMp9le5vmWDYYXdgI9m8Gn0NAyo9waDgiOqZYOBMfNl-ImXtdbBlgmGH3YSNZPNqVI1gyLZeeoJBwRHVM8HAmfiy_URKMGwyP2wP2QmGwy0TDDvsY2wkjKyFGkkXjvlaLhzZTPRMMHCYaOknpLSbx8ow6CEvRGQ3Txc_EdkjNEw4CQ01liA8-2UPqpKTX3b2QY6nl7b0TPqBw0TLxSqHCSOroUhE5Ngve1DlRETO5JedgpDj6aXdyqXvZuKxkxCktLFnshAcJnoWT_CgbF6gqZGb4divZyKCB0X2qlsOFHa5gmwmcqTX1ECIMtFz0WpKK8ShqF4uw5v8eg6qKYQQZaLnotXUV4hDUb1mhjf59RxUdjUE4ZRDEFMPUUa6dUGExlBkL9BUhMJIbyiSnjE1EWv-v2ZqIspM1K6JUJGJ7EyEnLmzdU2ExlCMpwilN9RYjDhq10TIiYimJkKUiZ6ZCB4U4ylC6Q1FIiK7JsLh1EQ4piaijNTURIhDkb1AUxGKnoUWPCiqV884piai-9h9_N-_AQAA___Lkw6x @@ -151,7 +151,7 @@ regions: │ KV rows read: 5 │ KV bytes read: 40 B │ missing stats - │ table: kv@primary + │ table: kv@kv_pkey │ spans: FULL SCAN │ └── • scan @@ -163,7 +163,7 @@ regions: KV rows read: 5 KV bytes read: 40 B missing stats - table: kw@primary + table: kw@kw_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsm9Fuo0YUhu_7FKO52lXxwgzYcZBWijZJ1Wy7cZVEK1WVLwhMY2QbvMw4ThrlsfoCfbIKvKyDMXMg2Yaph7vYgHPmO2fOP_wDD5h_mWEXX57-enp8hU7OLq_Ozo-v0Jvp6t3qLfrpYvQJTW_Rx9HZOZqu0OgcTW_fTdF7lB5Ho4uT0wv04ffsEzZwFAfs3Jszjt0_MMEGptjANjawgw3cx2MDL5LYZ5zHSXrKQ3bBWXCHXcvAYbRYivTrsYH9OGHYfcAiFDOGXXzlXc_YBfMClpgWNnDAhBfOsn8zvT1aJOHcS-6xgS8XXsRd1DPTfzxaChcdpWH88hmJcM5cZP3zN19_9uNIsEiEcVQ6lMQrjhLmBS76evH1vWD5V0P0ARv40-fjY8QFWyA_XkYCvWF3wgwj8dZFVhbh-gTGplUnzL07NGfzOLlH3mwW-55ggYus7NevPeFPGEfxUizSQaTnZ1HlXxA8fjTw-tOaZE7q-h5NPD4pMjpKzx8bmAvvhmGXPBrPQz_YQr8qozfJU_i0g78Nn1bC3_zOMoqTgCUsKPzSOL0SOmVHBn_2-ORjHEYsMcnW5JmxP8WbI_L2fRLeTLK_Cqljd8xfltMko5ce419mSLD5AgUhn6Il927Ys-FuwNlNqvYk5CKMfGGSfikbSoyrWdE4LygaGR1qqUlnM_J-k6xfxolgiUlLOf9RtWENaiR0VzqzsezM6XncixemvZXQikGDkfcrIz8oRE7qiweBddukPdPulLuucjeAf1BDuQvwO-UGlJu8snKTfVFuoGo3yj1QU5teotzNikaq3ERNOlXKDWQ9V-5SzhVXblq_BdMa-mf3TKfTv7r61wD-sIb-FeB3-gfoH31l_aP7on9A1W7070DNDv8S_WtWNFL9o2rSqdI_IOu5_pVyrrj-2fVbsF1D_5ye2e_0r67-NYB_WEP_CvA7_QP0z35l_bP3Rf-Aqt3o31DNDv8S_WtWNFL9s9WkU6V_QNZz_SvlXHH9c-q3YKeG_vV7nfrVVb8G6Puw-vVMgrwoQATFYsKSTgfr6qDzyjro7IsOAvW70cFDNTv9S3SwWdFIddBRk06VDgJZz3WwlHPFdRDYmL1gfBFHnG13g52_bKUJZ8ENW1cHj5eJz35LYj_7N-uPo-y6zFYOGBfro3T94SzKD3HhCdk26H9JzsJZt6sf_WFl9BETqziZopknWOTffws__37lhaI4sIBxloTeLPzLK486v-yrUPksvM2G_eRQrljfjmVjzo_OGU9RbF_8_ZGQfstMiITJ8LswIU2ZUNLVSYnJgY5MSINmSJVrhvLoDyuj1zahW83w9Zm00gyBIiddnQDNUBMmdJuJ9ZSJXUBibV9sS4E6Ki0rd0wRefREy_UCwETL9YKcCbU7JiUmWt6TOdJW2pe30r704kGR5_bFA3kTL3YyS7kl7cEz3Yk9riU5kurp9X9IaOvuhIIZ1dOdAJi0vdpo5cZt-Ex3Yo_LRI6k2vJQoxnKo2_dnVAwo3q6EwCTtt2JVprhoXRhSyz5mprI3e9qf2KPqwxgInE91DBtoPjbXjOomFQ9LQoIipYeBSl54MWOSoGOKreLBzou2AnghWlZZnImek49wFuvdkXUuI-B6rxtB0PJya_ncqTkhHceBsBEz-c25Ewk1ogiHRGo87ZtjHY6IgClbR-jnUqXb--RAbDsLm3wdUYGwETPxzcgKNXLEUXcHXn8mhoZABQ976ZKe4fFjjoEOmrJbe-MDFJy2zsjA2DS9tRTsU70fLwDmjxK7as8I34tjQza5L05TW5lACZtGxmtdESAiZ7PeECTp9odUaMjQvFraWRQ-f4hBfYPaWn_sDMyACZ6GhkQFD2XI3IoEndEDXcHir_tu6l2klraQSx2VAfoqPK3TrQ0MmjJbVfKyFCRiZ5TT85ETyMDmjx6LkcAKErtq-yKH9hC0PKmXc6kbSOjnToH9g_1NDKAydP2Yx5KQql2RxTpiPL9QwrsH1L52zp6GhnAm256rhwAKHoaGcC7blo-5gFBUeql_13rKfnLejbwsp5dsts1NDLGjz_8GwAA__8EUOFJ @@ -200,7 +200,7 @@ regions: │ KV rows read: 5 │ KV bytes read: 40 B │ missing stats -│ table: kv@primary +│ table: kv@kv_pkey │ spans: FULL SCAN │ └── • ordinality @@ -217,7 +217,7 @@ regions: KV rows read: 5 KV bytes read: 40 B missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsUcFu00AQvfMVozkBWhTbcTjsySUUNdA2KImKEMph4x2lq9i77u66JIryWfwAX4bspaJJm9CAuHGcN_Nm3ry3RndTIMfx6flpfwIv4d1oeAGLW_g0mJzBcPR2cHlyPph8hpMxCLanMUOG2ki6FCU55F8wxinDypqcnDO2gdbtwEAukUcMla5q38BThrmxhHyNXvmCkONEzAoakZBkOxEylOSFKtq1i9ussqoUdoUMx5XQjsMrZPjhCrwqiUP0_ZsLdW60J-2V0Q9a1nx1YElIDr2AzFae7qA0gjfI8OKq3wfnqYLc1NrDc1r6jtL-BYeolRUGiBb7BkqxhJJKY1cgisLkwpPkELbPhM-vyYGpfVV7Ds18K-sO6OF0wzBUP31yXswJebxhT_dyaKXSolB-1Ym3raQl5fVDe_5CWHKMsPshJ_9D3vWy-4chd_91yOleYb_01NpYSZbklphpw_zdyCPfnQl3_d4oTbaTbn83bKRmMcsSlnVZlrKsx7LXyPa9fSirpuduCvBUViCVW0DtxJyeHGWy37LeMVmOyFVGO9q17tHNUeMXyTkF_52pbU4frcnbM6EctrwWkOR86MahGOjQagTeJ8cHyekWOd4lJwfJ3cOXu0dcTnbJ6UFyb-fydPPsRwAAAP__PmxHoQ== @@ -270,7 +270,7 @@ regions: KV rows read: 5 KV bytes read: 40 B missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzslctu2zoQhvfnKQazsgEaknw5KLhKG6RF0KYunMBdFF4w4sAlLJEKSfnSwI_VF-iTFaKsNHYuVfdacmZ-zczn35h7dHcZcry--HRxfgNiveyt-jCdX8yg14f3s-kVrNbIUBtJn0VODvk3TJDhEBmOkOEYGU5wwbCwJiXnjK1K7oPgUm6RxwyVLkpfhRcMU2MJ-T165TNCjjfiNqMZCUk2ipGhJC9UFtqs1meFVbmwO2R4XQjtOAyiqvG09BzOqjE-zsGrnDjEv366-p0a7Ul7ZfSTlDUbB5aE5HAQ3-48NaE38A4ZXs3Pz8F5KiA1pfbQo62PlPZ9DnGYsC4gWr1UkIst5JQbuwORZSYVniSHOHz9Vvj0OzkwpS-qJar6MFUTSHCxZ1i_DsicF0tCnuzZC1j_0Cy1sZIsySOSi_0z4L8qLc2GbDQ5pv52_qF3lvQfKFe8aUtp-ZToa4tWOXeXgae8AKncCkonltSaw-RFDsMjDkl7eyV_t1c0HESjzmAV2GF7sMMWYEeDaNyBrcCO2oMdtQA7HoR_cAeWj9uDHbcAOxl0WFsc8Bm5wmhHJxfn-S_H1SUiuaT6bDlT2pS-WJOGNvVzGnQhIMn5OpvUj0sdUmHAx-LkVfH_R-L4VDz8l85hlbAVavIbY1eQCU863T38_E18I5Q_NoYkR1aJTP0QT13TyA7WSUmt6WCfJtV4qMnVPmqyObnqxD4uiFsb4RjJqENyimTcITlFMumQ7Bf7_34HAAD__-kfW5M= @@ -297,7 +297,7 @@ regions: KV rows read: 0 KV bytes read: 0 B missing stats - table: kv@primary + table: kv@kv_pkey spans: [/0 - /0] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyMUc1q4zAQvu9TDHPaBUHsq2AhbPDSkKYpTkgPxQdFHlJjW3KlcZoQ_Fh9gT5ZsVRSSgn0-P3oG803Z_TPDUpcZ7fZbAM1_M9XS6gP8HCT5RnU8BcSFGhsSXeqJY_yEVMsBHbOavLeupE6B8O8PKJMBFam63mkC4HaOkJ5Rq64IZS4UbuGclIluckYXBKrqgmx9WHauapV7oQC150yXsIkCa5VzxKmKQpcbIGrliQkb68-Ym0Nk-HKmm-Ssy8eHKlShi0WW9idmC4U_EOBy-1sBp6pA217w_CbjjypDP-REIdHA1F9zdCqI7TUWncC1TRWK6ZL-k6xfiIPtuduXGL0h199EsUgMKKPzjyrPaFMB_HzXnPynTWevlR6LTkZCoFU7ineztveabp3VocxEa7Cu0CU5DmqaQRzE6WhGH69BwAA__821Lg1 @@ -353,7 +353,7 @@ regions: │ KV rows read: 1 │ KV bytes read: 8 B │ missing stats -│ table: parent@primary +│ table: parent@parent_pkey │ spans: LIMITED SCAN │ limit: 1 │ @@ -372,7 +372,7 @@ regions: │ KV contention time: 0µs │ KV rows read: 1 │ KV bytes read: 8 B - │ table: parent@primary + │ table: parent@parent_pkey │ equality: (column2) = (p) │ equality cols are key │ diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_env b/pkg/sql/opt/exec/execbuilder/testdata/explain_env index 376046b9717f..66dac59f7897 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_env +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_env @@ -37,7 +37,7 @@ CREATE TABLE y ( query T EXPLAIN (OPT, ENV) SELECT * FROM x WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0lNFu2jAUhq_rpzjKTWEiI4GbKqjSUppq2WioIOtaVZXlJAa8GjtzHBqYJvUheMI-yeTQdmwSY71oLiLZ5_-Ozzl_HNuGS6oKJoUHfZneKUnS2ekJ0IqmScl4RhVoWmhYbFQI2TYoKlVGFf4mmSgwZ3OmYUYK0DMKGZ2QkmtYEF5SD46MngqScIpXbLoi05raJZfC6GWu2ZytqMJlQfGMFVpOFZkXr6HmJdcslRwXmug9JJcp4Uwv8XOKDOdEaaaZFDTDTGS0wkVK9pSdK5mTKdEUM5GXGtdDYmK6k5pMNhidUIW5lHdl_jTTiVR4cre77A3JhKZqQXihl5zizZSzPUxGjJ2v0LOCcC7v8aTkHOvaSDOKfbVxoqZ0Axk5VvJ-J-I6joPGQWwO08V3DscmSw_AnP-nlJRamvQLmmqp2Ir-wxLUHwV-HEDsnwwCyMuEs_R9BQ10QCCM4iOIhjFEXwaDFjpInnY2q_4wGscjP4xisHLF5kQtLbgYhef-6Bo-B9fQIOCP-80WOgij0-AKKpxgllXQSJ73z_zzcHC9hTdIC5ImavYQ8gdxMPq7rDD6FPRjGMd-HI7jsD-GwxsEAPCjfpvHSiUv56KwPLh52awDxHpZ37a29IoSTTNMtOWB1XHcI9txbccFx_Ucx3Mca0tshs9EqnEqS2EA13G2wvU1xOZG6WVOTb5tWBijn8FtTMn73wk7XbfTrWM_W__dW_ImvdWlvF176Pawh1BwdTHwwwgaw4u4BUF02YRxMDA2v4Oz0fAcKvj6MRgFkMAxdHvItm0b1T-a6sPTJ4Xgcb1-XD88rh8glaLQijChPWh32q4HN-0u2NDu3qJfAQAA___FbsBk +https://cockroachdb.github.io/text/decode.html#eJy0lNFu2jwUx6_rpzjKTeET-Ujgpgqq9KU01ZeNhgqyrlVVWU5iwMPYmePQwDSpD8ET9kkmh7ZjkxjrRXMRyT7_3_E55x_HtuGaqoJJ4UFfpnMlSTo7PwNa0TQpGc-oAk0LDcutCiHbBkWlyqjCXyQTBeZswTTMSAF6RiGjE1JyDUvCS-rBidFTQRJO8ZpN12RaU_vkUhi9zDVbsDVVuCwonrFCy6kii-It1KLkmqWS40ITfYDkMiWc6RV-SZHhnCjNNJOCZpiJjFa4SMmBsnMlczIlmmIm8lLjekhMTPdSk8kWoxOqMJdyXubPM51IhSfz_WVvSSY0VUvCC73iFG-nnB1gMmLsfIOeFYRz-YAnJedY10aaURyqjRM1pVvIyLGSD3sR13EcNA5ic5guvnI4NVl6AOb8X6Wk1NKkX9JUS8XW9A-WoP4o8OMAYv9sEEBeJpyl_1bQQEcEwig-gWgYQ_RpMGiho-R5Z7vqD6NxPPLDKIYK53O6gqtReOmPbuFjcAsNAv6432yhozA6D26gwglmWQWN5GX_wr8MB7dg5YotiFpZ0CAtSJqo2UPIH8TB6PeawuhD0I9hHPtxOI7D_hiO7xAAwLf6bR4rlbxciMLy4O51sw4Q63V939rRK0o0zTDRlgdWx3FPbMe1HRcc13Mcz3GsHbGZPBOpxqkshQFcx9kJ13cQm-ukVzk1-XZhYVx-AXcxJR9-Jux03U63jn1v_XVvybv0Vpfyfu2h--MeQsHN1cAPI2gMr-IWBNF1E8bBwNj8D1yMhpdQwef_g1EACZxCt4ds27ZR_Zep_nv-pBA8bTZPm8enzSOkUhRaESa0B-1O2_Xgrt0FG9rde_QjAAD__5Civ6w= statement error ENV only supported with \(OPT\) option EXPLAIN (ENV) SELECT * FROM x WHERE b = 3 @@ -49,7 +49,7 @@ EXPLAIN (ENV) SELECT * FROM x WHERE b = 3 query T EXPLAIN (OPT, ENV) SELECT * FROM x, y WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0lc9u4zYQxs_hUwx8WbuwGjm-BA4WqNbLtGodOZDV7QZBQFAS5bChSZV_FCtFgUWfwcc-XZ6koJxk3e66aQ7xwYBmvt9oOPPRDgL4wLThSk5gqoobrWhx_f4dsDUrcsdFyTRYZiw0WxVCQQCaKV0yTX5VXBoi-IpbuKYG7DWDklXUCQsNFY5N4NjrmaS5YOSOL-_osqP2yZX0elVbvuJ3TBNnGLnmxqqlpivzEmrlhOWFEsRYap8hhSqo4LYljyVKUlNtueVKspJwWbI1MQV9pu1aq5ouqWWEy9pZ0g2Jy-Veqqq2GKuYJkKpG1c_zLRSmlQ3-9veklxaphsqjG0FI9spl88wJfXrfIGeGyqEuiWVE4LYbpF-FM_1Jqhesi3k5USr273IKAxDtMCZf5k1vwl466ucAPj3_1NKnVW-fMMKqzS_Y_-xEjRNcZRhyKJ3Mwy1ywUvvl1DHx1QiJPsGJJ5BsnPs9kQHeQPke3TdJ4ssjSKkwx6teYrqtsenKfxWZRewE_4AvoUosV0MEQHcfIef4Q1yQkv19DPH-On0Vk8u9jB-3QI-QANThCKZhlO_91WnPyIpxkssiiLF1k8XcCbSwQA8Hv37T-9Qgm3kqY3gcunYJegvafnq-GOXjNqWUmo7U2gdxSOjoNwFIQjCEeTMJyEYW9H7IfPZWFJoZz0wCgMd9LdNST-Rtm2Zr7eLiz9oh_BXUyr288Fj8ajo3GX-2P4v8-Wv8rZulZe73jo6s3J1w3YegO6LwzYvNCA7tFoO9LqhjREs4qs4XSe4vj7ZKttBpDiU5ziZIoXT47r08_-bUmz9W-z379uCM1e_7Zf9W83BPzxfBbFCfTn59kQcPJhAAs889pv4DSdn8F6CC388gNOMeTwFsYnKAiCAHEpmQ66f4t-oZUxAwT3m7_uN5_uN5-g-zluv4isv3u4ij7zp1_F_WbzICiUNFZTLu0EDo8ORxO4PBxDAIfjK7Qjq7iwTBvoW-3YAP0dAAD__6wRLDM= +https://cockroachdb.github.io/text/decode.html#eJy0lcFu4zYQhs_hUwx8WbuwGjm-BA4WqNbLtGodOZDV7QZBQFAS5bCmSZWkFClFgUWfwcc-XZ6koJxk3W5cdw_xwYBmvn80nPlpex58YNpwJScwVdlKK5rdvn8HrGFZWnGRMw2WGQv1lkLI80AzpXOmya-KS0MEX3MLt9SAvWWQs4JWwkJNRcUmcOp4JmkqGLnny3u67FT7cCUdr0rL1_yeaVIZRm65sWqp6dp8jWpdCcszJYix1B5QCpVRwW1LnkrkpKTacsuVZDnhMmcNMRk90HapVUmX1DLCZVlZ0g2Jy-VeVVFsZaxgmgilVlX5ONNCaVKs9re9VXJpma6pMLYVjGynnB_Q5NSt8yt4bqgQ6o4UlRDEdot0ozjUm6B6ybYihxOt7vZKRr7vowVO3Mus-U3AW1flDMC9_58oraxy5WuWWaX5PfuPlaBpjIMEQxK8m2Eoq1Tw7NsG-uiIQhglpxDNE4h-ns2G6Ch9jGyfpvNokcRBGCXQkHLFWriMw4sgvoKf8BX0KQSL6WCIjsLoPf4IDUkJzxvop0_x8-AinF1Br9R8TXXbgz4dQjpAgzOEglmC43_3FEY_4mkCiyRIwkUSThfw5hoBAPzefbtPL1OiWkvTm8D1c7BL0N7z881wh9eMWpYTansT6J34o1PPH3n-CPzRxPcnvt_bgd3kucwsyVQlnWDk-zvp7g4Sd51sWzJXb1cs3ZafhLsyre4-FzwZj07GXe6P4f8-W_oqZ-taeb3joZs3Zy-7r3Xuq75wX73Pfe0L7queXLbDFStSE80K0sD5PMbh99GWrQcQ43Mc42iKF89269PP5m1JvTVvvd-81RDqveZtXzRvNwH88XIWhBH055fJEHD0YQALPHPsN3Aezy-gGUILv_yAYwwpvIXxGfI8z0NcSqa97n-in2llzADBw-avh82nh80n6H6I2y8izXeP99Bl_nR7eNhsHoFMSWM15dJO4PjkeDSB6-MxeHA8vkE7WMGFZdpA3-qKDdDfAQAA__9W-SrE # # Same table twice should only show up once. @@ -58,7 +58,7 @@ https://cockroachdb.github.io/text/decode.html#eJy0lc9u4zYQxs_hUwx8WbuwGjm-BA4Wq query T EXPLAIN (OPT, ENV) SELECT * FROM x one, x two ---- -https://cockroachdb.github.io/text/decode.html#eJy0lEtu6zYUhsfhKg40uXZhFXLuJLBxB7qOAqh15MBSgwRBQFDSkc2GJlWS8qsokEV42NVlJQXlJHULuG4G8cAQ-f_f4XmA9H24RW24kgMYqeJJK1bML78DrrHIGy5K1GDRWFjuXYT4PmhUukRNf1VcGir4gluYMwN2jlBixRphYclEgwO4cH6ULBdIt3y2ZbOWOmZX0vlVbfmCb1HTxiCdc2PVTLOF-Qi1aITlhRLUWGZPkEIVTHC7oW8hSlozbbnlSmJJuSxxTU3BTqRda1WzGbNIuawbS9smcTk7SlXVHsMKNRVKPTX1a08rpWn1dDztPcmlRb1kwtiNQLrvcnmCKZkb5wf83DAh1IpWjRDUtoN0rTiVm2B6hnvI2alWq6NIPwgCkkaZO8ya3wR8c1GGAO78f1pZY5ULv8TCKs23-B8jIaNpFGYRZOH3cQR1kwte_LiGDjljECfZBSSTDJJfxuMeOctfd_ar0SRJs2kYJxl4teYLpjce3Ezj63B6Dz9H99BhEKajbo-cxclldAdrmlNerqGTv-1fhdfx-P4A77Ae5F3SHRISjrNo-u-04uSnaJRBmoVZnGbxKIUvDwQA4Pf23_28QolmIY03gIf3zVZg3vv6sXfg18gslpRZbwDeedC_8IO-H_Qh6A-CYBAE3oHZNZ_LwtJCNdIB_SA4kNtrSN2NspsaXbxDWLpBv4GHmFarvwOef-2ff221P3r_u7b8U2prU_m88sjjlyEh0d3NOIwT6Exush5EyW0X0mjsxvwDXE0n17CGMAUlsbf_sis1JL7v-4RLidpvn8pOoZUxXQIvuz9fds8vu2do36I1PDDzTUl8PCLZlWql3atUcWFRG-hY3WCX_BUAAP__TWbY2A== +https://cockroachdb.github.io/text/decode.html#eJy0lN-O4jYUxq_HT3GUm4WKVGH2ZgTaiyybldIyYUTS1Y5GI8tJTsDF2KntQKCqtA_BZZ9unqRymNnSSpTOxXCBYn_f7_j8ke378AW14UqOYKKKlVasWH76CNhikTdclKjBorGwOboI8X3QqHSJmv6quDRU8DW3sGQG7BKhxIo1wsKGiQZHcOP8KFkukO75Ys8WHXXOrqTzq9ryNd-jpo1BuuTGqoVma_Maat0IywslqLHMXiCFKpjgdkdfQpS0Ztpyy5XEknJZYktNwS6kXWtVswWzSLmsG0u7JnG5OEtV1RHDCjUVSq2a-rmnldK0Wp1P-0hyaVFvmDB2J5Aeu1xeYErmxvkKPzdMCLWlVSMEtd0gXSsu5SaYXuARcnaq1fYsMgyCgKRR5g6z5jcBH1yUMYA7_59W1ljlwm-wsErzPf7HSMhkHoVZBFn4cRpB3eSCFz-20CNXDOIku4FklkHyy3Q6IFf5885xNZklaTYP4ySDltYr3MHdPL4N5_fwc3QPPQZhOukPyFWcfIq-QktzyssWevnL_ufwNp7eg1drvmZ650GPDSDvk_6YkHCaRfN_5xQnP0WTDNIszOI0iycpvHsgAAC_d__u5xVKNGtpvBE8fN_sBOZ9Xz8OTvwamcWSMuuNwLsOhjd-MPSDIQTDURCMgsA7MbvOc1lYWqhGOmAYBCdydwepu052V6OLdwpLN-UX8BTTavt3wOv3w-v3nfbH4H_Xlr9JbV0qb1ceeXw3JiT6ejcN4wR6s7tsAFHypQ9pNHVj_gE-z2e30EKYgpI4OH7ZrRoT3_d9wqVE7XfvZK_Qypg-gafDn0-Hb0-Hb9A9RC08MPNBSXw8I9mt6qTDs1RxYVEb6FndYJ_8FQAA___0m9gg # # Set a relevant session variable to a non-default value and ensure it shows up @@ -71,7 +71,7 @@ SET reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyUkt9O2zAUxq_xUxxxQzuRAao0oVZchOBu2UKKEo-BELJM4rRe3Tjzn9D0iofoE_IkUxqQNrSu4jLR73fy5TvH8-CaayNUOYRAZXOtWDa7OAe-5NmDEzLnGiw3FuqOQijFBDRXOuea_lSiNFSKhbBwBp8GIwDPg5wXzEkLNZOOD-EUeR7wkj1ITldiumLTjQczZsDO-FtclS2vKisWYsU1dYbTmTBWTTVbmPdYCyetyJSkxjK7w5QqY1LYhr6OyGnFtBVWqJLnVJQ5X1KTsR2xK60qNmWWU1FWztJNTaKcbrWKotN4wTWVSs1d9dJqoTQt5ttjd6YoLdc1k8Y2ktOu5XyHk7N2o-_ghWFSqkdaOCmp3SyyrWJXNsn0lHdSi1OtHrcqJ8fHx5vTyoWx5peEs3bKP--JOava8TXPrNJixf-zEhQk2CcYiH8eYajcgxTZxwZ6aM9BGJNTiCcE4u9RdIj26pc33VMwiVOS-GFMYL_SYsF0sw9XSXjpJ7fwDd9Cz4GfBv2_0WJOa6p5QZcwniQ4_Bx3bN2HBI9xguMAp685lj3W6mF8gW-goTUV-RJ69evYsX8ZRrd_fL3nDqHuo_4IIT8iOHn7V2H8FQcEUuKTMCVhkMLB3f3BCCF8cxX5YQy9yRU5BBxf9yHFUct-gHEyuYQGfnzBCQYHZzAYIc_zPLQ59gbB83r9vH56Xj9BpkpjNROlHcLRyRDujgbgwdHgHv0OAAD__-ZkayY= +https://cockroachdb.github.io/text/decode.html#eJyUks1O20wUhtfMVRyxIfmEP0CRKpSIhQmT1q1xkO1SEEKjwT5Oppl43PkxcVZcRK6QK6kcw6KoNGJp63mO3nnP8Ty4Rm2EKocwVtlCK57NL84BV5g9OCFz1GDRWKg7ipCEpqBR6Rw1-6lEaZgUS2HhDD4NRgCeBzkW3EkLNZcOh3BKPA-w5A8S2VrM1ny29WDODdg5vsVV2fKqsmIp1qiZM8jmwlg103xpPmItnbQiU5IZy-0OU6qMS2Eb9joiZxXXVlihSsyZKHNcMZPxHbErrSo-4xaZKCtn2bYmUc7etYqi07BAzaRSC1e9tFoozYrF-7E7U5QWdc2lsY1E1rWc73By3m70A7wwXEr1yAonJbPbRbZV7MomuZ5hJ7U40-rxXeXk-Ph4e1q5MNb8knDWTvnrPXFnVTu-xswqLdb4j5WQcUz9lELqn4cUKvcgRfZ_Az2y5yCI0lOIpilE38PwkOzVL3-6r_E0StLYD6IUGlYtsIGrOLj041v4Rm-h58BPxv0_uWLBaqaxYCuYTGMafI46tu5DTCc0ptGYJq8hVj3e6kF0QW-gYTUT-Qp69evYiX8ZhLewX2mx5LrZh547hLpP-iNC_DCl8dsnBdFXOk4hSf00SNJgnMDB3f3BiBB6cxX6QQS96VV6CDS67kNCw5b9Dybx9BIa-PGFxhQcnMFgRDzP88j20hsCz5vN8-bpefMEmSqN1VyUdghHJ0O4OxqAB0eDe_I7AAD__8vram8= # Make sure it shows up correctly even if it matches the cluster setting. statement ok @@ -81,7 +81,7 @@ SET CLUSTER SETTING sql.defaults.reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyUkt9O2zAUxq_xUxxxQzuRAao0oVZchOBu2UKKEo-BELJM4rRe3Tjzn9D0iofoE_IkUxqQNrSu4jLR73fy5TvH8-CaayNUOYRAZXOtWDa7OAe-5NmDEzLnGiw3FuqOQijFBDRXOuea_lSiNFSKhbBwBp8GIwDPg5wXzEkLNZOOD-EUeR7wkj1ITldiumLTjQczZsDO-FtclS2vKisWYsU1dYbTmTBWTTVbmPdYCyetyJSkxjK7w5QqY1LYhr6OyGnFtBVWqJLnVJQ5X1KTsR2xK60qNmWWU1FWztJNTaKcbrWKotN4wTWVSs1d9dJqoTQt5ttjd6YoLdc1k8Y2ktOu5XyHk7N2o-_ghWFSqkdaOCmp3SyyrWJXNsn0lHdSi1OtHrcqJ8fHx5vTyoWx5peEs3bKP--JOava8TXPrNJixf-zEhQk2CcYiH8eYajcgxTZxwZ6aM9BGJNTiCcE4u9RdIj26pc33VMwiVOS-GFMYL_SYsF0sw9XSXjpJ7fwDd9Cz4GfBv2_0WJOa6p5QZcwniQ4_Bx3bN2HBI9xguMAp685lj3W6mF8gW-goTUV-RJ69evYsX8ZRrd_fL3nDqHuo_4IIT8iOHn7V2H8FQcEUuKTMCVhkMLB3f3BCCF8cxX5YQy9yRU5BBxf9yHFUct-gHEyuYQGfnzBCQYHZzAYIc_zPLQ59gbB83r9vH56Xj9BpkpjNROlHcLRyRDujgbgwdHgHv0OAAD__-ZkayY= +https://cockroachdb.github.io/text/decode.html#eJyUks1O20wUhtfMVRyxIfmEP0CRKpSIhQmT1q1xkO1SEEKjwT5Oppl43PkxcVZcRK6QK6kcw6KoNGJp63mO3nnP8Ty4Rm2EKocwVtlCK57NL84BV5g9OCFz1GDRWKg7ipCEpqBR6Rw1-6lEaZgUS2HhDD4NRgCeBzkW3EkLNZcOh3BKPA-w5A8S2VrM1ny29WDODdg5vsVV2fKqsmIp1qiZM8jmwlg103xpPmItnbQiU5IZy-0OU6qMS2Eb9joiZxXXVlihSsyZKHNcMZPxHbErrSo-4xaZKCtn2bYmUc7etYqi07BAzaRSC1e9tFoozYrF-7E7U5QWdc2lsY1E1rWc73By3m70A7wwXEr1yAonJbPbRbZV7MomuZ5hJ7U40-rxXeXk-Ph4e1q5MNb8knDWTvnrPXFnVTu-xswqLdb4j5WQcUz9lELqn4cUKvcgRfZ_Az2y5yCI0lOIpilE38PwkOzVL3-6r_E0StLYD6IUGlYtsIGrOLj041v4Rm-h58BPxv0_uWLBaqaxYCuYTGMafI46tu5DTCc0ptGYJq8hVj3e6kF0QW-gYTUT-Qp69evYiX8ZhLewX2mx5LrZh547hLpP-iNC_DCl8dsnBdFXOk4hSf00SNJgnMDB3f3BiBB6cxX6QQS96VV6CDS67kNCw5b9Dybx9BIa-PGFxhQcnMFgRDzP88j20hsCz5vN8-bpefMEmSqN1VyUdghHJ0O4OxqAB0eDe_I7AAD__8vram8= statement ok SET enable_zigzag_join = false @@ -89,7 +89,7 @@ SET enable_zigzag_join = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyUkt9O2zAUxq_xUxxxQzuRAao0oVZchOBu2UKKkoyBELJMctJ6dePMf0LTKx6iT8iTTG1A2qYB26Wt7_f5-Duf58ElaiNUNYRA5XOteD47OwVcYn7nhCxQg0VjoelUhKQ0A41KF6jZdyUqw6RYCAsn8GEwAvA8KLDkTlpouHQ4hOMtghW_k8hWYrri0y0IJ6DK8q-IqojngaqtWIgVauYMspkwVk01XxiYcQN2hv9CLZy0IleSGcvtG6RUOZfCtuzZomA111ZYoSosmKgKXDKT8-p1m1qrmk-5RSaq2lm2jUpU0xepsuwwLFEzqdTc1U_Jlkqzcv7y2B0pKou64dLYViLrgi7eYAq-2ep_6IXhUqp7Vjopmd3uchPFW7NJrqfYQRs50-r-ReTo8PBw25VCGGt-yFcKwp1VG_sGc6u0WOErKyFBQv2MQuafRhRqdydF_r6FHtlxEMbZMcSTDOKvUbRPdpqnm-4UTOI0S_wwzmC31mLBdbsLF0l47ifX8IVeQ8-Bnwb936XlnDVMY8mWMJ4kNPwYd9qmDwkd04TGAU2f51j2-AYP4zN6BS1rmCiW0Guebcf-eRhd__J6z-1D0yf9ESF-lNHkz1-F8WcaZJBmfhamWRiksHdzuzcihF5dRH4YQ29yke0DjS_7kNJoo30H42RyDi18-0QTCg5OYDAinud5ZFv2lsDjev24fnhcP0CuKmM1F5UdwsHREG4OBuDBweCW_AwAAP__Du5riA== +https://cockroachdb.github.io/text/decode.html#eJyUks1O20wUhtfMVRyxIfmEP0CRKpSIhTGT1q1xkO1SEEKjwT5Oppl43PkxcVZcRK6QK6kSw6JVIe3S1vO8OvOe43lwjdoIVQ0hUPlcK57PLs4Bl5g_OCEL1GDRWGg6ipCUZqBR6QI1-65EZZgUC2HhDD4MRgCeBwWW3EkLDZcOh3C6VbDiDxLZSkxXfLoV4QxUWf5RURXxPFC1FQuxQs2cQTYTxqqp5gsDM27AzvBvrIWTVuRKMmO53WFKlXMpbMteIwpWc22FFarCgomqwCUzOa_ej6m1qvmUW2Siqp1l26pENX3TKstOwxI1k0rNXf3SbKk0K-dvj92ZorKoGy6NbSWyruhih1PwzVb_gReGS6keWemkZHa7y00Vu2aTXE-xkzY40-rxTeXk-Ph4eyuFMNb8kO8cCHdWbeIbzK3SYoXvrIQECfUzCpl_HlGo3YMU-f8t9MiegzDOTiGeZBB_jaJDste8_Om-gkmcZokfxhm0rJ5jC1dJeOknt_CF3kLPgZ8G_V-5cs4aprFkSxhPEhp-jDu26UNCxzShcUDT1yGWPb7Rw_iC3kDLGiaKJfSa19ixfxlGt7Bfa7Hgut2HnjuEpk_6I0L8KKPJ708K4880yCDN_CxMszBI4eDu_mBECL25ivwwht7kKjsEGl_3IaXRhv0PxsnkElr49okmFBycwWBEPM_zyPbSWwLP6_Xz-ul5_QS5qozVXFR2CEcnQ7g7GoAHR4N78jMAAP__80Bq0Q== statement ok SET optimizer_use_histograms = false @@ -97,7 +97,7 @@ SET optimizer_use_histograms = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyUkt9O2z4cxa_xU3zFDe1P5Aeo0oRacRGCu2ULKUo8BkLIMonTenXjzH9C0yseok_Ik0xNQNoQLdplovM5Pj7HngfXXBuhyiEEKptrxbLZxTnwJc8enJA512C5sVB3KoRSTEBzpXOu6U8lSkOlWAgLZ_BpMALwPMh5wZy0UDPp-BBOW4SX7EFyuhLTFZu2IJyBKop3EVW2jKqsWIgV19QZTmfCWDXVbGF2k573Blw4aUWmJDWWWQMzZsDO-PukVBmTwjb01SKnFdNWWKFKnlNR5nxJTcbK3TaVVhWbMsupKCtnaVuXKKdbqaLoMF5wTaVSc1e9tFsoTYv59tgdKUrLdc2ksY3ktCs7_4DJ2WbZf9ALw6RUj7RwUlLb7rmp4qNskukp76CNnGr1uBU5OT4-brfPhbHml9wxNXNWbexrnlmlxYrvmAQFCfYJBuKfRxgq9yBF9n8DPbTnIIzJKcQTAvH3KDpEe_XLn-4rmMQpSfwwJrBfabFgutmHqyS89JNb-IZvoefAT4P-39JiTmuqeUGXMJ4kOPwcd9q6Dwke4wTHAU5fcyx7bIOH8QW-gYbWVORL6NWvtmP_Moxu_zi95w6h7qP-CCE_Ijh5e6sw_ooDAinxSZiSMEjh4O7-YIQQvrmK_DCG3uSKHAKOr_uQ4mij_Q_GyeQSGvjxBScYHJzBYIQ8z_NQ-9gbBM_r9fP66Xn9BJkqjdVMlHYIRydDuDsagAdHg3v0OwAA__90h2vq +https://cockroachdb.github.io/text/decode.html#eJyUkt1O2zAcxa_xU_zFDe1EBqjShFpxEYK7ZQspSjwGQsgyidN6dePMH6HpFQ_RJ-RJpiZwMUSLdmnr_I6Oz7HnwTXXRqhyCIHK5lqxbHZxDnzJswcnZM41WG4s1J0KoRQT0FzpnGv6W4nSUCkWwsIZfBmMADwPcl4wJy3UTDo-hNMW4SV7kJyuxHTFpi0IZ6CK4l1ElS2jKisWYsU1dYbTmTBWTTVbmN2k570BF05akSlJjWXWwIwZsDP-PilVxqSwDX21yGnFtBVWqJLnVJQ5X1KTsXK3TaVVxabMcirKylna1iXK6VaqKDqMF1xTqdTcVS_tFkrTYr49dkeK0nJdM2lsIzntys4_YHK2WfY_9MIwKdUjLZyU1LZ7bqr4KJtkeso7aCOnWj1uRU6Oj4_b7XNhrPkjd0zNnFUb-5pnVmmx4jsmQUGCfYKB-OcRhso9SJF9bqCH9hyEMTmFeEIg_hlFh2ivfrnpTsEkTknihzGBhlZz3sBVEl76yS38wLfQc-CnQf9fXTGnNdW8oEsYTxIcfo07bd2HBI9xguMAp68hlj22wcP4At9AQ2sq8iX06lfbsX8ZRrewX2mxYLrZh547hLqP-iOE_Ijg5O2Twvg7DgikxCdhSsIghYO7-4MRQvjmKvLDGHqTK3IIOL7uQ4qjjfYTjJPJJTTw6xtOMDg4g8EIeZ7nofanNwie1-vn9dPz-gkyVRqrmSjtEI5OhnB3NAAPjgb36G8AAAD__1fCazM= statement ok SET optimizer_use_multicol_stats = false @@ -105,7 +105,7 @@ SET optimizer_use_multicol_stats = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyUkt9O2zwYxo_xVbzihPYT-QBVmlArDkJwt2whRYnHQAhZJnFar26c-U9oesRF9Aq5kqkJlbYJqDi09fwev36e1_PgmmsjVDmEQGVzrVg2uzgHvuTZgxMy5xosNxbqToVQiglornTONf2pRGmoFAth4Qw-DUYAngc5L5iTFmomHR_CaYvwkj1ITldiumLTFoQzUEXxKqLKllGVFQux4po6w-lMGKummi3MR8mFk1ZkSlJjmd1Bex5IlTEpbEO3LjmtmLbCClXynIoy50tqMlbCjBmwM_66TaVVxabMcirKylnaRibK6ZtUUXQYL7imUqm5q14SLpSmxdzsIEVpua6ZNLaRnHaB5zuYnG3a_YBeGCaleqSFk5LattNNFLtmk0xPeQdt5FSrxzeRk-Pj47bFXBhrfsl3CmPOqo19zTOrtFjxdypBQYJ9goH45xGGyj1Ikf3fQA_tOQhjcgrxhED8PYoO0V79ctOdgkmcksQPYwL7lRYLppt9uErCSz-5hW_4FnoO_DTo_y0t5rSmmhd0CeNJgsPPcaet-5DgMU5wHOB0O8eyxzZ4GF_gG2hoTUW-hF69tR37l2F0-8frPXcIdR_1Rwj5EcHJv78K4684IJASn4QpCYMUDu7uD0YI4ZuryA9j6E2uyCHg-LoPKY422v9gnEwuoYEfX3CCwcEZDEbI8zwPtcveIHher5_XT8_rJ8hUaaxmorRDODoZwt3RADw4Gtyj3wEAAP__HJFsTA== +https://cockroachdb.github.io/text/decode.html#eJyUks9O20oUxtfMUxyxIbnCF1CkK5SIhTGTW7fGQbZLQQiNBvs4mWbiceePibPiIfKEPEkVBxatgIilrd_v0_H32fPgGrURqhpCoPK5VjyfXZwDLjF_cEIWqMGisdBsKUJSmoFGpQvU7KcSlWFSLISFM_hvMALwPCiw5E5aaLh0OITTTsGKP0hkKzFd8WknwhmosnxTUVXnqNqKhVihZs4gmwlj1VTzhfmsuXDSilxJZiy3O2zPA6lyLoVt2WtKwWqurbBCVVgwURW4ZCbnFcy4ATvDt2NqrWo-5RaZqGpnWVeZqKbvWmW51bBEzaRSc1e_NFwqzcq52WGKyqJuuDS2lci2hRc7nIJv1v0ELwyXUj2y0knJbLfppopdt0mup7iVNjjT6vFd5eT4-LhbsRDGml_yg8G4s2oT32BulRYr_GASEiTUzyhk_nlEoXYPUuT_ttAjew7CODuFeJJB_D2KDsle8_Jm-xRM4jRL_DDOoGX1HFu4SsJLP7mFb_QWeg78NOj_yZVz1jCNJVvCeJLQ8P94yzZ9SOiYJjQOaPp6xLLHN3oYX9AbaFnDRLGEXvMaO_Yvw-gW9mstFly3-9Bzh9D0SX9EiB9lNPn7k8L4Kw0ySDM_C9MsDFI4uLs_GBFCb64iP4yhN7nKDoHG131IabRh_4FxMrmEFn58oQkFB2cwGBHP8zzS_ektgef1-nn99Lx-glxVxmouKjuEo5Mh3B0NwIOjwT35HQAA___-l2uV statement ok RESET reorder_joins_limit @@ -141,7 +141,7 @@ CREATE VIEW v AS SELECT a, b, u, v FROM x, y WHERE b = 3 query T EXPLAIN (OPT, ENV) SELECT * FROM v ---- -https://cockroachdb.github.io/text/decode.html#eJy0VcFu4zYQPS-_YuDL2oW0kWOgCGwEqNbLtGodOZDU7AZBQFAS5bChRZWkFCtFgUW_wcd-Xb6kkBQn6m7cNIf1wQBn3nsYzrwRbRvOmdJc5lOYy-RGSZpcf3gPbMOSuOQiZQoM0waqDoVQiCNQTKqUKfKb5Lkmgq-5gWP4fjIDsG1IWUZLYaCiomRTOEK2DSynsWDkjq_u6KrlwTXVYK7Zl3CZN3hZGL7md0yRUjNyzbWRK0XX-jWsdSkMT6Qg2lDzAlPIhApuarKTSElBleGGy5ylhOcp2xCd0BfKLpQs6IoaRnhelIa0beL5ai8ryzoay5giQsqbsnjoaiYVyW72l90xeW6YqqjQphaMdF1OX-CktJnoK_BcUyHkLclKIYhpB9m04qXaBFUr1pEaOFHydi9l7DhOa62Ua6N_F3DcqDzrJ1oa2chXLDFS8Tv2HyNB8wC7EYbIfb_AUJSx4Mm7DQzRGwqeHx2Bv4zA_3WxsNCb-CHSneZLP4wC1_MjGBSKr6mqB3AWeKducAG_4AsYUnDD-chCbzz_A_4EGxITnm5gGO_iJ-6pt7jo0YfUgniERjOE3EWEgy_L8vyf8TyCMHIjL4y8eQhvLxEAwB_tf_MbJFKU61wPpnD5GGwTdPB4vrJ6eMWoYSmhZjCFwaEzPrKdse2MwRlPHWfqOIMeuGk-zxNDElnmDWHsOL10u4ak2ShTF6zR65PzZtA7Yp-m5O2T4OFkfDhpc39a__tu8Te5W1vKt7seuno7e96AdWPA8isDVq80YLkzWg-a3ZCKKJaRDZwsA-z96HfYagQBPsEB9uc4fHTckD75tyZV599qv39LC6q9_q2f9W-_Cece_rhDV902WNBqghtCiBcN-ykKJ8HytH193u0Ktv51rOHjTzjAEMMxTGYI4U9nC9fzYbg8iyzA_vloJ_pdp1XNkG3bNuJ5zpTdvkLDREmtRwjut3_fbz_fbz9D-5mvv4psfnhY8SbzVzPi--32AZDIXBtFeW6mcHB4MJ7C5cEEbDiYXKEeLOPCMKVhaFTJRuifAAAA__9-t0XN +https://cockroachdb.github.io/text/decode.html#eJy0VcFu4zYQPYdfMfBl7ULayDFQBDYCVOtlWrWOHEhqdoMgICiJcljTokpSipWiwKLf4GO_Ll9SSIoTdzeuu4f1wQBn3nsYzrwRbRuumNJc5mOYymSpJE3u3r8DtmZJXHKRMgWGaQNVh0IoxBEoJlXKFPlN8lwTwVfcwBl8P5oA2DakLKOlMFBRUbIxnCLbBpbTWDDywBcPdNHy4I5qMHfsc7jMG7wsDF_xB6ZIqRm549rIhaIr_TWsVSkMT6Qg2lBzgClkQgU3NdlKpKSgynDDZc5SwvOUrYlO6IGyCyULuqCGEZ4XpSFtm3i-2MvKso7GMqaIkHJZFk9dzaQi2XJ_2R2T54apigptasFI1-X0ACelzUS_As81FULek6wUgph2kE0rDtUmqFqwjtTAiZL3eylDx3Faa6VcG_27gLNG5VU_0dLIRr5iiZGKP7D_GAmaBtiNMETuuxmGoowFT96uoY-OKHh-dAr-PAL_19nMQkfxU6Q7Ted-GAWu50ewJsWS1XAZeBducA2_4GvoU3DD6cBCR57_Hn-ENYkJT9fQj7fxc_fCm11Dr1B8RVXdgz61IB6gwQQhdxbh4POaPP9nPI0gjNzICyNvGsKbGwQA8Ef73_x6iRTlKte9Mdw8B9sE7T2fb60dvGLUsJRQ0xtD78QZntrO0HaG4AzHjjN2nN4OuOk8zxNDElnmDWHoODvpdgdJs06mLlijt0vOmylvibs0Je9fBE9Gw5NRm_vT-t93i7_J3dpSvt310O2byevuqxv3lV-4r9rnvvoV95Vbl-3gsiWpiGIZWcP5PMDej36HrQYQ4HMcYH-Kw2e79emLeWtSdeat9pu3tKDaa976VfPuduDKwx-26KpbBQtaTXBDCPGsYb9E4TyYX7Tvztttwda_jjV8-AkHGGI4g9EEIfzxcuZ6PvTnl5EF2L8abEW_67SqCbJt20Y8z5my2_ennyip9QDB4-bvx82nx80naD_w9ReR9Q9P-91k_mrm-7jZPAESmWujKM_NGI5PjodjuDkegQ3Ho1u0A8u4MExp6BtVsgH6JwAA__-uCERe # # Test tables in user-defined schemas. @@ -154,4 +154,4 @@ CREATE TABLE s.t (a int primary key) query T EXPLAIN (OPT, ENV) SELECT * FROM s.t; ---- -https://cockroachdb.github.io/text/decode.html#eJyUksFq20AQhs_ZpxhyiV2iklIoISYHRVVArSwbaRtqSlkm0kjeeq1Vd0dO7KcvslsIpa7J_ftmhn_-IIAHcl7b9gYiW66cxXL58Q7omcrHXpuKHDB5hs2BEqKIJTiyriKnfljdemX0WjPcwof3E4AggIpq7A3DBk1PN3AtggCoxUdDaqebHTZ7D5bogZf0N27bgbcd67XekVO9J7XUnm3jcO1fY617w7q0RnlGPmEaW6LRvFV_RlSqQ8eatW2pUrqt6Fn5Ek-c3TnbYYNMSrddz2ofk26bo1ZdHzSqySlj7arvfqdaW6fq1fGzD6ZumdwGjeetIXVIuTrhVDh89BW89miMfVJ1b4zi_SOHKE7dZtA1dJAGXDn7dFR5d3V1ta9WpT37nwZuhyn_7BP2bIfxGyrZOr2j_7xERHkcyhhkeJfG4N8yjMQZQpLJa8hmErIvaXopzqJZVsg8TDIJ553Ta3Tbc5jnyTTMF_A5XsAIISyi8aU4uw-nSbp4gY1wLMYTIcJUxvmLRUn2KY4kFDKUSSGTqICLb98vJkLEX-dpmGQwms3lJcTZwxiKOB3YN3Cfz6aDPRFBEARiXzgWvwIAAP__Hfw5sQ== +https://cockroachdb.github.io/text/decode.html#eJyUkkFr20wQhs_ZXzHkEvsj-nAplBCTg6IqoFaWjbQNNaUsE2kkb73WqrsjJ_avL7JbKKWuyf15ZoZ33iCAR3Je2_YWIluuncVy9f4e6IXKp16bihwweYbtkRKiiCU4sq4ip75Z3Xpl9EYz3MG7t1OAIICKauwNwxZNT7dwI4IAqMUnQ2qvmz02Bw9W6IFX9Cdu24G3HeuN3pNTvSe10p5t43DjX2NtesO6tEZ5Rj5jGlui0bxTv0ZUqkPHmrVtqVK6rehF-RLPnN0522GDTEq3Xc_qEJNum5NWXR81qskpY-26736mWlun6vXps4-mbpncFo3nnSF1TLk641Q4fPQVvPZojH1WdW-M4sMjhyjO3WbQNXSUBlw5-3xSeTOZTA7VqrRn_93A3TDlr33Cnu0wfkslW6f39I-XiCiPQxmDDO_TGPz_DCNxgZBk8gayuYTsU5pei4tonhUyD5NMAqtuTTtY5MkszJfwMV7CCCEsovG1uHgIZ0m6hMvO6Q263SWMcCzGUyHCVMb5b1uS7EMcSShkKJNCJlEBV1--Xk2FiD8v0jDJYDRfyGuIs8cxFHE6sP_BQz6fDfZUBEEQiEPbWPwIAAD__3aYOPU= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_shape b/pkg/sql/opt/exec/execbuilder/testdata/explain_shape index 83d7bcf7ba29..420a936fd6ad 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_shape +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_shape @@ -12,5 +12,5 @@ distribution: local vectorized: true · • scan - table: a@primary - spans: 1 span + table: a@a_pkey + spans: 1 span diff --git a/pkg/sql/opt/exec/execbuilder/testdata/expression_index b/pkg/sql/opt/exec/execbuilder/testdata/expression_index index 6d6a0ac38d20..f1857d352c5d 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/expression_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/expression_index @@ -23,7 +23,7 @@ SELECT * FROM [ ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -37,7 +37,7 @@ SELECT * FROM [ ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -51,7 +51,7 @@ SELECT * FROM [ ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -65,7 +65,7 @@ SELECT * FROM [ ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats @@ -79,7 +79,7 @@ SELECT * FROM [ ---- · • index join -│ table: t@primary +│ table: t@t_pkey │ └── • scan missing stats diff --git a/pkg/sql/opt/exec/execbuilder/testdata/fk b/pkg/sql/opt/exec/execbuilder/testdata/fk index 2dd37eee7159..24222119b0a6 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/fk +++ b/pkg/sql/opt/exec/execbuilder/testdata/fk @@ -34,7 +34,7 @@ vectorized: true └── • error if rows │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality: (column2) = (p) │ equality cols are key │ @@ -61,7 +61,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: xy@primary +│ table: xy@xy_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -77,7 +77,7 @@ vectorized: true │ └── • scan missing stats - table: parent@primary + table: parent@parent_pkey spans: FULL SCAN statement ok @@ -107,7 +107,7 @@ vectorized: true └── • error if rows │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality: (column2) = (p) │ equality cols are key │ @@ -152,7 +152,7 @@ vectorized: true └── • error if rows │ └── • lookup join (anti) - │ table: multi_col_parent@primary + │ table: multi_col_parent@multi_col_parent_pkey │ equality: (column2, column3, column4) = (p,q,r) │ equality cols are key │ @@ -201,7 +201,7 @@ vectorized: true │ └── • error if rows │ │ │ └── • lookup join (anti) -│ │ table: multi_ref_parent_a@primary +│ │ table: multi_ref_parent_a@multi_ref_parent_a_pkey │ │ equality: (column2) = (a) │ │ equality cols are key │ │ @@ -217,7 +217,7 @@ vectorized: true └── • error if rows │ └── • lookup join (anti) - │ table: multi_ref_parent_bc@primary + │ table: multi_ref_parent_bc@multi_ref_parent_bc_pkey │ equality: (column3, column4) = (b,c) │ equality cols are key │ @@ -260,7 +260,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: parent@primary +│ table: parent@parent_pkey │ spans: [/3 - /3] │ ├── • constraint-check @@ -304,7 +304,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: parent@primary +│ table: parent@parent_pkey │ spans: [/3 - /3] │ ├── • constraint-check @@ -368,7 +368,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: doubleparent@primary +│ table: doubleparent@doubleparent_pkey │ spans: [/10 - /10] │ └── • constraint-check @@ -403,7 +403,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -420,7 +420,7 @@ vectorized: true │ └── • scan missing stats - table: parent@primary + table: parent@parent_pkey spans: FULL SCAN query T @@ -442,7 +442,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: [/10 - /10] │ locking strength: for update │ @@ -451,7 +451,7 @@ vectorized: true └── • error if rows │ └── • lookup join (anti) - │ table: parent@primary + │ table: parent@parent_pkey │ equality: (p_new) = (p) │ equality cols are key │ @@ -477,7 +477,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: parent@primary +│ table: parent@parent_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -610,7 +610,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -636,7 +636,7 @@ vectorized: true │ └── • scan missing stats - table: grandchild@primary + table: grandchild@grandchild_pkey spans: FULL SCAN # This update shouldn't emit checks for c, since it's unchanged. @@ -659,7 +659,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -676,7 +676,7 @@ vectorized: true │ └── • scan missing stats - table: parent@primary + table: parent@parent_pkey spans: FULL SCAN query T @@ -696,7 +696,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -713,7 +713,7 @@ vectorized: true │ └── • scan missing stats - table: parent@primary + table: parent@parent_pkey spans: FULL SCAN query T @@ -735,7 +735,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -752,7 +752,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: parent@primary +│ table: parent@parent_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -777,7 +777,7 @@ vectorized: true │ └── • scan missing stats - table: grandchild@primary + table: grandchild@grandchild_pkey spans: FULL SCAN # Multiple grandchild tables @@ -803,7 +803,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: child@primary +│ table: child@child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -820,7 +820,7 @@ vectorized: true │ └── • scan missing stats - table: parent@primary + table: parent@parent_pkey spans: FULL SCAN statement ok @@ -845,7 +845,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: self@primary +│ table: self@self_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -862,7 +862,7 @@ vectorized: true │ └── • scan missing stats - table: self@primary + table: self@self_pkey spans: FULL SCAN query T @@ -884,7 +884,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: self@primary +│ table: self@self_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -910,7 +910,7 @@ vectorized: true │ └── • scan missing stats - table: self@primary + table: self@self_pkey spans: FULL SCAN # Tests for the insert fast path. @@ -929,7 +929,7 @@ vectorized: true estimated row count: 0 (missing stats) into: child(c, p) auto commit - FK check: parent@primary + FK check: parent@parent_pkey size: 2 columns, 2 rows row 0, expr 0: 1 row 0, expr 1: 1 @@ -1088,7 +1088,7 @@ vectorized: true │ └── • scan │ columns: (p, data) │ estimated row count: 333 (missing stats) -│ table: cascadeparent@primary +│ table: cascadeparent@cascadeparent_pkey │ spans: /2- │ └── • fk-cascade @@ -1200,7 +1200,7 @@ vectorized: true • insert fast path into: c(c, p) auto commit - FK check: p@primary + FK check: p@p_pkey size: 2 columns, 2 rows # These queries should not be using lookup joins (we're inserting more rows @@ -1236,7 +1236,7 @@ vectorized: true │ └── • scan estimated row count: 1 (100% of the table; stats collected ago) - table: p@primary + table: p@p_pkey spans: FULL SCAN query T @@ -1259,7 +1259,7 @@ vectorized: true │ │ │ └── • scan │ estimated row count: 33 (33% of the table; stats collected ago) -│ table: c@primary +│ table: c@c_pkey │ spans: [/1 - ] │ locking strength: for update │ @@ -1281,7 +1281,7 @@ vectorized: true │ └── • scan estimated row count: 1 (100% of the table; stats collected ago) - table: p@primary + table: p@p_pkey spans: FULL SCAN @@ -1301,7 +1301,7 @@ vectorized: true │ │ │ └── • scan │ estimated row count: 1 (100% of the table; stats collected ago) -│ table: p@primary +│ table: p@p_pkey │ spans: [/1 - ] │ └── • constraint-check @@ -1330,7 +1330,7 @@ vectorized: true • insert fast path into: c(c, p) auto commit - FK check: p@primary + FK check: p@p_pkey size: 2 columns, 10 rows query T @@ -1353,7 +1353,7 @@ vectorized: true │ │ │ └── • scan │ estimated row count: 33 (33% of the table; stats collected ago) -│ table: c@primary +│ table: c@c_pkey │ spans: [/1 - ] │ locking strength: for update │ @@ -1363,7 +1363,7 @@ vectorized: true │ └── • lookup join (anti) │ estimated row count: 32 - │ table: p@primary + │ table: p@p_pkey │ equality: (p_new) = (p) │ equality cols are key │ @@ -1390,7 +1390,7 @@ vectorized: true │ │ │ └── • scan │ estimated row count: 1 (100% of the table; stats collected ago) -│ table: p@primary +│ table: p@p_pkey │ spans: [/1 - ] │ └── • constraint-check @@ -1462,7 +1462,7 @@ vectorized: true │ └── • scan estimated row count: 10 (100% of the table; stats collected ago) - table: small_parent@primary + table: small_parent@small_parent_pkey spans: FULL SCAN # Test that partial indexes with IS NOT NULL predicates are used for performing @@ -1498,7 +1498,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: partial_parent@primary +│ table: partial_parent@partial_parent_pkey │ spans: [/1 - /1] │ └── • constraint-check @@ -1531,7 +1531,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: partial_parent@primary +│ table: partial_parent@partial_parent_pkey │ spans: [/1 - /1] │ locking strength: for update │ diff --git a/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index b/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index index 5e85a7f6f58c..f9f1f16dcbcb 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/hash_sharded_index @@ -120,5 +120,5 @@ vectorized: true • scan columns: (i2, i4, i8, f4, f8, s, c, b, dc, ival, oid, tstz, ts, da, inet, vb) estimated row count: 1 (missing stats) - table: sharded_primary_with_many_column_types@primary + table: sharded_primary_with_many_column_types@sharded_primary_with_many_column_types_pkey spans: /3/1/1/1/1/1/"1"/"1"/"1"/1/00:00:01/1/1970-01-01T00:00:01Z/1970-01-01T00:00:01Z/1/"\x00 \u007f\x00\x00\x01"/B/0 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/insert b/pkg/sql/opt/exec/execbuilder/testdata/insert index 09092c43a6fa..e6a31b806566 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/insert +++ b/pkg/sql/opt/exec/execbuilder/testdata/insert @@ -31,19 +31,19 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/primary/'A' -> NULL -fetched: /kv/primary/'a' -> NULL -fetched: /kv/primary/'a'/v -> 'b' -fetched: /kv/primary/'c' -> NULL -fetched: /kv/primary/'c'/v -> 'd' -fetched: /kv/primary/'e' -> NULL -fetched: /kv/primary/'e'/v -> 'f' -fetched: /kv/primary/'g' -> NULL -fetched: /kv/primary/'g'/v -> '' -fetched: /kv/primary/'nil1' -> NULL -fetched: /kv/primary/'nil2' -> NULL -fetched: /kv/primary/'nil3' -> NULL -fetched: /kv/primary/'nil4' -> NULL +fetched: /kv/kv_pkey/'A' -> NULL +fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'a'/v -> 'b' +fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c'/v -> 'd' +fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e'/v -> 'f' +fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g'/v -> '' +fetched: /kv/kv_pkey/'nil1' -> NULL +fetched: /kv/kv_pkey/'nil2' -> NULL +fetched: /kv/kv_pkey/'nil3' -> NULL +fetched: /kv/kv_pkey/'nil4' -> NULL output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -92,19 +92,19 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/primary/'A' -> NULL -fetched: /kv/primary/'a' -> NULL -fetched: /kv/primary/'a'/v -> 'b' -fetched: /kv/primary/'c' -> NULL -fetched: /kv/primary/'c'/v -> 'd' -fetched: /kv/primary/'e' -> NULL -fetched: /kv/primary/'e'/v -> 'f' -fetched: /kv/primary/'g' -> NULL -fetched: /kv/primary/'g'/v -> '' -fetched: /kv/primary/'nil1' -> NULL -fetched: /kv/primary/'nil2' -> NULL -fetched: /kv/primary/'nil3' -> NULL -fetched: /kv/primary/'nil4' -> NULL +fetched: /kv/kv_pkey/'A' -> NULL +fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'a'/v -> 'b' +fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c'/v -> 'd' +fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e'/v -> 'f' +fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g'/v -> '' +fetched: /kv/kv_pkey/'nil1' -> NULL +fetched: /kv/kv_pkey/'nil2' -> NULL +fetched: /kv/kv_pkey/'nil3' -> NULL +fetched: /kv/kv_pkey/'nil4' -> NULL output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -153,21 +153,21 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/primary/'A' -> NULL -fetched: /kv/primary/'a' -> NULL -fetched: /kv/primary/'a'/v -> 'b' -fetched: /kv/primary/'c' -> NULL -fetched: /kv/primary/'c'/v -> 'd' -fetched: /kv/primary/'e' -> NULL -fetched: /kv/primary/'e'/v -> 'f' -fetched: /kv/primary/'f' -> NULL -fetched: /kv/primary/'f'/v -> 'g' -fetched: /kv/primary/'g' -> NULL -fetched: /kv/primary/'g'/v -> '' -fetched: /kv/primary/'nil1' -> NULL -fetched: /kv/primary/'nil2' -> NULL -fetched: /kv/primary/'nil3' -> NULL -fetched: /kv/primary/'nil4' -> NULL +fetched: /kv/kv_pkey/'A' -> NULL +fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'a'/v -> 'b' +fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c'/v -> 'd' +fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e'/v -> 'f' +fetched: /kv/kv_pkey/'f' -> NULL +fetched: /kv/kv_pkey/'f'/v -> 'g' +fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g'/v -> '' +fetched: /kv/kv_pkey/'nil1' -> NULL +fetched: /kv/kv_pkey/'nil2' -> NULL +fetched: /kv/kv_pkey/'nil3' -> NULL +fetched: /kv/kv_pkey/'nil4' -> NULL output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -219,21 +219,21 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/primary/'A' -> NULL -fetched: /kv/primary/'a' -> NULL -fetched: /kv/primary/'a'/v -> 'b' -fetched: /kv/primary/'c' -> NULL -fetched: /kv/primary/'c'/v -> 'd' -fetched: /kv/primary/'e' -> NULL -fetched: /kv/primary/'e'/v -> 'f' -fetched: /kv/primary/'f' -> NULL -fetched: /kv/primary/'f'/v -> 'g' -fetched: /kv/primary/'g' -> NULL -fetched: /kv/primary/'g'/v -> '' -fetched: /kv/primary/'nil1' -> NULL -fetched: /kv/primary/'nil2' -> NULL -fetched: /kv/primary/'nil3' -> NULL -fetched: /kv/primary/'nil4' -> NULL +fetched: /kv/kv_pkey/'A' -> NULL +fetched: /kv/kv_pkey/'a' -> NULL +fetched: /kv/kv_pkey/'a'/v -> 'b' +fetched: /kv/kv_pkey/'c' -> NULL +fetched: /kv/kv_pkey/'c'/v -> 'd' +fetched: /kv/kv_pkey/'e' -> NULL +fetched: /kv/kv_pkey/'e'/v -> 'f' +fetched: /kv/kv_pkey/'f' -> NULL +fetched: /kv/kv_pkey/'f'/v -> 'g' +fetched: /kv/kv_pkey/'g' -> NULL +fetched: /kv/kv_pkey/'g'/v -> '' +fetched: /kv/kv_pkey/'nil1' -> NULL +fetched: /kv/kv_pkey/'nil2' -> NULL +fetched: /kv/kv_pkey/'nil3' -> NULL +fetched: /kv/kv_pkey/'nil4' -> NULL output row: ['A' NULL] output row: ['a' 'b'] output row: ['c' 'd'] @@ -331,7 +331,7 @@ vectorized: true └── • scan columns: (x, v) estimated row count: 1,000 (missing stats) - table: select_t@primary + table: select_t@select_t_pkey spans: FULL SCAN # Check that INSERT supports LIMIT (MySQL extension) @@ -357,7 +357,7 @@ vectorized: true └── • scan columns: (x, v) estimated row count: 1 (missing stats) - table: select_t@primary + table: select_t@select_t_pkey spans: LIMITED SCAN limit: 1 @@ -487,7 +487,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -603,7 +603,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -641,7 +641,7 @@ vectorized: true estimated row count: 0 (missing stats) into: t62270_child(c, p, rowid) auto commit - FK check: t62270_parent@primary + FK check: t62270_parent@t62270_parent_pkey size: 3 columns, 1 row row 0, expr 0: gen_random_uuid() row 0, expr 1: 1 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial index 2aa246cb2b2c..f7463998f587 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial @@ -21,7 +21,7 @@ vectorized: true │ filter: st_intersects('010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -44,7 +44,7 @@ vectorized: true │ filter: st_intersects('010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -67,7 +67,7 @@ vectorized: true │ filter: st_intersects('010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -88,7 +88,7 @@ vectorized: true │ filter: st_dfullywithin('010100000000000000000008400000000000000840', geom, 1.0) │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -113,7 +113,7 @@ vectorized: true │ filter: geom && '010100000000000000000008400000000000000840' │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -134,7 +134,7 @@ vectorized: true │ filter: 'BOX(3 3,3 3)' && geom │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -155,7 +155,7 @@ vectorized: true │ filter: '010200000002000000000000000000F03F000000000000F03F00000000000014400000000000001440' ~ geom │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -176,7 +176,7 @@ vectorized: true │ filter: geom ~ 'BOX(1 1,5 5)' │ └── • index join - │ table: geo_table2@primary + │ table: geo_table2@geo_table2_pkey │ └── • inverted filter │ inverted column: geom_inverted_key diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial_dist b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial_dist index f8ef7db88ab1..0121fc6d1fd8 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial_dist +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_geospatial_dist @@ -32,7 +32,7 @@ vectorized: true │ filter: st_intersects('01040000000200000001010000009A999999999901409A99999999990140010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -83,7 +83,7 @@ vectorized: true │ filter: st_intersects('01040000000200000001010000009A999999999901409A99999999990140010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -121,7 +121,7 @@ vectorized: true │ filter: st_intersects('01040000000200000001010000009A999999999901409A99999999990140010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -149,7 +149,7 @@ vectorized: true │ filter: st_coveredby('01040000000200000001010000009A999999999901409A99999999990140010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -190,7 +190,7 @@ vectorized: true │ filter: st_intersects('01040000000200000001010000009A999999999901409A99999999990140010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -218,7 +218,7 @@ vectorized: true │ filter: st_coveredby('01040000000200000001010000009A999999999901409A99999999990140010100000000000000000008400000000000000840', geom) │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -246,7 +246,7 @@ vectorized: true │ filter: geom && '010100000000000000000008400000000000000840' │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -270,7 +270,7 @@ vectorized: true │ filter: 'BOX(3 3,3 3)' && geom │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -294,7 +294,7 @@ vectorized: true │ filter: '010200000002000000000000000000F03F000000000000F03F00000000000014400000000000001440' ~ geom │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key @@ -318,7 +318,7 @@ vectorized: true │ filter: geom ~ 'BOX(1 1,5 5)' │ └── • index join - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ inverted column: geom_inverted_key diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array index 4d5aa67de233..2592dc572009 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array @@ -103,7 +103,7 @@ vectorized: true │ filter: (b @> '[[1, 2]]') OR (b @> '[[3, 4]]') │ └── • index join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ └── • sort │ order: +a @@ -147,7 +147,7 @@ vectorized: true │ filter: (b @> '[3]') OR (b @> '[[1, 2]]') │ └── • index join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ └── • sort │ order: +a @@ -214,7 +214,7 @@ vectorized: true └── • union all │ ├── • index join - │ │ table: json_tab@primary + │ │ table: json_tab@json_tab_pkey │ │ │ └── • sort │ │ order: +a @@ -226,7 +226,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [/44 - /44] # We cannot use the index for this query. @@ -244,7 +244,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # Array operations. @@ -298,7 +298,7 @@ vectorized: true └── • union all │ ├── • index join - │ │ table: array_tab@primary + │ │ table: array_tab@array_tab_pkey │ │ │ └── • sort │ │ order: +a @@ -310,7 +310,7 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [/1 - /1] # We cannot use the index for this query. @@ -328,5 +328,5 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array_dist b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array_dist index f7ac7d56914c..9d241e0ac7c0 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array_dist +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_filter_json_array_dist @@ -172,7 +172,7 @@ vectorized: true │ filter: (b @> '[[1, 2]]') OR (b @> '[[3, 4]]') │ └── • index join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ └── • sort │ order: +a @@ -222,7 +222,7 @@ vectorized: true │ filter: (b @> '[3]') OR (b @> '[[1, 2]]') │ └── • index join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ └── • sort │ order: +a @@ -298,7 +298,7 @@ vectorized: true └── • union all │ ├── • index join - │ │ table: json_tab@primary + │ │ table: json_tab@json_tab_pkey │ │ │ └── • sort │ │ order: +a @@ -310,7 +310,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [/44 - /44] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lFFP2zAUhd_3K6z7AmhBiZ20hUiTykamdWKUpUjbxKLJbTzIVOLMdicQ6n-fkrCmKcRu1og3N_Z377HvOX0A-XsOPgRfL85ORudo_3Q0uZx8PjtAk-AseHeJKHofjj-hX5KnPxSdoi8fgjBA-1M0_L5wHJehvSsc7R2gcYj2KXqDPC9fnwYhevsNUbAg5TE7p7dMgn8FGCwgYIELkQWZ4DMmJRf51kNxcBTfge9YkKTZQuWfIwtmXDDwH0Alas7Ah0s6nbOQ0ZgJ2wELYqZoMi_K_1M5zERyS8U9WDDJaCp9ZHtecXi8UD4aYmtIIFpawBeqaiQVvWbg46W1vZjTRKoknSn7uK5kmN90LGImWJw33OhWFZjeoxsqb57Q0bJS1GtUVNXhZa_NOq_LQo2yMWmlu9LU71zTOT_kmY3d-vHHgTXqGNR04O2tgxusUyyS9M-ad7Bjnwhh48PVyr4Q7GdyF6Rx5alGiaSNxAkXignbfe7Rni_vtin_kSfp4wP0jNnZIixem-Yr1w1eLCy407A4nYSFbG9Ssr1JycqkZHeTGiQ-mtT7X5Mayq-ZtN-9SQ3NV9M-ejGTkk5Nijv_R3-mXchkxlPJar2aKju5YBZfs_KCki_EjF0IPivalD_HBVd8iJlU5S4uf4zScisXuA7jTRivw0c1GLeDsbsLTfQw0V7a0NnVv5infzJPS_f0cE8L9_VwXwsP9PBgl0nrYdOk9bRh0ke7TPpYP2nHEA5DtEzZeuLwOk4M-BOPt8qmnjaGU48bZob1CdvsHS1f_Q0AAP__NmxOwg== @@ -328,7 +328,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkd_Km0AQxe_7FMPcfAa2xLV3CwXzx1CLiakG2pJK2egQLMY1uyu0BN-9qJTEQkq_yzlnz8yPszc01woFBl_20SLcgbMO00P6KZpBGkTB6gASNkm8hR9G1d-tPMHnD0ESgHMC_1vruu8IXo48e5lBnIBjrto6Uoh1sAq3i2gG78HrnXWQwPIrSGRYq4J28kIGxRE5ZgwbrXIyRuleug0PwuInCpdhWTet7eWMYa40obihLW1FKPAgTxUlJAvScxcZFmRlWQ1r_7D6jS4vUv9ChmkjayPgLTKMWyvA58z3MOsYqtbejxgrz4SCd-z_QTZlZUmTnvMpxagLcHxv2pUQ4mMa75YPnfl8Wpq4j3fip7jea3ATMo2qDU1gn212u4whFWca_8aoVue01yofzoxjPOQGoSBjR5ePQ1iPVg_4GOb_DHt_hbPuze8AAAD__3Di014= @@ -416,7 +416,7 @@ vectorized: true └── • union all │ ├── • index join - │ │ table: array_tab@primary + │ │ table: array_tab@array_tab_pkey │ │ │ └── • sort │ │ order: +a @@ -428,7 +428,7 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [/1 - /1] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0lF9r2zAUxd_3KcR9acpUbNn5axhkWzyWkSWdHdjGZopiX4ohtTxJHivB333EDm1dEsVJ6YuxpPu751wd0AbUnzV44P-4nr2fzklnMg2X4bfZJQn9mf9xSTj5FCy-Ei4lv7_RfEW-f_YDn3RWZPy7sG0XycWGlReXZBGQDifvCNv-TvyAfPhJOFDIRIJzfocKvF_AgIIDFFyIKORSxKiUkNujTVU4Tf6BZ1NIs7zQ9bZO9RrBAyETlJgAhQQ1T9dVvzF7C1EZUYiFRPAeq-fiSuTWsFEdlRREoXedIwpK81sEr1fSA-p7Gk9SpdMs1tbouROgsKg9eqReFbr6O6Tbb-gys-6Sr9YYIE9QWqwp_ZDNmEt5k2Z_gUKY80x5xGK2xa62X6eFIecUQ6GQGqXl7gtkf3v3lPZfRJrtxu0dGjeX6R2X94-T0bFzUL3bUHfa37Z9XP7htqviFmbYuWac9tE7VfTOOdEfMbSLvntu9EfaP4m-_8rRv-x5GbR6XuxTnpcAVS4yhS07RxQwucV6FCUKGeO1FHElUy8XFVdtJKh0fcrqxTSrj7YGn8LMDNtm2jHSrhl2jXDXDHeNcNM2ew73jPDIDPeN8MBse2CEh2Z4-BLbo5MuLCrf_A8AAP__OQalPQ== @@ -448,7 +448,7 @@ vectorized: true └── • union all │ ├── • index join - │ │ table: array_tab@primary + │ │ table: array_tab@array_tab_pkey │ │ │ └── • sort │ │ order: +a @@ -464,7 +464,7 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [/1 - /1] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlV9P2zwUxu_fT3F0bgC9QY2dlkKkSd1G0DoxylqkbVor5DZHEKnYme0iEOp3n5J0LSmt0yA07QbhP4_Pz-d54j6h-TXFEKPvl-fvuxewf9odXA2-nh_AIDqPPl6BgLN-7wsIrcXjtRVj-PYp6kewvz-GznDm-wHB3hOb7x1Arw-lST7fOyhmBbwDlv17GvXhww8Q6KFUMV2IOzIY_kSGHnL0MMCRh6lWEzJG6WzpKd_YjR8w9D1MZDqzxbRN7JQwxJlUOiZNMXoYkxXJNFsfzUceTpQmDFdbTxNjEzmxjVZpL3ay8r2ZDaHDcDT3UM3sos7IQ2PFDWHYnHtbWDZUGihtSTeO1uv8v_X4Vp3jP6tE9knEpBvtcomlTZ1UJ3dCP65u5nX41upHdaov23i8qY2FGRtauTpg_Ai3wty-UOemLYjaW4lW52wyftFkFzbza3GvmI7fnOlCHaq0wXh5e1UUT0oczO3WlRhPaREWti0sQuvrRN6jh4NUSBNCg_kNdpj9DXZLEK_D1JX3pC3FZ8nUkiadF3kG9mc9ekg1KAkdFoLJwMBYoW04xOGQMzZEIBkvRsEQYStdUKLju3fMr_68lh3LN-_QKvZaGL67fTy3j7_SvgqmF_Y1_yX7lt_5yV97nvibPk_szZ-nDeX6ZFIlDa39am4-2c-AKb6h4oJGzfSELrWa5GWKYS_X5RMxGVussmLQlcVSBvhczJxi7hZzpzhwi4N1MXsubpbErJ6Ycbe66eRuucUtd7srbn3kVLfd4rZT7Lu5j93cFTk5cav9ipS5M1pBzl6EtE5UKtRVWWHukK-HZTT_73cAAAD__yXI0Rs= @@ -482,7 +482,7 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkVFr2zAQx9_3KY57qQMqkeWXISg4W1xmyJxOCWwlM0OJj2JwLU-SYSX4uw_bIW0G8bbH--v-5x_-HdH9rFBi8u1htUgzCJbpZrv5sprBJlklH7eg4V6tP4O2Vr_88HoPXz8lKoEg2EP8veU8Irg5iu5mBotsCYGGO4hmM1grCPY7nsMd6H5aJgo-PIJGhrUpKNPP5FDuMESGEeYMG2sO5JyxfXwcltLiF0rOsKyb1vdxzvBgLKE8oi99RSgxM7emmQtkWJDXZTWsdQxN619LzusnQhl17M3hcPrwVu8rUqQLsnN-cR7P_yJubPms7Qsy3DS6dhJukeG69RLikMUCr5GE_0NyX1aeLNl5eIkx5hKCIBZnFwulFo87IaVMs-37_GQlDnstp_BkZ8hisePn3Vf2q-DiAvwvbhS5xtSO_kkO73KGVDzR6N-Z1h7owZrD8JlxXA-9ISjI-fE1Goe0Hp96wLflcLIspstissz_KOfdu98BAAD__xs0B0Q= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_index b/pkg/sql/opt/exec/execbuilder/testdata/inverted_index index 8fcd886cdece..f6589a66ab38 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_index @@ -174,7 +174,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -192,7 +192,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -210,7 +210,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -228,7 +228,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -246,7 +246,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -264,7 +264,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -284,7 +284,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • project @@ -314,7 +314,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • project @@ -341,7 +341,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -359,7 +359,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -386,7 +386,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • project @@ -413,7 +413,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • project @@ -447,7 +447,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -479,7 +479,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -506,7 +506,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b->'a') @> '[1, 2]' @@ -535,7 +535,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -562,7 +562,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -585,7 +585,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -617,7 +617,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: d@primary + table: d@d_pkey spans: FULL SCAN query T @@ -634,7 +634,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -661,7 +661,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • scan @@ -685,7 +685,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: d@primary + table: d@d_pkey spans: FULL SCAN query T @@ -695,7 +695,7 @@ distribution: local vectorized: true · • index join -│ table: d@primary +│ table: d@d_pkey │ └── • sort │ order: +a @@ -716,7 +716,7 @@ distribution: local vectorized: true · • index join -│ table: d@primary +│ table: d@d_pkey │ └── • sort │ order: +a @@ -741,7 +741,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '{"a": {"b": "c"}, "f": "g"}' @@ -765,7 +765,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 1 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '{"a": {"b": "c", "d": "e"}, "f": "g"}' @@ -789,7 +789,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '[{"a": {"b": [[2]]}}, "d"]' @@ -816,7 +816,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '{"a": {"b": "c"}, "f": "g"}' @@ -840,7 +840,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 1 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '{"a": {"b": "c", "d": "e"}, "f": "g"}' @@ -864,7 +864,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '[{"a": {"b": [[2]]}}, "d"]' @@ -891,7 +891,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • project @@ -918,7 +918,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: d@primary +│ table: d@d_pkey │ key columns: a │ └── • project @@ -947,7 +947,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: d@primary + │ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '[1, 2]' @@ -972,7 +972,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: d@primary + │ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> '[1]') AND (b @> '[2]') @@ -997,7 +997,7 @@ vectorized: true │ order: +a │ └── • lookup join - │ table: d@primary + │ table: d@d_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> '[[1, 2]]' @@ -1022,7 +1022,7 @@ vectorized: true • index join │ columns: (a, b) │ estimated row count: 110 (missing stats) -│ table: e@primary +│ table: e@e_pkey │ key columns: a │ └── • scan @@ -1045,7 +1045,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: e@primary + table: e@e_pkey spans: FULL SCAN # Test that searching for a NULL element using the inverted index. @@ -1063,7 +1063,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: e@primary + table: e@e_pkey spans: FULL SCAN query T @@ -1089,7 +1089,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: e@primary + table: e@e_pkey spans: FULL SCAN # This should use a zigzag join. @@ -1102,7 +1102,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: e@primary +│ table: e@e_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> ARRAY[1,2] @@ -1126,7 +1126,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b) │ estimated row count: 12 (missing stats) -│ table: e@primary +│ table: e@e_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> ARRAY[1]) AND (b @> ARRAY[2]) @@ -1156,7 +1156,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: e@primary + │ table: e@e_pkey │ key columns: a │ └── • scan @@ -1179,7 +1179,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: e@primary + │ table: e@e_pkey │ key columns: a │ └── • project @@ -1211,7 +1211,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: e@primary + │ table: e@e_pkey │ key columns: a │ └── • scan @@ -1234,7 +1234,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: e@primary + │ table: e@e_pkey │ key columns: a │ └── • project @@ -1266,7 +1266,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • scan @@ -1290,7 +1290,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -1322,7 +1322,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • scan @@ -1345,7 +1345,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -1377,7 +1377,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 111 (missing stats) - │ table: d@primary + │ table: d@d_pkey │ key columns: a │ └── • project @@ -1434,7 +1434,7 @@ vectorized: true └── • index join │ columns: (k, geom) │ estimated row count: 111 (missing stats) - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ key columns: k │ └── • project @@ -1505,7 +1505,7 @@ vectorized: true │ └── • lookup join (inner) │ columns: (k, geom, k, k, geom) - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ equality: (k) = (k) │ equality cols are key │ pred: st_intersects(geom, geom) @@ -1522,7 +1522,7 @@ vectorized: true └── • scan columns: (k, geom) estimated row count: 1,000 (missing stats) - table: geo_table2@primary + table: geo_table2@geo_table2_pkey spans: FULL SCAN # Do not use the index when using a _ prefixed builtin. @@ -1544,7 +1544,7 @@ vectorized: true └── • scan columns: (k, geom) estimated row count: 1,000 (missing stats) - table: geo_table@primary + table: geo_table@geo_table_pkey spans: FULL SCAN query T diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_index_geospatial b/pkg/sql/opt/exec/execbuilder/testdata/inverted_index_geospatial index 3d77ba4202a8..8d8ed3ed7d4c 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_index_geospatial +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_index_geospatial @@ -51,7 +51,7 @@ regions: │ KV contention time: 0µs │ KV rows read: 2 │ KV bytes read: 16 B - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ nodes: @@ -129,7 +129,7 @@ regions: │ KV contention time: 0µs │ KV rows read: 2 │ KV bytes read: 16 B - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ nodes: @@ -191,7 +191,7 @@ regions: │ KV contention time: 0µs │ KV rows read: 2 │ KV bytes read: 16 B - │ table: geo_table@primary + │ table: geo_table@geo_table_pkey │ └── • inverted filter │ nodes: diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial index 6f379bb9267f..6fb6c126fba2 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial @@ -26,7 +26,7 @@ distribution: local vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -36,7 +36,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUksGO0zAQhu88xWhOW2lgm3Th4JMRFCmr0ixtD0goWoV4VJmmdrAdVFT13ZGdFUsLregtM55v_OmP9-i_tyhw-vlh9raYw837YrlafpqNYDmdTd-toN0QuE0GHxblR2hD_bVluC-LObj0Lddst4_aKN5BOQcfHrUJ7Dw3wd8M46_iSEZPQKpGSGis4nm9ZY_iC2ZYEXbONuy9dbG1TwOF2qEYE2rT9SG2K8LGOkaxx6BDyyhwFdcuuFbsbsdIqDjUuk1rBwHZOb2t3U8kXHa18QJeImHZBwEyI5ljdSC0fXi-wod6zSiyA_2_RmF-sAus7q027G6zY5O_0kL6TUx3nTtJTuYE8m50pElyQvL1Wdn8Gtko-RRZ_k_R58hm1m76Dr5ZbcAaAdHiLoqd_u3k_ObI-bzt5BrbBfvOGs9Hpuc2jw8VIas1D6_I2941_OBsk64ZyjJxqaHYh-E0G4rCDEdR8E84uwjnl-H8Ijw5gavDi18BAAD__7oxLRY= @@ -49,7 +49,7 @@ distribution: local vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -59,7 +59,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -70,7 +70,7 @@ distribution: local vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_dwithin(geom1, geom, 5.0) @@ -80,7 +80,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -111,7 +111,7 @@ vectorized: true └── • lookup join (inner) │ columns: (lk, geom1, rk1, rk2, rk1, geom) │ ordering: +lk - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom, geom1) OR st_dwithin(geom1, geom, 2.0) @@ -131,7 +131,7 @@ vectorized: true columns: (lk, geom1) ordering: +lk estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -162,7 +162,7 @@ vectorized: true └── • lookup join (inner) │ columns: (lk, geom1, rk1, rk2, rk1, geom) │ ordering: +lk - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) AND st_dwithin(geom, geom1, 2.0) @@ -182,7 +182,7 @@ vectorized: true columns: (lk, geom1) ordering: +lk estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -204,7 +204,7 @@ vectorized: true │ └── • lookup join (inner) │ columns: (lk, geom1, geom2, rk1, rk2, rk1, geom) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: (st_intersects(geom1, geom) AND st_covers(geom2, geom)) AND (st_dfullywithin(geom, geom1, 100.0) OR st_intersects('0101000000000000000000F03F000000000000F03F', geom)) @@ -221,7 +221,7 @@ vectorized: true └── • scan columns: (lk, geom1, geom2) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN # This query performs a semi-join, which is converted to paired joins by the @@ -243,7 +243,7 @@ vectorized: true │ └── • lookup join (semi) │ columns: (lk, geom2, rk1, rk2, cont) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom2, geom) @@ -260,7 +260,7 @@ vectorized: true └── • scan columns: (lk, geom2) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN # Left outer joins are also converted to paired joins by the optimizer. @@ -281,7 +281,7 @@ vectorized: true │ └── • lookup join (left outer) │ columns: (lk, geom1, rk1, rk2, cont, rk1, geom) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -298,7 +298,7 @@ vectorized: true └── • scan columns: (lk, geom1) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -339,7 +339,7 @@ vectorized: true │ │ │ └── • lookup join (left outer) │ │ columns: (lk, geom1, rk1, rk2, cont, geom) -│ │ table: rtable@primary +│ │ table: rtable@rtable_pkey │ │ equality: (rk1, rk2) = (rk1,rk2) │ │ equality cols are key │ │ pred: st_intersects(geom1, geom) @@ -373,7 +373,7 @@ vectorized: true │ └── • scan │ columns: (lk, geom1, geom2) │ estimated row count: 333 (missing stats) -│ table: ltable@primary +│ table: ltable@ltable_pkey │ spans: /3- │ └── • subquery @@ -412,7 +412,7 @@ vectorized: true │ └── • lookup join (anti) │ columns: (lk, geom2, rk1, rk2, cont) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom2, geom) @@ -429,7 +429,7 @@ vectorized: true └── • scan columns: (lk, geom2) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -452,7 +452,7 @@ vectorized: true │ └── • lookup join (anti) │ columns: (lk, geom1, rk1, rk2, cont) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_covers(geom1, geom) @@ -470,7 +470,7 @@ vectorized: true └── • scan columns: (lk, geom1) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN # Bounding box operations. @@ -494,7 +494,7 @@ vectorized: true │ └── • lookup join (inner) │ columns: (lk, geom1, rk1, rk2, rk1, geom, rk2) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: geom1 ~ geom @@ -511,7 +511,7 @@ vectorized: true └── • scan columns: (lk, geom1) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -531,7 +531,7 @@ vectorized: true │ └── • lookup join (inner) │ columns: (lk, geom1, rk1, rk2, rk1, geom, rk2) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: geom ~ geom1 @@ -548,7 +548,7 @@ vectorized: true └── • scan columns: (lk, geom1) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN query T @@ -568,7 +568,7 @@ vectorized: true │ └── • lookup join (inner) │ columns: (lk, geom1, rk1, rk2, rk1, geom, rk2) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: geom && geom1 @@ -585,7 +585,7 @@ vectorized: true └── • scan columns: (lk, geom1) estimated row count: 1,000 (missing stats) - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN statement ok @@ -599,7 +599,7 @@ CREATE INVERTED INDEX foo_inv ON g(geom) # This query performs an inverted join. query T -EXPLAIN SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k +EXPLAIN SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k ---- distribution: local vectorized: true @@ -608,7 +608,7 @@ vectorized: true │ order: +k,+k │ └── • lookup join - │ table: g@primary + │ table: g@g_pkey │ equality: (k) = (k) │ equality cols are key │ pred: st_contains(geom, geom) @@ -618,12 +618,12 @@ vectorized: true │ └── • scan missing stats - table: g@primary + table: g@g_pkey spans: FULL SCAN # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k +EXPLAIN SELECT g1.k, g2.k FROM g@g_pkey AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) ORDER BY g1.k, g2.k ---- distribution: local vectorized: true @@ -636,17 +636,17 @@ vectorized: true │ ├── • scan │ missing stats - │ table: g@primary + │ table: g@g_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: g@primary + table: g@g_pkey spans: FULL SCAN # This query performs an inverted join with an additional filter. query T -EXPLAIN SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@primary AS g2 +EXPLAIN SELECT g1.k, g2.k FROM g@foo_inv AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)'::geometry)) AND g2.k < 20 @@ -659,7 +659,7 @@ vectorized: true │ order: +k,+k │ └── • lookup join - │ table: g@primary + │ table: g@g_pkey │ equality: (k) = (k) │ equality cols are key │ pred: st_contains(geom, geom) AND st_contains(geom, '010300000001000000050000000000000000000000000000000000000000000000000000000000000000001440000000000000144000000000000014400000000000001440000000000000000000000000000000000000000000000000') @@ -669,12 +669,12 @@ vectorized: true │ └── • scan missing stats - table: g@primary + table: g@g_pkey spans: [ - /19] # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT g1.k, g2.k FROM g@primary AS g1, g@primary AS g2 +EXPLAIN SELECT g1.k, g2.k FROM g@g_pkey AS g1, g@g_pkey AS g2 WHERE ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 5 0, 0 0)'::geometry)) AND g2.k < 20 @@ -691,7 +691,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: g@primary + │ table: g@g_pkey │ spans: [ - /19] │ └── • filter @@ -699,5 +699,5 @@ vectorized: true │ └── • scan missing stats - table: g@primary + table: g@g_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial_dist b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial_dist index 57470c599325..6523d8006eb4 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial_dist +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_geospatial_dist @@ -55,7 +55,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -65,7 +65,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElF1v2jAUhu_3K6xzVVSz4CT0I1fZVialYqSDXmyaUJUlR13WYGe2mZgQ_31Kwgah4IR9iDuM_eZ9fPTIS1DfMvBg8OFu-CoYkbObYHI_eT_skMlgOHhzT7InSuQTeTsO35FMR58zJLdhMCKy_O0_opg9pDzBBQlHROmHlGuUCmOtzqrjL4sjjK4D5apDwvHNYExefyRn1fc7QIGLBEfRDBV4n4ABBRsoODClkEsRo1JCFlvL8mCQLMDrUUh5PtfF31MKsZAI3hJ0qjMED-6LwjFGCUqrBxQS1FGalZ-v0PxcprNI_gAKkzziyiNdqygN59ojPqO-DdMVBTHXmxKlo0cEj61oe5CAf0epMbkVKUdpOXWWZ5ME-jsxWORyZ6q-TYnvdmqY1HcOktrHkBaE64ld7KXcTGwoxNM8J19FyongHvGLaz1zoKTt12jdg6jOMagTITVK67qO6bNz6tvnQGEW6fgLyZB7hB1sdA82boqETFBisr9nutqDNhJdkVvMrkUOIfRrCKy90qyd0pbdLY07WuoGlB2p3RNK3UC6JfXlqaVuQF1LzXr_0Gq7vVJ2S6Wc7p8I1QCyI1T_hEI1kG4JdXVqoRpQfwnF_tMzuadyjCoXXGGr169XvJ-YPGL15ioxlzHeSRGXNdUyLHPlHwkqXe2yahHwaqsA3A4zY9g2h21j2DGHHWPYrYXZbtg137mhum9MX5jDF8bwpTl8aQxfmcNXfzOxa_PEeg2aNEjWZJlZM9bgGTOLtnvz6erFzwAAAP__HnjL0g== @@ -82,7 +82,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom, geom1) OR st_dwithin(geom1, geom, 2.0) @@ -92,7 +92,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlV1v2j4Uxu__n8I6V6Cagh1oqa_S_0olKkY64GLThKqMHLVZg53ZZutU8d2nJN1KKDjpXqT2Dr_8OM9zeI65B_MlAQGD95ej0-GYNM6G09n03ahJpoPR4M2MJLeU6FtyPgneksSGnxIkF8FwTHT-2b9GtbyKZYR3JBgTY69iaVEbXFjTKK4cZlfoA5svWJMEk-xu9C22N7FsbJ5RUsJ4dvdsMCH_fyCNQksTKEgV4ThcogHxERhQ4EDBgzmFVKsFGqN0dnSfXxxGdyA6FGKZrmy2PaewUBpB3IONbYIgYJbVnGAYoW53gEKENoyT_OsLdX6q42WovwOFaRpKI0irnRUNVlYQn1Gfw3xNQa3sYxFjw2sEwda0vpCh_IraYnShYom67ZW1POk60F_E4C7VW7-Azynxu9vtLnYp4YcdIcT5KDid9ZslK9T39rrhz3GTuXjo6tFOJ49dHSl1u0rJZxVLoqQgfmb9Sab8HiU-3-mo53DU3WvHe46dqdIWdfukbMVnB9TnB0BhGdrFDUlQCsL2VuzurfhYSOkINUa768zXO6SNVUulbcZLyD4JvZIEVn80WL3RaPNWntxnD0eFlK3h6L7w4ahwszEcx69hOCrsPAwH6_zF6eD1o8lrRtNr_U4wK4RsBbP3woNZ4WYjmP3XEMwKOz-Dyf7Rs72j5ARNqqTBWq9xJ3vPMbrG4j_AqJVe4KVWi7xMsQxyLt-I0NjilBWLoSyOMoGbMHPC3A1zJ-y5Yc8Jd0sw24a7bs8VpXtO-sgNHznhYzd87IT7brj_Jx07cXesUxGTipBVpcwdM1aRM-YO2rbz-fq_HwEAAP__1ugV_g== @@ -109,7 +109,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom1, geom) AND st_dwithin(geom, geom1, 2.0) @@ -119,7 +119,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlV1v2j4Uxu__n8I6V6Cagh1oqa_S_0olKkY64GLThKqMHLVZg53ZZutU8d2nJN1KeHFgL1J7h19-nOc5PMc8gvmSgIDe--vBeX9Iahf98WT8blAn496g92ZCkntK9D25HAVvSWLDTwmSq6A_JDr_7N-imt_EMsIHEgyJsTextKgNzqypFdePsyuMPgH5qk7OhxfZ5ehbbO9iWVs5o6SM8ToJRhe9Efn_A6kVYupAQaoIh-EcDYiPwIACBwoeTCmkWs3QGKWzo8f8Yj96ANGiEMt0YbPtKYWZ0gjiEWxsEwQBk6zoCMMIdbMFFCK0YZzkX18I8lMdz0P9HSiM01AaQRrNrGiwsIL4jPocpksKamGfixgb3iIItqT7C-nLr6gtRlcqlqibXlnLRtuB_iJ6D6le-wl8Tonf3uh3sU0JP24JIS4HwfmkWy95ob630w4_xE5m46mtJ1utPLd1oNT9IiWfVSyJkoL4mfeNVOXaO5uWOpRkRzsttXf68Q7xM1baom6elb347Ij6_AgozEM7uyMJSkHYzortnRWfCykdocZoe53pcou0oWqotMl4CdkloVOSwPYfDrbfcDR5I8_uweNRIWVtPNovfTwq7KyMx-mrGI8KP0_jwVp_cT74_uHke4bTa_xONCuErEWz89KjWWFnJZrdVxHNCj8_o8n-0dO9peQITaqkwb1e5Fb2pmN0i8X_gFELPcNrrWZ5mWIZ5Fy-EaGxxSkrFn1ZHGUCV2HmhLkb5k7Yc8OeE26XYLYOt92eK0p3nPSJGz5xwqdu-NQJd91w9086dubuWKsiJhUhq0qZO2asImfMHbR159Plfz8CAAD__ytAF1w= @@ -134,7 +134,7 @@ distribution: full vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: (st_intersects(geom1, geom) AND st_covers(geom2, geom)) AND (st_dfullywithin(geom, geom1, 100.0) OR st_intersects('0101000000000000000000F03F000000000000F03F', geom)) @@ -144,7 +144,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzslUFv4jgUx-_7Kax3KUgG4gRS6lOqLaxS0aQLHHY1QlWGeDqZpnbGdjqtKr77KEk1JQFMqtHc4ITt9_P_5f_ek19BfU-BwuS_29mlH6DOlb9YLv6dddFiMpv8vUTpA0byAU3n4Q1KdfQ5Zeg69AMky__ePROPdwmP2TMKA9RR-i7hmknF1lp1qvh-EUPwG1GuuugyuEJK363FE5O1QLseWEUW98Zf8jR9-ZHorwnvbIVgVJchltVF4RzVUzm7Df1g2SF9C5G-1T1rqAAGLmIWRI9MAf0EBDDYgMGBFYZMijVTSsji6LUM9ONnoBaGhGe5LrZXGNZCMqCvoBOdMqCwLO6fsyhmcmABhpjpKEnL66uMvUwmj5F8AQyLLOKKot7AhtUGg8j1-71KR_cMKNng9to-f2JSs_haJJzJgVOX36kd4F_E5DmTzTp6NkbeqFk0zyl3D1SoYspy9C1K6XQWXi7H-ypjEYtYO7-p5Uyb6zNK6T-T8GaynP9faQOGMNcUeQR7NvYc7A0PGmh_xMDCuLfauXvNe6_dTIiHPEPfRMKR4BR5wyKrnWEoDXH3mugeNNHFqOD-oIlu3cTRQfucg_a9u5ZzIWMmWVyzbLXZY3AgeiIbXDQC90sPa9Kk_diRdmM3sHsDp-XgHVFvDN7wNHjNwTti4NbgnZ8Gb3fw7Pbdb7fsfqfXsvePaDd6f3Tq_WbvHzFwq_fHp943Pzp77JszlQmuWKs3xSoeJRbfs-oFUyKXa3YrxbqUqZZhyZUbMVO6OiXVwufVUZHgNkyMsG2GbSPs1GDShB1z2pZZemikR2Z4ZIRdM-z-zkefG-GxWXlshC_M8MWH0l5t_voZAAD__6-2LRk= @@ -159,7 +159,7 @@ distribution: full vectorized: true · • lookup join (semi) -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom2, geom) @@ -169,7 +169,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlE9v2kAQxe_9FKs5JdVSsA0k-OSqdVRHBFJAaqQKRa53ityYXXd3XREhvnu1Ni1_BItpL8lxvPM87zd6miWonxn4ED7c999HA3LxMRpPxp_7l2Qc9sMPE5I9kZvR8I5kOv6WIfnyKRyFJHwwXeRi3fO2apHbLUo_plyjVJhodVGp381QzF26biyry0ugwAXDQTxHBf5XcICCCxQ8mFLIpUhQKSHN07JsjNgC_BaFlOeFNp-nFBIhEfwl6FRnCD5MzP9HGDOUzRZQYKjjNCt_XzkJcpnOY_kMFMZ5zJVPGk0zdFhonwQODTyYriiIQm-GKB3PEHxnResbifgvlBrZrUg5yqa366XaQ2D28JhyhgugfxXhIpd7SwxcSoK2Wdj3VCpNfoiUk5STPE4lsoYptxFcGng06BwFcc8BMQDrhXZ3ISbPOfqkH95MyDi8i8jtMBoA_cO22XNfiKcir0wL7pPALGM4OMTYNYwKE8GZHfIom3eUbYNUcCEZSmQ7PNPVAfqBaIi82dtrPDy6vTPaqR9Up15Qm26jzNHZUT1hZS-q7Zcb1RMgW1G9enVRdevnxa2ZF6_xL2k5YWQvLZ2Xm5YTIFtpuX51aTlxtEeocsEV1rpbLXP4kM2wupJKFDLBeymSckxVDktd-YGh0tWrUxURr56MwW2xYxW7drFrFXs7Ymdf7Nltt-yj21Z1xy7uWMVdu7j7P9BXVvG1ffK1Vdyzi3tn2Z6u3vwOAAD__5qPa_k= @@ -183,7 +183,7 @@ distribution: full vectorized: true · • lookup join (left outer) -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -193,7 +193,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlF9vmzAUxd_3Kaz71ErOEiBJW56YNipRZaFLmDRpiiqG7ypWYjPbTKmifPfJUC1_1hiyPeXR2Mf3nMNPXoP6WYAP4Zf7ybtoSi4-RPNk_mlySebhJHyfkOKJEvlEbmfxR1Lo9FuBZBLeJuQujqZENh_iKVH6IecapcJMq4vm4NtHFEuHvpyqV5dAgQuG03SJCvyv4AAFFyh4sKBQSpGhUkKarXV9MGIr8AcUcl5W2nxeUMiERPDXoHNdIPiQmOtnmDKU_QFQYKjTvKivb4wEpcyXqXwGCvMy5convb4ZGlfaJ4FDAxcWGwqi0tshSqePCL6zod2NRPwXSo3sTuQcZd_b95I8l-g35cWfk3BWVwgUmnoCU89DzhmugP65KVyV8qDbwKUkGJoiv-dSafJD5JzknJRpLpH1zHIvGg08GoyOBnRPCWiCvRQ9Pinc9gdMhHiqysa14D4JTEt_AVSHHJuQCjPBWVvK4_m8o_m2sSouJEOJbC_TYvNKA1PRE2X_5uDg66OHe6Od7hA73SDuu72asZMxbrFygPHw_DBuCbiD8dVZYux2Z8ntyJLX-xeSWowckDQ6P5JaAu6QdH2WJLU8-DNUpeAKO713A_NgInvE5nVVopIZ3kuR1WOaZVzr6g8MlW52nWYR8WbLGNwVO1axaxe7VrG3J3YOxZ7d9sA-emhVj-zikVU8tovH_xP6yiq-tk--topv7OKbk2wvNm9-BwAA__8Y9H45 @@ -211,7 +211,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join (left outer) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom, geom1) OR st_dwithin(geom1, geom, 2.0) @@ -221,7 +221,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzcVU1vGjsU3b9fYd0VUUzA5iPEq8l7IRIRj0mBSq0qFE1nbpNpBntqmzZRxH-vZiZtGAIe6MeGpT-Oz7nn3iM_gfmSgID-u-vh-WBEaheDyXTyZnhEJv1h_78pSe4p0ffkcuz_TxIbfEyQDPuXU3LlD0ZE5xveLar5TSwjfCD-iBh7E0uL2mBoTa24cpJdoc8P5At2RPxxdjf6Ftu7WNZWzygpwXh296I_Jv--J7VC0BFQkCrCUTBHA-IDMKDAgUILZhRSrUI0Runs6Cm_OIgeQDQpxDJd2Gx7RiFUGkE8gY1tgiBgmnGOMYhQN5pAIUIbxEn-fKHOS3U8D_QjUJikgTSC1BsZqb-wgniMehxmSwpqYV9IjA1uEQRb0t2FDORX1BajKxVL1I1WWcv0MUVRdMF_O-2P814AhVfdAPrzpf5Dqtc643FKvPZ6G4pdSvhJUwhxOfTPp73M7E-xNpZ8VrEksSRpEGuM6tmyVD71WtTrbDWB72NCVvxzM7p7GfDSpKFS94u0UK2kIF7m5KsR9bqUeHyjEd3XRhgMlYyqnNjuQWsfDyZKW9SNs3L9HjumHj8GCvPAhnckQSkI28rY3sr4QqR0hBqjzTyz5QZpI1VXaYPxEmSbhE5JAts9hmy3GDZ4PU_J3kGskLIWxPZhBrHChJUgnh5sECs8eA4ia_7BJPLdY8B3jEGr_ishqBCyFoLOYYagwoSVEPQONgQVHvwIAftL39EGyjGaVEmDO_0yzeyfwugWi7_NqIUO8VqrMKcpln6OyzciNLY4ZcViIIujTOAqmDnB3A3mTnDLDW45we0SmK2D2-6aK6g7TnTXDe46wadu8KkT3HODe7_j2JnbsWbFmFQMWdWUuceMVcwZcw_aeuWz5T_fAwAA__8Gpnyb @@ -239,7 +239,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join (left outer) - │ table: rtable@primary + │ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom1, geom) OR st_dwithin(geom, geom2, 2.0) @@ -249,7 +249,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzclc1u2zgUhffzFMRdOQgdm5T_opUyEwdw4LEytgdoURiBat0mamRSJek2QeB3Lyilja3ElIK2Gy_5c3guP54LPoL-koIPw3dX47PRhDTOR7P57L_xEZkNx8N_5iS9o0TdkYtp-C9JTfQxRTIeXszJZTiaEJVPBDcoV9eJiPGehBOizXUiDCqNS6MbhebEbmH0SZCPjkg4tXvjb4m5TURja4mSLRWnhNu958Mp-fs9aRQFHQEFIWOcRCvU4H8ABhQ4UPBgQSFTcolaS2WXHvONo_ge_DaFRGRrY6cXFJZSIfiPYBKTIvgwt6ZTjGJUrTZQiNFESZofXxQUZCpZReoBKMyySGifNFscFhsKcm2ez9UmukHw2YbW9x6Jr6gMxpcyEaha3q79_CFDvwAf_j8fTnP8QOHFAwD9edLwPlOlxwg4JUG3TD7w7Cwl_KTt-_7FODybDyzfT4nShnyWiSCJIFmUKIybdggUwrXxScBowGng0aBDg95eDvwtHOz9n56g9yYGz08zlvJunRWFS-GToGMLLgczZ9F_waJPieVRZqFxKUVcBWM_A-8tDGZSGVSt0937B-yYBvwYKKwis7wlKQqfsL2Onb2Oz0ZSxagwft1nsXmltIlsyqzF-I5kXwndnRJY_eZj9ZqvxZstr2b7VbiX2q9zsO1XwWGr_foH234VDJ7aj7V_Y__x-uHnNcPvNWtGv8K7FP3uwUa_gsNW9AcHG_0KBj-iz_7Q1_OK5RR1JoXGWj9K2_5JGN9g8Y9puVZLvFJymdsUwzDX5RMxalOssmIwEsWSLXBbzJxi7hZzp9hziz2nuLMjZmVxx33nCuuuU91zi3tOcd8t7jvFA7d48CvETt3E2hUxqQhZVcrcMWMVOWPuoJVvvtj89T0AAP__0Fl1ZA== @@ -276,7 +276,7 @@ vectorized: true │ │ group by: lk │ │ │ └── • lookup join (left outer) -│ │ table: rtable@primary +│ │ table: rtable@rtable_pkey │ │ equality: (rk) = (rk) │ │ equality cols are key │ │ pred: st_intersects(geom1, geom) @@ -297,7 +297,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: ltable@primary +│ table: ltable@ltable_pkey │ spans: [/3 - ] │ └── • subquery @@ -321,7 +321,7 @@ distribution: full vectorized: true · • lookup join (anti) -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_intersects(geom2, geom) @@ -331,7 +331,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlNFv0zAQxt_5K6x72pBLm6TttjxlgkxkKslog5iEqinExxSW2cF20Kap_ztyMrE2Wt0Unvpo-z7f9zt9uidQv0rwIby-mp1HMTn6EC3SxefZMVmEs_B9Sso7cjFPPpFSZ99LJF8_hvOQxElKwmtTSY6e6962ZXK9TOmbgmuUCnOtjtof3t2iuHfpc2FzOj4GClwwjLN7VOB_AwcouEDBgyWFSooclRLSPD01hRF7AH9EoeBVrc31kkIuJIL_BLrQJYIPqfl_jhlDORwBBYY6K8rm-9ZJUMniPpOPQGFRZVz5ZDA0TZNa-yRwaODBckVB1PqlidLZLYLvrGh_IxH_jVIjuxQFRzn0Nr2kjxX6ZBZepCT5koZzcplEMVBo5xOY-dwUnOED0L8_hQ-V7Aw3cCkJxmaQPwqpNPkpCk4KTqqskMgG5riO5tLAo8FkK6C7D6ABex70dCvceZxGHbaX-c-EuKur1rTgPgnMkJL4NcapYVSYC87skFvZvK1sL0g1F5KhRLbBs1y9Qh-LgaiGZ53C11uPN1o7_QPs9Avw0B00-do7wjusdCI8PrwI7wBci_DJwUXY7Z8jt2eOvMG_pGiHkU6KJoeXoh2Aayk6PbgU7Vjyc1SV4Ap77bmRWZTIbrHdqkrUMscrKfKmTXtMGl1zwVDp9tVpDxFvn4zBdbFjFbt2sWsVextipyv27LZH9tZjq3piF0-s4qldPP0f6BOr-NTe-dQqPrOLz_ayvVy9-RMAAP__XKWAxg== @@ -347,7 +347,7 @@ distribution: full vectorized: true · • lookup join (anti) -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: st_covers(geom1, geom) @@ -358,7 +358,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzcVVFv2jwUff9-xdV9gm9mkAQo9VO6NdVSsaQLmdZpQ1VG7qqMNM7sULWq-O9TElYIGoZuT-2j7Xt8zzk-N3lA9TNFjs7lxfjE9aB16k7CyYdxGybO2HkbQjqHs8B_D2kRfUsJPr1zAgc8PwTnsqyE1qru_7pMbpa1VHE1E7ckVauGv74mcWOwVVW1asOJdwqtdA5fF72eRTBor7bk45ZhttvgB6dOAG8-QzpHhpmIyYtuSCH_ggYyNJGhhVOGuRQzUkrI8uihKnTjO-Q9hkmWL4pye8pwJiQhf8AiKVJCjmHJKKAoJtntIcOYiihJq-tr7nYuk5tI3iPDSR5likOnWzb1FwUH22C2idMlQ7Eo1k1UEV0TcmPJDifiZrckC4rPRZKR7FpNLuF9ThzGzlkI_sfQCeDcdz1kWDtql45eJVlMd8geb3Lucgnrp7BNBna_XVL3oGUbj8Zzzl0vHK3st621_b9PkOH3RKoCfogkgySDPEokxZ1y2bCC2RazBzsNMZ9iSGnE6mGGO8048UJ3y4v1e42FmC_ymrTIONhWLX7Lk2GpT9FMZPFhAvs7BVo7Ba51CRmTpLgpyTZe4XT5Bxc80RF597hZveKzk0a_QcM4fAKMwyaga3aqgD55BvZQ2ZqB_sufgT2GbMzA0fOcAfPw8JkHhs_q_E309hDZit7g5UdvjyEb0Rs9z-jt-b8EpHKRKWqI23Vzr_w2U3xN9bdciYWc0YUUs6pNvfQrXLURkyrqU6NeuFl9VBLcBBtasKkHm1qw1QAb22BLT7unb93Xogd68EALHurBw38RfaQFj_SdR1rwsR58_CTa0-V_vwIAAP__qvStug== @@ -375,7 +375,7 @@ distribution: full vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: geom1 ~ geom @@ -385,7 +385,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElM2O2jAQgO99itGcdiVTSAIs5JSqpVJWNNkCh0oVWqVkhFKCndrOigqxz14lQeWnYEIrlVtsz-f57Jl4jepHii4OvjwN3_kB3H3wx5Px5-E9jAfDwfsJpAsGcgEfR-EnSHX0LSV4DP0AZPntzUksnxMe0wrCYBvwtpi04HUbUw6RIRcxBdGSFLpf0UKGNjJ0cMowk2JGSglZLK3LQD9eodtimPAs18X0lOFMSEJ3jTrRKaGLk2L3EUUxyWYLGcakoyQtt69EvEwmy0j-RIbjLOLKhUazSBrm2gXPYp6N0w1DketdEqWjOaFrbVh9EZ-_kNQUP4qEk2w6hy5_3BSy38RglUlQ-nkmXkiqO89m4LXvDxSZ55y1tK-xLOy2t9U9abi7raEQizyD7yLhILgLXnGkMADPhlfwOvt-7bNyzlm5nVPOhYxJUnwgNN2c0A9EQ2TN_lHg6dTtg9RW_Tay6rVR026UVb66kS6oHDVS-0aNdMFyr5Ee_n8j2fWradesptP4m1peEDmqZedGtbxguVfL3m0fhRNyI1KZ4Ipq_fOt4tGgeE7VC6NELmf0JMWsTFMNw5IrJ2JSulq1qoHPq6VCcB-2jLBthm0j7BzA1jHsmLVb5tRtI90xwx0j3DXD3X859IMR7pkz94xw3wz3r9Kebt78CgAA___dcAFE @@ -398,7 +398,7 @@ distribution: full vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: geom ~ geom1 @@ -408,7 +408,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElFFv2j4QwN__n8K6p1Yyf0gCFPKUaWNSKkY64GHShKoUn1BGsDPbqagQ_eyTk24QBiZs0njDZ_9yP98d3oD6noIPgy8Pw3fhiNx8CCfTyefhLZkMhoP3U5IuKZFL8nEcfSKpjp9SJPdROCKy-B0sUKweE85wTaKfwf9NkLy-HS9WDlDgguEoXqEC_yuYgAsUPJhRyKSYo1JCmq1NcTBka_BbFBKe5dqEZxTmQiL4G9CJThF8mJrPjzFmKJstoMBQx0lafL5MHWQyWcXyBShMspgrnzSaJmmUa58EDg1cmG0piFzvkigdLxB8Z0vri4T8GaVGdi8SjrLpVV1-qxTQX8RgnUmi9ONcPKNE9vRyE7iUBO3biiUNvJOi7iWiRvCtYN2jkruCDYVY5hn5JhJOBPdJYG4VjUjQIa8kqFSxfVLOOym3c8q5kMxcviI02x7RH4mGyJr9g4PHU7crqZ36k-TUm6Sm2ygaffEsnVE5mKX29WbpjOjeLN39-1ly6zfUrdlQr_En7TwjctDOzvXaeUZ0r5296z4NR-TGqDLBFdb657fM04FsgeU7o0Qu5_ggxbxIUy6jgisCDJUud51yEfJyywjuw44Vdu2wa4W9Cuwcwp5du2VP3bbSHTvcscJdO9z9m0vfWeGePXPPCvftcP8i7dn2vx8BAAD__4F6BNc= @@ -421,7 +421,7 @@ distribution: full vectorized: true · • lookup join -│ table: rtable@primary +│ table: rtable@rtable_pkey │ equality: (rk) = (rk) │ equality cols are key │ pred: geom && geom1 @@ -431,7 +431,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlE-P2jwQh-_vp7DmtCuZl_wBFnJK1VIpK0q2wKFSi1YpHqGUYKe2U1EhvnvlZFsIBRPaA70gMs6TeezfyFtQXzMIYPjhafQqGpO7N9F0Nn0_uifT4Wj4ekayFSVyRd5O4nck08nnDMljHI2JLP-HSxTr55Qz3JD4Z_F_UySfCsfxetXvC1kuuECBC4bjZI0Kgo9gCh5Q8GFOIZdigUoJaZa25YsR20DgUEh5XmhTnlNYCIkQbEGnOkMIYGY-P8GEoWw7QIGhTtKs_HzVOsxluk7kd6AwzROuAtJqm6ZxoQMSujT0YL6jIAq9b6J0skQI3B1tLhLxbyg1skeRcpRtv-7y26EB_UUMN7kkSj-nXKNUuNDqLvQoCTv3NU0a-mdNvWtMjeHLifVOWu5PbCTEqsjJF5FyInhAQrOteEzCbj3lsHainbOe_lnPvV7BhWQokdXc5rsTOxmLlsjbg6MXT7fu1Fq7zafKbTZVba9Vhn71XF1QOZqrzg3n6oLpwVw93HSuvObheg3D9Vt_Eu0FkaNouzeM9oLpQbT9f-bKOOE5QZULrrDRjeCYKwXZEqv7R4lCLvBJikXZpnqMS64sMFS6WnWrh4hXS0bwEHatsGeHPSvs12D3GPbt2o69dcdKd-1w1wr37HDvbzb9YIX79s59Kzyww4OrtOe7_34EAAD__weJESo= @@ -469,7 +469,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join - │ table: rtable2@primary + │ table: rtable2@rtable2_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -479,7 +479,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlF1v2jwYhs_fX2E9R0U1L9jho82Rt5VJVAw66MGmCVUZedRlDXZmm6lTxX-fnHQrYY0T9qH2BOHYd-4rjy75DsyXFEIYvbuYvBhPydHZeHG5eDtpkcVoMnp1SdIbSvQNcz-cvJ7P3pDURh9TJOez8ZTo_D8X16jWV4mM8ZbMpsTYq0Ra1AZX1hwV5_93R9xrikS-bJHZ_Gw0Jy_fk6PdnhZQkCrGabRGA-EHYECBA4UAlhQyrVZojNJu6y4_OI5vIexSSGS2se7xksJKaYTwDmxiU4QQLl3vHKMYdacLFGK0UZLmry8IRaaTdaS_AYVFFkkTknbHlc42NiSCUcFhuaWgNvahxNjoGiFkW9ocZCy_orYYn6tEou4EZZZfJwr0Z2R0m-m96QpOiei1SpxUBFT0K2n5IbSO8n5qg8dJH8Y2Uepmk5HPKpFEyZA4jJ4j21cihx6UoPtUDCuJg0OIF0pb1J3TMq1gx1TwYyqCY6CwjuzqE0lRhoRVtvYqWx_KlI5RY1zdtdw-gjhVbZV1GC_FqjD6JQzW3HLWzPIOb-cSHux5Dcqe570n9ryGdsfz4TPxvIb43nPW_cui8-aG8YaGBe3f8asGZM-v_hP7VUO749fJM_GrhviHX-wfXqSP1M7RZEoabHQ3dt3tivE1FreyURu9wgutVnlNsZzlufxBjMYWu6xYjGWx5QB3w8wb5v4w94YDfzjwhnulMNsP9_zfXFPd96YH_vDAGx76w0Nv-MQfPvmTiZ36J9at0aRGsjrL_JqxGs-YX7T9L19u__seAAD__1202VQ= @@ -497,7 +497,7 @@ vectorized: true │ already ordered: +lk │ └── • lookup join (left outer) - │ table: rtable2@primary + │ table: rtable2@rtable2_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -507,7 +507,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUVctu2zoU3N-vIM4qQehrU_IrWrFtFMCBa6W2C7QojECVTlM1MqmSdJEg8L8XlNL60Ziy-1h4E4CkhjNzMmM-gv6aQwDhu-vhi8GInFwMJtPJm-EpmYTD8NWU5HeUqDtm_3jkchy9JrmJP-ZIhuHllFxFgxFR5YbHb1HObzKR4j2JRkSbm0wYVBoTo08q0P_2E3tXhSiXpyQaX4Rj8vI9OVknOwUKQqY4iueoIfgADCh4QMGHGYVCyQS1lsoePZYfDtJ7CFoUMlEsjN2eUUikQggewWQmRwhgannHGKeomi2gkKKJs7y8vlLIC5XNY_UAFCZFLHRAGk1LGi1MQDij3IPZkoJcmBWJNvEtQsCWdH8hA_ENlcH0SmYCVdPf1DJ9KDCoJhy9nYbjcs5A4ddJA_15VXhfqK2pc48S3raT_JQpbcgXmQmSCVLEmcK0YZcb3ij3Ke9Q3t1p0jvEpDX3NOzuYQZX_4WhlHeLolIuRUCswrYVvZ2w0mvPetWYSJHWme1S3t9p0z_E5kQqg6p5vmmRszPKvTPK_TOgMI9N8pnkKALCdrK2d7KuyKRKUWG6m2u2fEbiSDZk0WTeBmyXjM6GDLZ_o9h-jWp6jTLwB3eqRspWp9rH2akak2ud6h1zp2psPnWKtf5yqbz90-ztmWa_8TtZrhGyleXOcWa5xuRalvvHnOUamz-yzP7hA_EM7Rh1IYXGvX7zW_bVwPQWq9dGy4VK8FrJpKSpllGJKzdS1KY6ZdViIKojK3AdzJxgzw32nGDfDfad4PYGmG2D227PNdQdJ7rrBned4J4b3HOC-25w_08mdu6eWKsmJjUhq0uZO2asJmfMHbRt57Plf98DAAD__0O7QAM= @@ -521,7 +521,7 @@ distribution: full vectorized: true · • lookup join (semi) -│ table: rtable2@primary +│ table: rtable2@rtable2_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -531,7 +531,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUlF9P2zAUxd_3Kaz7RDd3bf60QJ6yjaAFlZallcY0VSiL71BGsDPbnUCo331y0gHpqJtuL_B47Xt8z-_qyHegfhYQQHR-NnoXj8neUTydTT-NOmQajaIPM1JckeNkckoKnX4rkHz-GCURic5NF9lb9byuW2TV4oaXKK4vcs7wZtWu9EXONUqFmVZ79UtvTZdD_4iqstMhk-QoSsj7L6S4AgpcMByn16gg-AoOUHCBggdzCqUUGSolpLm6qxpjdgNBn0LOy4U2x3MKmZAIwR3oXBcIAczMsARThrLXBwoMdZoX1fO1rbCU-XUqb4HCtEy5Cki3Z4ZOFjogoUNDF-ZLCmKhH4YonV4iBM6StjcS818oNbITkXOUPa_p5e9NAr2XRDelXFtp6FIS-h2g8D2XSpMfIuck56RMc4msa8oGAw09Gg5oONwI4-4CYyBWSx02QWa3JQZkFB3PyDQ6jcnJJB4Dved7WPZIiKtFWRsXPCDGoG88j59C3TeoCjPBWTtWn4aDjazeRtYHRCEZSmRNutB5A_PlEwsZi64oe4fN7pWljTb8hg2nfZCddkHuud0qZztHeYuVtSj7zzvKW2AeRXn_xUfZbZ8ht2WGvO6_JGiLkbUEDZ53grbAPErQwYtP0JaPP0FVCq6wwbnp5b75KZFdYv2zKrGQGZ5JkVVj6nJS6aoDhkrXt05dxLy-MgYfix2r2LWLXavYa4iddbFnt923j_at6oFdPLCKh3bx8H-g963iA_vkA6v40C4-3Mn2fPnqdwAAAP__D-uCuQ== @@ -545,7 +545,7 @@ distribution: full vectorized: true · • lookup join (anti) -│ table: rtable2@primary +│ table: rtable2@rtable2_pkey │ equality: (rk1, rk2) = (rk1,rk2) │ equality cols are key │ pred: st_intersects(geom1, geom) @@ -555,7 +555,7 @@ vectorized: true │ └── • scan missing stats - table: ltable@primary + table: ltable@ltable_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUldFv0zAQxt_5K6x7WsGlTdJ2W54yWCYylWSkQQyhagr1MYVldrBdtGnq_46cFLaU1W3hqY-O77v7ftdP7gOoHyX4EF5ejE-imBycRpNs8mHcIZNwHL7NSHlDztLkPSl1_rVE8uldmIYkTjISXppKcrCse9mUybrMDa5R3F4VnOHdUqL0VcE1SoUzrQ6abq9NlUN_i-pjp0OS9DRMyZvPpLwBClwwjPNbVOB_AQcouEDBgymFSooZKiWkuXqoCyN2B36fQsGruTafpxRmQiL4D6ALXSL4kJlhKeYMZa8PFBjqvCjr9o2toJLFbS7vgcKkyrnySbdnhiZz7ZPAoYEL0wUFMdePQ5TOrxF8Z0G3NxLxnyg1snNRcJQ9r-0lu6_QJ-PwLCPJxyxMyXkSxUDh7w0D_dMqvKvkyqoDl5Jg0AEK3wqpNPkuCk4KTqq8kMi65thio4FHgyENRmsh3V0gDdxy2aO1gCdxFq3yPf4IYyFu5lVjXHCfGIMD4zl-DvXQoCqcCc62Yx3QYLiW1VvL-ogoJEOJrE0XOK9gunhmIbHoiqp33K5eWlprY9Cy4WwfcGe7gPfcbp2_nSO-wcpKxAf7GfENkE8ifrj3EXe3z5a7Zba87r8ka4ORlWQN9zNZGyCfJOto75O14Y8iRVUJrrDFua5z37ysyK6xeYmVmMsZXkgxq8c0x6TW1R8YKt3cOs0h4s2VMfhU7FjFrl3sWsVeS-ysij277b599MCqHtrFQ6t4ZBeP_gf60Co-sk8-soqP7eLjnWxPFy9-BQAA__95W5eG diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array index 30c1350a84e3..97daa47a11d5 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array @@ -29,7 +29,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -39,12 +39,12 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM json_tab@primary AS j1, json_tab AS j2 WHERE j1.b @> j2.b ORDER BY j1.a, j2.a +EXPLAIN SELECT * FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b @> j2.b ORDER BY j1.a, j2.a ---- distribution: local vectorized: true @@ -57,12 +57,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs an inverted join. @@ -76,7 +76,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b <@ b @@ -86,12 +86,12 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM json_tab@primary AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b <@ j2.b ORDER BY j1.a, j2.a +EXPLAIN SELECT * FROM json_tab@json_tab_pkey AS j1 CROSS HASH JOIN json_tab AS j2 WHERE j1.b <@ j2.b ORDER BY j1.a, j2.a ---- distribution: local vectorized: true @@ -104,12 +104,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs an inverted join with an additional filter. @@ -125,7 +125,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> '{"a": {}}') @@ -135,12 +135,12 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM json_tab@primary AS j1, json_tab AS j2 +EXPLAIN SELECT * FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b @> j2.b AND j1.b @> '{"a": {}}' AND j2.a < 20 ORDER BY j1.a, j2.a ---- @@ -155,7 +155,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ spans: [ - /19] │ └── • filter @@ -163,7 +163,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs an inverted join with an additional filter. @@ -179,7 +179,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b <@ b) AND (b <@ '{"a": {}}') @@ -189,12 +189,12 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM json_tab@primary AS j1, json_tab AS j2 +EXPLAIN SELECT * FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b <@ j2.b AND j1.b <@ '{"a": {}}' AND j2.a < 20 ORDER BY j1.a, j2.a ---- @@ -212,12 +212,12 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] # This query performs a left inverted join with an additional filter. @@ -233,7 +233,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join (left outer) - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> '{"a": {}}') @@ -244,7 +244,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs a left inverted join with an additional filter. @@ -260,7 +260,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join (left outer) - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b <@ b) AND (b <@ '{"a": {}}') @@ -271,7 +271,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs a semi inverted join with an additional filter. @@ -286,7 +286,7 @@ distribution: local vectorized: true · • lookup join (semi) -│ table: json_tab@primary +│ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -296,7 +296,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] # This query performs a semi inverted join with an additional filter. @@ -311,7 +311,7 @@ distribution: local vectorized: true · • lookup join (semi) -│ table: json_tab@primary +│ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b <@ b @@ -321,7 +321,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] # This query performs an anti inverted join with an additional filter. @@ -336,7 +336,7 @@ distribution: local vectorized: true · • lookup join (anti) -│ table: json_tab@primary +│ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -347,7 +347,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs an anti inverted join with an additional filter. @@ -362,7 +362,7 @@ distribution: local vectorized: true · • lookup join (anti) -│ table: json_tab@primary +│ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b <@ b @@ -373,7 +373,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN # This query performs an inverted join. @@ -387,7 +387,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -397,12 +397,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM array_tab@primary AS a1, array_tab AS a2 WHERE a1.b @> a2.b ORDER BY a1.a, a2.a +EXPLAIN SELECT * FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b @> a2.b ORDER BY a1.a, a2.a ---- distribution: local vectorized: true @@ -415,12 +415,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs an inverted join. @@ -434,7 +434,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b <@ b @@ -444,12 +444,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM array_tab@primary AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b <@ a2.b ORDER BY a1.a, a2.a +EXPLAIN SELECT * FROM array_tab@array_tab_pkey AS a1 CROSS HASH JOIN array_tab AS a2 WHERE a1.b <@ a2.b ORDER BY a1.a, a2.a ---- distribution: local vectorized: true @@ -462,17 +462,17 @@ vectorized: true │ ├── • scan │ missing stats - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs an inverted join with an additional filter. query T -EXPLAIN SELECT * FROM array_tab@primary AS a2 +EXPLAIN SELECT * FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -484,7 +484,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> ARRAY[1]) @@ -494,12 +494,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [ - /4] # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM array_tab@primary AS a1, array_tab AS a2 +EXPLAIN SELECT * FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a ---- @@ -514,7 +514,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ spans: [ - /4] │ └── • filter @@ -522,12 +522,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs an inverted join with an additional filter. query T -EXPLAIN SELECT * FROM array_tab@primary AS a2 +EXPLAIN SELECT * FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -539,7 +539,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b <@ b) AND (b <@ ARRAY[1]) @@ -549,12 +549,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [ - /4] # This query performs a cross join followed by a filter. query T -EXPLAIN SELECT * FROM array_tab@primary AS a1, array_tab AS a2 +EXPLAIN SELECT * FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a ---- @@ -572,17 +572,17 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [ - /4] # This query performs a left inverted join with an additional filter. query T -EXPLAIN SELECT a1.*, a2.* FROM array_tab@primary AS a2 +EXPLAIN SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 LEFT INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -594,7 +594,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join (left outer) - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> ARRAY[1]) @@ -605,12 +605,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs a left inverted join with an additional filter. query T -EXPLAIN SELECT a1.*, a2.* FROM array_tab@primary AS a2 +EXPLAIN SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 LEFT INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b <@ a2.b AND a1.b <@ '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -622,7 +622,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join (left outer) - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b <@ b) AND (b <@ ARRAY[1]) @@ -633,12 +633,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs a semi inverted join. query T -EXPLAIN SELECT a2.* FROM array_tab@primary AS a2 WHERE EXISTS ( +EXPLAIN SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b @> a2.b ) @@ -648,7 +648,7 @@ distribution: local vectorized: true · • lookup join (semi) -│ table: array_tab@primary +│ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -658,12 +658,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs a semi inverted join. query T -EXPLAIN SELECT a2.* FROM array_tab@primary AS a2 WHERE EXISTS ( +EXPLAIN SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b <@ a2.b ) @@ -673,7 +673,7 @@ distribution: local vectorized: true · • lookup join (semi) -│ table: array_tab@primary +│ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b <@ b @@ -683,12 +683,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs an anti inverted join. query T -EXPLAIN SELECT a2.* FROM array_tab@primary AS a2 WHERE NOT EXISTS ( +EXPLAIN SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE NOT EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b @> a2.b ) @@ -698,7 +698,7 @@ distribution: local vectorized: true · • lookup join (anti) -│ table: array_tab@primary +│ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -708,12 +708,12 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN # This query performs an anti inverted join. query T -EXPLAIN SELECT a2.* FROM array_tab@primary AS a2 WHERE NOT EXISTS ( +EXPLAIN SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE NOT EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b <@ a2.b ) @@ -723,7 +723,7 @@ distribution: local vectorized: true · • lookup join (anti) -│ table: array_tab@primary +│ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b <@ b @@ -733,5 +733,5 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array_dist b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array_dist index 18164b299591..b589f4d8a7c2 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array_dist +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_json_array_dist @@ -81,7 +81,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -91,7 +91,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElF9vmzwUh-_fT2Gdq3erU7Ah_cOVu5VpmbKkg0jbtEUVCWcVWYqZgapTlO8-QbI0iYJN1am9xObn85yjR2cB-a85eOB_uepf9Abk_8teOAo_9V-R0O_7b0fkNXkXDD-SWS7T6yKaiB9SXifpHbkIyYzRzXn9zcnn937gkxk7nhDxvbRtB8mMH0_IMLj0A_Lma3UV0eosAgqpjHEQ3WIO3jdgQIEDBQfGFDIlp5jnUlVXi_rHXnwPnk0hSbOyqI7HFKZSIXgLKJJijuDBKJrMMcAoRmXZQCHGIkrm9fObBjKV3EbqN1AIsyjNPdKxmA3jJQVZFg9P50V0g-CxJW1fvpfeoSow_iCTFJXlNBCsRwh0E_DvM0WEu5mZqAYxLAuPCEYFp8JpBOSPAazA1uM5MY6nL-XPMiMzmaREph4RVT_DARHdQ5wuFV1a0zaiOo9BDaUqUFnnu5iCHVHhHDWWcBtLPLwsVYwK46aHD7AMZEdmFuM7kSaE7g4Cay8sayusxeyOxds6ayDYc9Z9fmcNgFvOnr60swbUtbPMfoq0vL0xvLUx3O601MVQfk-X7vPrYgDc0uXspXUxoP7Vhf2rHXegRoB5JtMcW60uu1p-GN_gamHmslRTvFJyWpdZfQ7rXH0QY16sbtnqo5eurirA7TDThrk-zLVhRx92tGF3J8z2w66-Z0PprjZ9og-faMOn-vCpNnymD589ZWLn-onZBk0Mkpks02vGDJ4xvWj7nY-X__0JAAD__xWKngI= @@ -101,7 +101,7 @@ Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElF9vmzwUh-_fT # test config, so we hide it. query T SELECT info FROM [EXPLAIN (DISTSQL) -SELECT * FROM json_tab@primary AS j1, json_tab AS j2 WHERE j1.b @> j2.b ORDER BY j1.a, j2.a +SELECT * FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b @> j2.b ORDER BY j1.a, j2.a ] WHERE info NOT LIKE 'distribution:%' ---- vectorized: true @@ -114,15 +114,15 @@ vectorized: true │ ├── • scan │ missing stats - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk1Fv0zAQx9_5FNZJaMDcJXa6DeXJgwWtUJqRVAI0IuQ2x0jV2cV2JFDV746SThup2pKuffTd_f27v883B_trCiGkUT96OySF-qHJuyT-SG6iL9f9i96AvLjspcP0U_8lua95tSyYWK2-OzkSM1PcSfOHXKRkwuhDvD5z8vkqSiIyYScjIr6Vvh8gmfCTEYmTyyghb75WKUmrmMzui-smBvGQ9HsfInKUF9aZYlS6Qqvw-RFQUDrHgbxDC-ENMKDAgUIAGYWZ0WO0VpsqNa8Le_lvCH0KhZqVrgpnFMbaIIRzcIWbIoQwlKMpJihzNJ4PFHJ0spjW16_aBArpTCobko7HfMgWFHTpHq-2Tt4ihGxBn4YPDoLnG_GP1FJpk6PBvEHMKuX_StZ4uJL253tdKDTeWdNCPCCCPwxfdIFCXLqQCEYFpyKgorvRR7DLM6baODTeeRMv2DEVwfFGRLeBYO0nxdpOymN-x-Nt_8oOHXQP1UHzu_D2HfDWHXC_0_IBdsCfHgS_eVnW4BO0M60sri7N2pv9alMwv8Xl5lldmjFeGz2uMctjXOvqQI7WLbN8eeipOlW_z79itoOYr4r5VnHQEPur4mCr-PV2cXcfz6f7eD7bh3y-EzlbPPsbAAD___jRYVA= +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk2Fv0zwQx98_n8I66dGAuUvsdBvKqwwWtEJpRlIJ0IgmtzlGSmcH25GYqn53lHR0pGpLSvsu9t3fv_vf5WZgfkzBhyTsh6-HJJdfFXkTR-_JTfjpun_RG5Bnl71kmHzoPyePOS8WCROj5K0Vo-D3x23xHR_IRUImjC6j9ZmTj1dhHJIJOxmR4Evpuh6SCT8ZkSi-DGPy6nMVErS6E-ljcl3KIBqSfu9dSI6y3Fidj0qbK-n_fwQUpMpwIO7RgH8DDChwoOBBSqHQaozGKF2FZnViL_sJvkshl0Vpq-uUwlhpBH8GNrdTBB-GYjTFGEWG2nGBQoZW5NP6-aXZQuf3Qj8AhaQQ0vik4zAX0jkFVdqnp40Vdwg-m9N_w3sHwfON-CdqKZXOUGPWIKaV8m8pazxcCfPtrcolauesaSEakIAvhx90gUJUWp8EjAacBh4Nuht9eLu0MVHaonbOm_iAHdPAO96I6DYQrP2kWNtJOcztOLztv7JDBd1DVdD8XXj7CnjrCrjbadmAHfCnB8FvXpY1-BhNoaTB1aVZ-7JbbQpmd7jYPKNKPcZrrcY1ZnGMal19kaGxiyhfHHqyDtX9-VPMdhDzVTHfKvYaYndV7G0Vv9wu7u7j-XQfz2f7kM93Iqfz_34FAAD__1-wY7Q= # This query performs an inverted join with an additional filter. query T @@ -138,7 +138,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> '{"a": {}}') @@ -148,7 +148,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUk09vm0AQxe_9FKPpIXayMSzY-bMnkppKRC6kYFWtGitam22E67B0wVEqy9-9AvKPKKxtqYf2uLPzm3lvpLfC_NcCGbpfL0dnng-doReNo8-jLkTuyP0whjnt7ROYW719-BgGn2Cey_S64FM4i2Bugef7bgie_8UNx-4QLgLPb7ZQCHzodOa0NwXnammatiinTbtw5g-hWd9bXSG_Qgar9Xqv-9hh9ThUDTOwzC4E4dAN4fxbqYxXyjgSTGUsfH4rcmTfkSJBCycEMyVnIs-lKsurqsmL75GZBJM0WxZleUJwJpVAtsIiKRYCGY75dCFCwWOhDBMJxqLgyaIa_ejNyVRyy9VvJBhlPM0ZHBrUxMmaoFwWz6Pzgt8IZHRNtl_vpXdCFSK-kEkqlGG1KPgh5XWS3iF5Atz7TEHH6T8d1LEejvii1jgyY-wiCvzzLhIMlgUDhxLHIo7d6sTaxUnp4OGO_Y13HEn5c5nBXCYpyJSBY5eifOg4gzcMDXYz1CfOoNWTvYunSKpCKOOo6cexD4hDD1pX9FtXPE-WKhZKxG2D39Diy0OZGSdNorZtV55L862aBg1NdPtM0G0zYVDz0KCnxvstg7FBw6tg2P9wMDY4eRGMwX8TjA2eHoJx_LeC8caKUOSZTHPRWNE22SwTI-IbUacsl0s1E5dKzqo19TOouKoQi7yof2n98NL6qxT4EqZa2NLDlha29bCthfsNmL6G-1r4VL95oIWP9PCRFj7Ww8da-EQPn-x0sMn63Z8AAAD__77V19M= @@ -156,7 +156,7 @@ Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUk09vm0AQxe_9F # This query performs a cross join followed by a filter. query T SELECT info FROM [EXPLAIN (DISTSQL) -SELECT * FROM json_tab@primary AS j1, json_tab AS j2 +SELECT * FROM json_tab@json_tab_pkey AS j1, json_tab AS j2 WHERE j1.b @> j2.b AND j1.b @> '{"a": {}}' AND j2.a < 20 ORDER BY j1.a, j2.a ] WHERE info NOT LIKE 'distribution:%' @@ -171,7 +171,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ spans: [ - /19] │ └── • filter @@ -179,10 +179,10 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lG9v2jAQxt_vU5xumiirS2KH_sGv0q5UpWOkI0jb1KLJEK8LojGzHWkT4rtPCR1dEKRh3fbS53vud_fknDmab1PkGLa77TcDiJMvCi76wTu4aX-87p52erB33gkH4ftuHR5yXi8TJkYln60Y-TMd3wv9A05DmFCyiudnBh8u2_027O1NaGME_m3qup6ECWuM6nDaO4divDa_RXGLHOaLRa3-K4M1BOQJY2BuHYL-ebsPZ59gQhuCZLXE8AGTt98LBtDtvG1DLYqN1fEotbFK-KsaEkxUJHviXhrkN0iRIEOCHg4JzrQaS2OUzq7meWIn-o7cJRgns9Rm4SHBsdIS-RxtbKcSOQ7EaCr7UkRSOy4SjKQV8TQvv24QEgxnIjEcDhzq4nBBUKX2sbSx4k4ipwvyZ3j2V_BsF_xFPLVSS-0cFtnLOAefbf60nPOrMOidbe3C29rFIzxNlI6kllGBPcyUT6VsGOVSmK9XKk6kdk6KwwQ98JurOfzM5iC1HHxKfEZ8j_jNrXM0d3EzVNpK7bSKeN_bJz7dX1EzHsnZW6mHBSqtvkK06go51D1waMt5WXGNd-jB26kHVnWTn-hgtclH_3STWXUfmpV9YO5BRROewK9MOP5vz3lDF31pZioxcv1Zb6zsZm9ZRndy-W8wKtVjea3VOMcsj0GuywORNHZ56y0PnSS_yrf1dzEtFbOC2F0Xsx3IbF3slYqb5eRmqZi65erD5zh2VCo-LicfP8exk1Jxq5zc2ok8XLz4GQAA__-ZufKr +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8lG9v2jAQxt_vU5xumiirS2KH_sGv0q6pSsdIR5C2qUVVIF4XRmNmO9IqxHefElq6VBDCuu0d9t1zv7uHc2aof0yQY-B1vHd9iJOvEs56_ge48j5fdo7bXdg5bQf94GOnDg85bxcJYy2TGxMO3ccfN9Pv4h6OAxhTsozmZwafzr2eBzs7Y9oYgnud2rYjYMwawzocd0-heF-bXWN4jRxm83mt_pjBGiHkCSNgdh383qnXg5MvMKaNkGS1wsEDJh-i6_eh037vQS2KtVHxMDWxTPibGhJMZCS64Z3QyK-QIkGGBB0cEJwqORJaS5WFZnliO_qJ3CYYJ9PUZNcDgiOpBPIZmthMBHLsh8OJ6IkwEsqykWAkTBhP8vJLm6YqvgvVPRIMpmGiOexZ1MbBnKBMzVNpbcJbgZzOyZ_h2V_Bs23wZ_HECCWUtV9kL-45uGz1X8s5vwj87snaLpy1XTzB00SqSCgRFdiDTLkpZcUo56H-diHjRCjrqDiM3wW3uZzDzWz2U8PBpcRlxHWI21w7R3MbNwOpjFBWq4h3nV3i0t0lNeORnL2Wul-g0uorRKuukEXtPYu2rNcV13iLHpytemBVN3lDB8tNPvinm8yq-9Cs7AOz9yqasAG_NOHwvz3nFV30hJ7KRIvnz3plZTt7yyK6FYtvg5apGolLJUc5ZnH0c11-EQltFlFncWgneSjf1t_FtFTMCmL7uZhtQWbPxU6puFlObpaKqV2u3n-JYwel4sNy8uFLHDsqFbfKya2tyIP5q18BAAD__3Uo9Q8= # This query performs a left inverted join with an additional filter. query T @@ -198,7 +198,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join (left outer) - │ table: json_tab@primary + │ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> '{"a": {}}') @@ -209,7 +209,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzkld9P4kAQx9_vr5jMi3Au0G0BcZ-qR01quNaD3uUuJzGFrqYcdnvbYjSE__1SqkKJbGu8J33cH9-Z2c_ON7PE5O8cGVo_LwYntgO1vj3yRt8GdRhZA-uLB5_hbOh-hVkioqvUn8DJCGY6DKwzD2znhzX0rD6cu7ZTvEHBdaBWm9HmBMzLhaYZHGZ6c1KHE6cPxf2D5SX6l8hguVod1J9u6E0f1hemoGt1cId9awinv2BGmz7JYvlIMBIBd_xbniD7jRQJ6kjQwDHBWIopTxIhs6Pl-qId3CPTCIZRvEiz7THBqZAc2RLTMJ1zZOj5kzkfcj_gsqUhwYCnfjhfh396nxnL8NaXD0hwFPtRwqDRohqOVwTFIt2ETlL_hiOjK1I9vR3dcZny4FyEEZcto1iB9xBzlqN3v3vWcM0dyaayayGuwugOyXMg6z6WUDPbz7BN_RHw1l7hAxhj5yPXOa0jQdcBk25-gTFmO14PCV6HMklhJsIIwghiP5Q8aGTLTLRIGZiUmDoxDWJ29pLRX0MmI_L4L91XUtn810CIP4s4r1tEDEwjf2TN7L4AqFsOKOFTEQUVQHSI2d0LwngNiJGQKZet4yIE0zgkJj3cm6K9N8UmspABlzzYF_iFWhzREHGL6gXJvhI6hRJodR_Sqj5sUa3R0qtasaSCHSu2P5AVS8hsWfHofVuxBMSjFan2Fi_q1Y2gVzaCrjUquqAk_Y4LOh_IBSVktlzQe98uKAHx5AL6vybSCzmGPIlFlPBKg0bLRhUPbng-3hKxkFN-IcV0nSZfumvdeiPgSZqf0nxhR_lRVuC2mCrFulqsK8WGWmwoxe2CmO6K2-o3l6TuKNVdtbirFB-pxUdKcU8t7r2F2LGamFbSJiVNVtZl6jajJX1G1Y22-_Lx6tO_AAAA___k5WOg @@ -227,7 +227,7 @@ distribution: full vectorized: true · • lookup join (semi) -│ table: json_tab@primary +│ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -237,7 +237,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: [ - /19] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUkkFvm04Qxe__TzGa_8Vu14EF21U5kTZEJXLsFCw1VWtFGCYR1NmluxAlivzdKyBKQmSIc2uPOzu_mfdG7x717w066J2fzQ79OQyO_HAZfp0NIfRm3uclvIPjYHEKmZbioojWcBhCZsG3L17ggXdeNcNgd6t7KeVFKm5qhD8gg4wfrMH9WZqmTZBZB-shHM6PYJBZBxHU5RgscziERXDkBfDpe9UUIUMhE5pH16TR-YEcGVq4YpgrGZPWUlXl-7rJT27RMRmmIi-LqrxiGEtF6NxjkRYbQgeX0XpDAUUJKcNEhgkVUbqpRz_Kz1V6Hak7ZBjmkdAOjAxu4mrLUJbF02hdRFeEDt-y_df74oZUQcmJTAUpw-pQ8HBAZI-Ad5srcMePB3Qr9DJVuoBMpgJSAXmUKkpG1RMZLsrCAZcz12KuzdxJp37rLfor3Q_XG7e1L-9ycmDmHS8h9E59OFn4c2S7jjqT8leZN7KlcMC1K7lzcKdtd5piKZL97I077dmd9p5cSZWQoqRtyOXvcbXdcYO5HMncmLa7n_R0Khm3lPD9c8r3zanBzZHBPxr_7xnWVzS8CKv914X1Ff3Pwjr518O6w15AOpdCU8ta12SzSjIlV9QkX8tSxXSmZFyvaZ6LmqsLCemi-eXNwxfNVyXwOcx7YasftnphuwXzl7DdC3_o3zzuhSf98KQXnvbD0zd5Xm3_-xMAAP__SF9yzw== @@ -255,7 +255,7 @@ distribution: full vectorized: true · • lookup join (anti) -│ table: json_tab@primary +│ table: json_tab@json_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -266,7 +266,7 @@ vectorized: true │ └── • scan missing stats - table: json_tab@primary + table: json_tab@json_tab_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUld9u2jAUh-_3FEfnCjZT4gQo9VXYmmqpWOhCpnXaUBWIW4VRO7ND1ari3aeEqjSsmFS74tJ_Pp_zHX4Kj6j_LJChd3kxHPgBNE79cTT-OmzC2Bt6nyJ4D2fh6AvMtRRXeTyFwRjmNnz_7IUeBKMIvMsCgMbr191rKa9ScVdi9AlrzOnRFNxfS8tyOMzto2kTBsEpNOb2UQzl9gxsq9mEUXjqhfDxR3EpRoJCJjyIb7lG9hMpErSRoIMTgpmSM661VMXRY3nRT-6RWQRTkS3zYntCcCYVR_aIeZovODKM4umChzxOuGpbSDDheZwuyuefFTKV3sbqAQmOs1hoBq02tXCyIiiX-eZpncc3HBldkfrlfXHHVc6Tc5kKrtpOtYPoIeMMht5ZBKNvkRfC-cgPkOD2cJE8P-TdZwrczvNw3WJAowBcupkrY8wPoj4SvE6VzmEuUwGpgCxOFU9axbKAljkDlxLXJq5D3O5OYfstwoXo07h7O2UHQeT_47r5FYZS_l5m67alYOA6T469qrbmMymSenqdnXrOTr2NlVQJVzypCrn0A05Wr8wgkC2ZtU-qtzf97OykU-mE1g82rRvsNrVabbtutvd0sJXtzuFne4_wi2wfH2K27fqJsmsnyrZaNeO0p_xWnLqHH6c9wi_i1D_EOO35Jwi5zqTQvKK262Wr-I7y5Iavv7taLtWMXyg5K8usl6OSKzcSrvP1KV0vfLE-Khp8CVMjbJth2wg7FZhuw465bctcumOku2a4a4R7Zrj3P9LHRrhvrtw3widm-ORNbU9W7_4GAAD__yWwhNA= @@ -305,7 +305,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -315,7 +315,7 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEkt1u2kwQhs-_qxjN0ddmiVnb_NRHmzauSkUhtZHaqkXRgqeRW-J11-soEeLeKxsUQoQXkCrl0LN-5n00epdY_FlggOHXq-HFYAT_Xw7iSfx5-AricBi-m8BreB-NP4HUWj5cGzkTP5W6TrM7uIhBcrZ9qAcufPkQRiFIfj4D8aNstz0C6Z7PYBxdhhG8_VY9SVbNJDLMVEIjeUsFBt-RI0MPpwxzreZUFEpX42X90yC5x6DNMM3y0lTjKcO50oTBEk1qFoQBTuRsQRHJhLTTRoYJGZku6tVb_Vynt1I_IMM4l1kRQMvxcLpiqEqzXV0YeUMY8BU7Pn6Q3ZE2lHxUaUbacZsMNgdE9kiE97kG4T8eTFTsuDQBCM6Ey0SzoXuKYWW2uY9_-D5DpX6XOfxSaQYqC0B4ldUIRGefqM9Eh9W6ja7eKa6x0oa00931FPyMCe-sMcJvjNhuVjohTUnT4j0uI9VSudPfIZoMOjsG_PjG8qMb63itIxt7IP5ZY70XaOwBwyeN7bx4Yw-4bhrb-1eN3RMRUZGrrKCjmtiuqkzJDa3rX6hSz-lKq3kds_4c11w9SKgw61e-_hhk66dK8CnMrbBrh10r7Nlhzwr7OzB_DvtW-I09uWOFu3a4a4V7drhnhft2uH_Swaar__4GAAD__54xmXI= @@ -323,7 +323,7 @@ Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEkt1u2kwQhs-_q # This query performs a cross join followed by a filter. query T SELECT info FROM [EXPLAIN (DISTSQL) -SELECT * FROM array_tab@primary AS a1, array_tab AS a2 WHERE a1.b @> a2.b ORDER BY a1.a, a2.a +SELECT * FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b @> a2.b ORDER BY a1.a, a2.a ] WHERE info NOT LIKE 'distribution:%' ---- vectorized: true @@ -336,20 +336,20 @@ vectorized: true │ ├── • scan │ missing stats - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyskk9v00AQxe98itFIqEC39Z9NOfi0hRrVEOJiRwJULLSOh2Ip9ZrdtUQV5bsj2xXBIQkJ7dEz8-bnt_MWaH7MMcA0HIevp1BW3xS8SeL3cB1-uhqfRxN4dhGl0_TD-Dncz7zoB6TW8u6rlbmodXkr9R2cpyA9tmp0BR8-XoZJCNI7zUF8aVyXE0j_NIc4uQgTePW5bUnW1mR2P9z9xiSewjh6F8JRURqry7yxpaqCp0fIsFIFTeQtGQyu0UOGHDOGtVYzMkbptrzohqLiJwYuw7KqG9uWM4YzpQmDBdrSzgkDnMp8TgnJgrTjIsOCrCzn3eq_TCLDtJaVCeDE4ZgtGarGrlYbK28IA2_J_g_vPwre34pfUZtK6YI0FQNi1ir_NbLBw6U039-qsiLtjIYW4gkI__fhRduNGxuA8JjwmeBMjLb64Ic8Y6q0Je2cDfHCO2aCH29FjAYIb_9LeXtfyuEnewblADx_FPz2oGzAJ2RqVRlaD8zGzW6bEipuqE-dUY2e0ZVWsw7Tf8adrisUZGzf9fuPqOpa3fv8KfYOEPvrYn-nmA_E7rqY7xS_3C0ePcTz2UGes-WTXwEAAP__FEvkVQ== +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysktFv0zAQxt_5K04noQHz1iTueMiTBwtaoDQjqQRoRJPTHCOii4PtSFRV_3eUZFpJ1ZaW7S2-u8-_fL5vgebXDH1MglHwdgJF-V3Buzj6CNfBl6vReTiGFxdhMkk-jV7C_cyrbkBqLec3Vmbi4eum-klzOE9AumzVbwsefL4M4gCke5qB-FY7DieQ3mkGUXwRxPDma9OSrKnJ9H64_ZtxNIFR-CGAo7wwVhdZbQtV-s-PkGGpchrLOzLoX6OLDDmmDCutpmSM0k150Q6F-W_0HYZFWdW2KacMp0oT-gu0hZ0R-jiR2YxikjnpgYMMc7KymLVXr7xWuriTeo4Mk0qWxoeTAcd0yVDVdnW1sfKW0HeX7P_w3pPgva34FbUulc5JU94jpo3yXyMbPFxK8-O9KkrSg2HfQjQG4T0sXjTdqLY-CJcJjwnOxHCrD37IMyZKW9KDsz5euMdM8OOtiGEP4e6_KXfvTQ34yZ5BOQDPnwS_PSgb8DGZSpWG1gOz8WanSQnlt9SlzqhaT-lKq2mL6Y5Rq2sLORnbdb3uEJZtq32fv8XuAWJvXeztFPOe2FkX853i17vFw8d4PjvIc7p89icAAP__LfbnHg== # This query performs an inverted join with an additional filter. query T EXPLAIN (DISTSQL) -SELECT * FROM array_tab@primary AS a2 +SELECT * FROM array_tab@array_tab_pkey AS a2 INNER INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -361,7 +361,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> ARRAY[1]) @@ -371,15 +371,15 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: [ - /4] · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUk09v2kAQxe_9FKPpIdBsMOs_Cd3T0uJKjqhJDaoapSha8DZyS7zu2kSJEN-9sqEJpPECUg_t0TP7m3lv9LzA_OcMGfpfLvrdIIRGLxiOhp_6TRj6ff_9CN7Ah2jwEYTW4uG6EBOe6eRW6AfoDkHYEIShH0EQfvajkd-D80EQbrz9ptR1kt5VbykMQmg0BG1NgH-dt9uOBGG3Jk3ohj3Yrh8t6PKo-btjtwRUjSl4TRhEPT-Cd5cgaEuQcoRAgqmKZShuZY7sCikSdHBMMNNqKvNc6bK8qB4F8T2yNsEkzeZFWR4TnCotkS2wSIqZRIYjMZnJSIpYaquNBGNZiGRWjf7jDkhwmIk0Z3BiOTheElTz4ml0XogbiYwuyf7rg_RO6kLG5ypJpbbsOgXr6yJ5JPz7TEODu4-H5Pb6iBu1bhR1L68oYywIR51xEwkO5gUDTgm3Ca83YR9iohS_PqG7-4R9pX7MM_iukhRUyoA7paoQGtx7wYu3rxeXcK_WjnOInaHShdTW6bYV7hwTTo9rV7i1K54mKx1LLeO6wS9oCdWJyqzOFlGnwNtSQPfPPd0795ZzYrnW6z2zv0PCs-w7_2b2d5jYyL73P2R_h5119s_-VvZfWBHJPFNpLvfKdLv8KWR8I1c_Uq7meiovtJpWa1afg4qrCrHMi1WXrj6CdNUqBW7C1AjbZtg2wo4ZdoywuwXT57BrhN-aN3tG-NQMnxrhMzN8ZoQ7Zrhz0MHGy1e_AgAA__-Np9Am +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUk09v2kAQxe_9FKPpIdBsMOs_CfXJtLiSI2pSg6pGKYoWPI3cEK-7NlEixHevbGgCUbyA1EN7s2f8m3lv9LzA_NcMXfS_XfS7QQiNXjAcDb_0mzD0-_7HEbyDT9HgMwilxON1ISbe09N1dkuP0B2CMCEIQz-CIPzqRyO_B-eDINxAfkh5naT31bccBiE0GoK3JuB9n7fbFoEwW5MmdMMebNePFnx51PzTMVsCqsYUnCYMop4fwYdLELwlWDlCIMNUxhSKO8rRvUKODC0cM8yUnFKeS1WWF9VHQfyAbpthkmbzoiyPGU6lInQXWCTFjNDFkZjMKCIRkzLayDCmQiSzavSzt0wld0I9IsNhJtLchRPDwvGSoZwXz6PzQtwQunzJ9l8fpPekCorPZZKSMsw6BevrInsi_IdMQcOznw7pmesjbtS6UdS9vOKu6wbhqDNuIsPBvHDB48wzmVdvwjzERCl-fUJ79wn7Ut7OM_gpkxRk6oJnlapCaHjOK16cfb3YzHNq7ViH2BlKVZAyTreteNYx8_hx7Qq7dsXzZKliUhTXDX5FSyhPZGZ0tog6Bc6WAr5_7vneuTesE8M23u6Z_R0SXmTf-jezv8PERvad_yH7O-yss3_2t7L_yoqI8kymOe2V6Xb5U1B8Q6sfKZdzNaULJafVmtXroOKqQkx5sery1UuQrlqlwE2Ya2FTD5ta2NLDlha2t2D-Era18Hv9ZkcLn-rhUy18pofPtHBHD3cOOth4-eZ3AAAA__9EadLv # This query performs a cross join followed by a filter. query T SELECT info FROM [EXPLAIN (DISTSQL) -SELECT * FROM array_tab@primary AS a1, array_tab AS a2 +SELECT * FROM array_tab@array_tab_pkey AS a1, array_tab AS a2 WHERE a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a ] WHERE info NOT LIKE 'distribution:%' @@ -394,7 +394,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ spans: [ - /4] │ └── • filter @@ -402,15 +402,15 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8k1Fv0zAQx9_5FKdDqCvzmjpJt8lPKSzTCqUZSSWYRoTcxoxIXVxsR2Kq-t1RktGR0WYNIB5zd__73Z3_WaH-tkCGkT_2X08hzb5IOA-Dd3Dtf7wcD0cTODgbRdPo_bgL9zUvqwKuFL_7bPjMW6r0lqs7GEbAKXlIlAEbPlz4oQ8HB5z2ZuB9yvt9RwC3e7MuDCdnUI93VnTd6f7M2D0OZWIOgy4E4Zkfwqsr4LTHSdGCx_fdy7knwRTGo7c-dJJUG5XOcpPKjL3oIMFMJmLCb4VGdo0UCToYE1wqORdaS1WEV2XRKPmOrE8wzZa5KcIxwblUAtkKTWoWAhlO-WwhQsEToaw-EkyE4emibP3bVZBgtOSZZnBkORivCcrcPLTWht8IZHRN_gxv_xO83QZ_ni6MUEJZbp1dxRl49uY1h2E4vLqmjLHRZHoa7-Q7O_kP2DyTKhFKJDVqXCifKtmyxAXXX9_INBPKOq6vEUzAczcbeMWBg9ww8CjxbOI5xHN37uG2uWMklRHKOqnjPeeQePRwQy14pGTvpA5qVLq_eeje5rGcI8u1nu_p3xYjOG1G2NO_T-A3_h38B_9u4YdCL2WmxWMfb-3cL8wrkhtR_Qxa5mouLpWcl5jqMyh1ZSAR2lRZp_oYZWWqfJ9fxbRRbNfE_cdiuwXZfix2GsVuM9ltFJ82iwd_c7DjRvFJM_mk1cHi9bMfAQAA__-KD27e +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8k2Fv2jwQx98_n-J0jybK6hKchLbyq7A1VdkYdAFpq7qoMuTWRaMxsx1pFeK7TwkdLFVJYZv2Lr67__18538WaL7NUOAo7Ievx5BmnxWcR8N3cB1-vOx3ewM4OOuNxqP3_SY81LxcFUit5f2NlZNg_XUz_0r30B2B5GyTLwMufLgIoxAODiRvTSD4lLfbHoF0W5MmdAdnUI03FnzZaP7MuC0JZWIKnSYMo7MwgldXIHlLsqKFjB-6l9cfDMfQ770NoZGkxup0kttUZeJFAxlmKqGBvCOD4ho5MvQwZjjXakrGKF2EF2VRL_mOos0wzea5LcIxw6nShGKBNrUzQoFjOZlRRDIh7bSRYUJWprOy9WY5c53eSX2PDEdzmRkBR46H8ZKhyu2mtbHyllDwJfs9vPtX8O4--PN0ZkmTdvwqexUXELjr1-xGUffqmgsheoPxabyV723lb7B5pnRCmpIKNS6Uz5U8McSFNF_eqDQj7RxXxxgOIPDXEwTFgoe5FRBwFrgs8Fjgb53D32ePI6Utaeekig-8QxbwwzW14LGSvZXaqVD57ubhO5vH8Y4c3_l_R__ucQVvnyvs6N9n8Gv_dv6Bf5_gR2TmKjP02MdPdm4X5qXkllY_g1G5ntKlVtMSszoOS10ZSMjYVdZbHXpZmSrf51cxrxW7FXH7sdjdg-w-Fnu1Yr-e7NeKT-vFnT9Z2HGt-KSefLLXwuLlfz8CAAD__4lXcac= # This query performs a left inverted join with an additional filter. query T EXPLAIN (DISTSQL) -SELECT a1.*, a2.* FROM array_tab@primary AS a2 +SELECT a1.*, a2.* FROM array_tab@array_tab_pkey AS a2 LEFT INVERTED JOIN array_tab@foo_inv AS a1 ON a1.b @> a2.b AND a1.b @> '{1}' AND a2.a < 5 ORDER BY a1.a, a2.a @@ -422,7 +422,7 @@ vectorized: true │ order: +a,+a │ └── • lookup join (left outer) - │ table: array_tab@primary + │ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: (b @> b) AND (b @> ARRAY[1]) @@ -433,15 +433,15 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzkk99O20oQh-_PU4zmhgQ2f9ZOQo6vNufESEapTR23KqIR2sQLchu87tpBoCjvXtlOIQa8JFKv2kvv7Dcz-1m_NaY_lmih_eViMnJcaIydaTD9OGnC1J7Y_wfAafuYADfax3Dmex-AK8UfrzM-Z4mK7rh6hNEUuAET-ywAx_1s-4E9hnPPcXeu3kh5HcX3xVUKnguNBqftObCvq27XFHn7eRNG7hiq50drujlq_qoYbQ5FYQH9Jnj-2Pbhv8t8Q15syJFgLEPh8juRonWFFAmaOCOYKLkQaSpVfrwuLjnhA1pdglGcrLL8eEZwIZVAa41ZlC0FWhjw-VL4godCdbpIMBQZj5ZF61cakOA04XFqQatj4mxDUK6y59Zpxm8FWnRD9h_vxPdCZSI8l1EsVMeobhA8JsIqtXufAtsvnCPBV9aRPHWyHxIFDdZ7EsyMrdyds5Hvjy6vqGVZjhsMZ00k6LnA6JP7bQUJ3kQqzeCbjGKIYkh4pETYyj9zZpVZwChhBmEmYf1aJ8YhTnIX2z_SO9TH85-aSPl9lZSLy9gCZpaPbLDBG2oGOjWpWMg43MNBn7BBrQPzEAdTqTKhOoPq-5l5Qhg9qR3Rqx3x3FmqUCgR1jV-YxdXtmTSGVaJ8tkmYT1SPL52p35lJ7p_GuneaeyYrT3T-M74F2k0_4o0vuNkJ439PzaN7zjYpvH0d6XxjRG-SBMZp6Iyoq5zN4-pCG9FGe1UrtRCXCi5KMaUn17BFQehSLOySssPJy5L-YK7MNXChh42tLCph00t3KvA9CXc08L_6if3tfBADw-08KkePtXCQz08PEjYbPPPzwAAAP__jWQkLg== +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzkk09v2kAQxe_9FKO5BJLlz9pAqE9LiyM5oiY1btUoRdGCN5Eb4nXXJgpCfPfKNuVPGm9A6qm9sTP85s086y0x-TlDC-1vV4Oe40Kl74z80edBFUb2wP7oA6f1UwLcqJ_ChTf8BFwpvrhN-YRtft3GD2IBvRFwAwb2hQ-O-9X2fLsPl0PH3SHupLwNo6f8rxSGLlQqnNYnwL7Pm01TZCqTKvTcPuzXT5Z0dVL93THqHPLGFNpVGHp924MP19miPF-UI8FIBsLljyJB6wYpEjRxTDBWciqSRKqsvMz_5ATPaDUJhlE8T7PymOBUKoHWEtMwnQm00OeTmfAED4RqNJFgIFIezvLR29tiFT5ytUCCo5hHiQW1honjFUE5T7ejk5TfC7Toihwu70RPQqUiuJRhJFTD2N_AX8TCKmwffvFtL_ccCf7hOpLNJPs5VlBhrY3BzFibu1PreV7v-oZaluW4fndcRYJDFxjdeL_uIMG7UCUp_JBhBGEEMQ-VCGrZM2PmqQWMEmYQZhLWLvXEOMaTzIv1F2kd68f2Sw2kfJjHxeIysoCZxZEV1nnFmo7OmkRMZRQc4EGbsE6pB-YxHoykSoVqdPbvZ-YZYfSsVKJVKrGdLFUglAjKBr-yiytrMm5094nibJOwFsmPL92pvbcTPTyN9OA0NszagWl8Q_5FGs3_Io1veLKTxvY_m8Y3PFin8fxvpfEVCU8ksYwSsSdRNrmZxVQE96KIdiLnaiqulJzmMsVzmHN5IRBJWnRp8XCiopUtuAtTLWzoYUMLm3rY1MKtPZi-hFta-L1eua2FO3q4o4XP9fC5Fu7q4e5Rho1X734FAAD__1WRJvc= # This query performs a semi inverted join. query T EXPLAIN (DISTSQL) -SELECT a2.* FROM array_tab@primary AS a2 WHERE EXISTS ( +SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b @> a2.b ) @@ -451,7 +451,7 @@ distribution: full vectorized: true · • lookup join (semi) -│ table: array_tab@primary +│ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -461,15 +461,15 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUkkFP20AQhe_9FaM5QbshsZ2kkk-mxahGIaF2pFK1EdrEA3Ibdt3dNQJF-e_V2hHBEJtwa48zu9_Me6O3Qv1niT6Glxej42gMBydRMk2-jg4hCUfh5ylw9-g9nMaTc-BK8Ycrw-dBrrJbrh7gOAHuwrcvYRxCeGlBONhgL5hrKa8ycVcyzobhztEcgp9Fr-eRXTQ_hEl8Esbw6bstOTIUMqUxvyWN_g90kKGHM4a5kgvSWirbXpWfovQe_R7DTOSFse0Zw4VUhP4KTWaWhD5O-XxJMfGUVLeHDFMyPFuWo1-YQ4ZJzoX2odP1cLZmKAuzHa0NvyH0nTXbf30k7kgZSs9kJkh13SYFm1MheyTC-1xB0H-8VWDZ60xpA79kJiATkPNMUdqxJTKcFMaHwGGBywKPBYNGA-5bDFjhm_P16-KnDzn5MApPp5CE5xGcTaIxsp1XHUn5u8gr3VL4EHhW7xiCYd2epoUU6X7--o3-vEZ_W1tSpaQorTsKnA84W-84wlh2ZN4d1n9v9TQq6deUOPsn1dk7qV2vs2dSX1n_LKnev5fUVww8Sergv0_qDn8x6VwKTTVvTZN7NsaU3lAVey0LtaALJRflmqqclFzZSEmb6tWpikhUT1bgU9hphd122G2FvRrsPIe9Vvhj--Z-Kzxohwet8LAdHr7J82z97m8AAAD__yPJc0A= +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUkkFP20AQhe_9FaM5QbshsZ2kkk-mxahGIaF2pFK1EdrEA3IJu-7uGhGh_Pdq7YhgGptwa2-e8X4z743eI-rfS_QxvLwYHUdjODiJkmnydXQISTgKP0-Bu0fv4TSenANXiq-uDJ8HT19X-S2t4DgB7sK3L2EcQnhpeTjY0H-h11JeZeK-ZJwNw52jOQQ_i17PI7tvfgiT-CSM4dN3W3JkKGRKY35HGv0f6CBDD2cMcyUXpLVUtv1YPorSB_R7DDORF8a2ZwwXUhH6j2gysyT0ccrnS4qJp6S6PWSYkuHZshy9FZqr7I6rFTJMci60D52uh7M1Q1mY7Wht-A2h76zZ_usjcU_KUHomM0Gq6zYp2JwK2RMRPuQKgv7TrQLLXmdKG_glMwGZgJxnitKOLZHhpDA-BA4LXBZ4LBg0GnDfYsAK35yvXxc_XeXkwyg8nUISnkdwNonGyHZedSTlbZFXuqXwIfCs3jEEw7o9TQsp0v389Rv9eY3-trakSklRWncUOB9wtt5xhLHsyLw7rL_e6mlU0q8pcfZPqrN3UrteZ8-kvrL-RVK9fy-prxh4ltTBf5_UHf5i0rkUmmremib3bIwpvaEq9loWakEXSi7KNVU5KbmykZI21V-nKiJR_bICn8NOK-y2w24r7NVg5yXstcIf2zf3W-FBOzxohYft8PBNnmfrd38CAAD__0Ahdgk= # This query performs an anti inverted join. query T EXPLAIN (DISTSQL) -SELECT a2.* FROM array_tab@primary AS a2 WHERE NOT EXISTS ( +SELECT a2.* FROM array_tab@array_tab_pkey AS a2 WHERE NOT EXISTS ( SELECT * FROM array_tab@foo_inv AS a1 WHERE a1.b @> a2.b ) @@ -479,7 +479,7 @@ distribution: full vectorized: true · • lookup join (anti) -│ table: array_tab@primary +│ table: array_tab@array_tab_pkey │ equality: (a) = (a) │ equality cols are key │ pred: b @> b @@ -489,7 +489,7 @@ vectorized: true │ └── • scan missing stats - table: array_tab@primary + table: array_tab@array_tab_pkey spans: FULL SCAN · -Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUk1FP2zAQx9_3KU73BJtLm6TtpDyFjaAFdQlLM41pq5DbHChbsTM7QaCq331yUlFCSSiPPNrx7-5-p39WqP8t0UX_4nxyHIRwcBJMk-m3ySFM_Yn_OQFuH72H0zj6Clwpfn9Z8LmXq-yGq3s4ngK34ccXP_YhjBLwLwwMBxt0h7uS8jITtxVnbThuHc3B-10OBg6ZZvNDiOITP4ZPP82RI0MhUwr5DWl0f6GFDB2cMcyVXJDWUpnrVfUoSO_QHTDMRF4W5nrGcCEVobvCIiuWhC4mfL6kmHhKqj9AhikVPFtWpXcEkeE050K70Os7OFszlGWxLa0Lfk3oWmu2f_tA3JIqKD2TmSDVt5sTJPc5uTDxTxOIvid-DGdRECLDnRUie6jk3-UKvOHDDj1T8ypTuoA_MhOQCch5pijtmSMyjMrCBc9ins08h3mjVjH7NWJGaLPWYavUcZgEu07bbU-k_Fvm9dxSuOA5Zt4QvHFTT9NCinQ_v2Grn9Pqt9WSKiVFadPIsz7gbP3MEkLZk3l_3Hy9nad1kmFjEmv_BFt7J7jv9PZM8AvtnyTYeTsJfkHsUYJHbz7Bz_jFpHMpNDXc2ioPTLwpvab6d9CyVAs6V3JRtamPUcVVFynpov5q1YdA1J_MgI9hqxO2u2G7E3YasPUUdjrhj92dh53wqBsedcLjbnj8KufZ-t3_AAAA__-uNIF5 +Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzUk0Fvm04Qxe__TzGaU_LvOjZguxIn3IaoRC6kmKqpWstam0lE4-zSXYhiWf7uFWDZIQ7EOebG7O6beb_RY4367xJtdK-vxiPPh5NzbxJNvo1PYeKO3c8RcPPsf7gIg6_AleKrWcbnzu5rlt7RCkYT4Cb8-OKGLvhBBO510QNOth0O5DdSzhLxUOqMrY4bZ3Nwfue9nkXFzPkpBOG5G8Knn0XJkaGQMfn8njTav9BAhhZOGaZKLkhrqYrjdfnIix_R7jFMRJpnxfGU4UIqQnuNWZItCW2M-HxJIfGYVLeHDGPKeLIsW--Npiq552qFDCcpF9qGTtfC6YahzLN9a53xW0Lb2LDjx3vigVRG8aVMBKmuWXcQrVKyYexeRBB8j9wQLgPPR4YHK0S26-Q-pgqc_m6HTtHzJlE6gz8yEZAISHmiKO4UJTIM8swGx2COyRyLOYNGMPMtYAXQdq39RqiRH3mHTPttj6W8y9PKtxQ2OFbh1wdnWMfTtJAiPo6v38hnNfLtsaSKSVFcJ3KMDzjdvLAEX3Zk2h3WX-_9NDrp15wYxyfYODrBXatzZIJfGf8swdb7SfArYE8SPHj3CX6BLySdSqGpxtbUuVfEm-Jbqn4HLXO1oCslF-WYqgxKXXkQk86qW6MqPFFdFQafio1WsdkuNlvFVk1sPBdbreKP7ZP7reJBu3jQKh62i4dvYp5u_vsXAAD__1tvhEI= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column index 2362272d017b..73d96ea336df 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column @@ -33,7 +33,7 @@ distribution: local vectorized: true · • lookup join -│ table: j2@primary +│ table: j2@j2_pkey │ equality: (k) = (k) │ equality cols are key │ pred: j @> j @@ -45,7 +45,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: j1@primary + │ table: j1@j1_pkey │ spans: FULL SCAN │ └── • values @@ -60,7 +60,7 @@ distribution: local vectorized: true · • lookup join -│ table: j2@primary +│ table: j2@j2_pkey │ equality: (k) = (k) │ equality cols are key │ pred: j @> j @@ -74,7 +74,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: j1@primary + │ table: j1@j1_pkey │ spans: FULL SCAN │ └── • values @@ -89,7 +89,7 @@ distribution: local vectorized: true · • lookup join -│ table: j2@primary +│ table: j2@j2_pkey │ equality: (k) = (k) │ equality cols are key │ pred: j <@ j @@ -101,7 +101,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: j1@primary + │ table: j1@j1_pkey │ spans: FULL SCAN │ └── • values @@ -116,7 +116,7 @@ distribution: local vectorized: true · • lookup join -│ table: j2@primary +│ table: j2@j2_pkey │ equality: (k) = (k) │ equality cols are key │ pred: j <@ j @@ -130,7 +130,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: j1@primary + │ table: j1@j1_pkey │ spans: FULL SCAN │ └── • values diff --git a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column_dist b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column_dist index 62d0f0f51a7a..37c9c74c2d86 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column_dist +++ b/pkg/sql/opt/exec/execbuilder/testdata/inverted_join_multi_column_dist @@ -97,7 +97,7 @@ vectorized: true │ order: +k,+k │ └── • lookup join - │ table: j2@primary + │ table: j2@j2_pkey │ equality: (k) = (k) │ equality cols are key │ pred: j @> j @@ -109,7 +109,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: j1@primary + │ table: j1@j1_pkey │ spans: FULL SCAN │ └── • values @@ -177,7 +177,7 @@ vectorized: true │ order: +k,+k │ └── • lookup join - │ table: a2@primary + │ table: a2@a2_pkey │ equality: (k) = (k) │ equality cols are key │ pred: a @> a @@ -189,7 +189,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: a1@primary + │ table: a1@a1_pkey │ spans: FULL SCAN │ └── • values diff --git a/pkg/sql/opt/exec/execbuilder/testdata/join b/pkg/sql/opt/exec/execbuilder/testdata/join index c2d57e25bca3..d7ca0b054bfa 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/join +++ b/pkg/sql/opt/exec/execbuilder/testdata/join @@ -19,12 +19,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: onecolumn@primary +│ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -38,12 +38,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: twocolumn@primary +│ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -56,7 +56,7 @@ vectorized: true │ ├── • scan │ missing stats -│ table: twocolumn@primary +│ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • filter @@ -64,7 +64,7 @@ vectorized: true │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -78,12 +78,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: onecolumn@primary +│ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -97,12 +97,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: onecolumn@primary +│ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -127,12 +127,12 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats - │ │ table: onecolumn@primary + │ │ table: onecolumn@onecolumn_pkey │ │ spans: FULL SCAN │ │ │ └── • scan │ missing stats - │ table: twocolumn@primary + │ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • hash join @@ -140,12 +140,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: onecolumn@primary + │ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN # The following queries verify that only the necessary columns are scanned. @@ -162,13 +162,13 @@ vectorized: true ├── • scan │ columns: (x) │ estimated row count: 1,000 (missing stats) -│ table: twocolumn@primary +│ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • scan columns: (y) estimated row count: 1,000 (missing stats) - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -189,13 +189,13 @@ vectorized: true ├── • scan │ columns: (x) │ estimated row count: 1,000 (missing stats) - │ table: twocolumn@primary + │ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -216,13 +216,13 @@ vectorized: true ├── • scan │ columns: (x) │ estimated row count: 1,000 (missing stats) - │ table: twocolumn@primary + │ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -243,13 +243,13 @@ vectorized: true ├── • scan │ columns: (x) │ estimated row count: 1,000 (missing stats) - │ table: twocolumn@primary + │ table: twocolumn@twocolumn_pkey │ spans: FULL SCAN │ └── • scan columns: (y) estimated row count: 1,000 (missing stats) - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN query T @@ -279,7 +279,7 @@ vectorized: true │ └── • scan │ columns: (x) │ estimated row count: 1,000 (missing stats) - │ table: onecolumn@primary + │ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • render @@ -291,7 +291,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN # Ensure that the ordering information for the result of joins is sane. (#12037) @@ -567,7 +567,7 @@ vectorized: true │ └── • scan missing stats - table: customers@primary + table: customers@customers_pkey spans: FULL SCAN # Tests for filter propagation through joins. @@ -591,12 +591,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: pairs@primary +│ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: square@primary + table: square@square_pkey spans: FULL SCAN # The filter expression becomes an ON predicate. @@ -625,13 +625,13 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: pairs@primary + │ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • scan columns: (n, sq) estimated row count: 1,000 (missing stats) - table: square@primary + table: square@square_pkey spans: FULL SCAN # Query similar to the one above, but the filter refers to a rendered @@ -667,13 +667,13 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: pairs@primary + │ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • scan columns: (n, sq) estimated row count: 1,000 (missing stats) - table: square@primary + table: square@square_pkey spans: FULL SCAN # The filter expression must stay on top of the outer join. @@ -702,13 +702,13 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: pairs@primary + │ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • scan columns: (n, sq) estimated row count: 1,000 (missing stats) - table: square@primary + table: square@square_pkey spans: FULL SCAN query T @@ -741,13 +741,13 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: pairs@primary + │ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • scan columns: (n, sq) estimated row count: 1,000 (missing stats) - table: square@primary + table: square@square_pkey spans: FULL SCAN # Filter propagation through outer joins. @@ -780,7 +780,7 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: pairs@primary + │ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • filter @@ -791,7 +791,7 @@ vectorized: true └── • scan columns: (n, sq) estimated row count: 333 (missing stats) - table: square@primary + table: square@square_pkey spans: -/5/# query T @@ -817,7 +817,7 @@ vectorized: true ├── • scan │ columns: (n, sq) │ estimated row count: 333 (missing stats) - │ table: square@primary + │ table: square@square_pkey │ spans: /2- │ └── • filter @@ -828,7 +828,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: pairs@primary + table: pairs@pairs_pkey spans: FULL SCAN # The simpler plan for an inner join, to compare. @@ -854,13 +854,13 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) -│ table: pairs@primary +│ table: pairs@pairs_pkey │ spans: FULL SCAN │ └── • scan columns: (n, sq) estimated row count: 4 (missing stats) - table: square@primary + table: square@square_pkey spans: /2-/5/# parallel @@ -889,13 +889,13 @@ vectorized: true ├── • scan │ columns: (x, y) │ estimated row count: 1,000 (missing stats) - │ table: t1@primary + │ table: t1@t1_pkey │ spans: FULL SCAN │ └── • scan columns: (y, x) estimated row count: 1,000 (missing stats) - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN # Tests for merge join ordering information. @@ -927,13 +927,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) -│ table: pkba@primary +│ table: pkba@pkba_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: pkbc@primary + table: pkbc@pkbc_pkey spans: FULL SCAN query T @@ -958,14 +958,14 @@ vectorized: true │ columns: (a, b, c, d) │ ordering: +b,+a,+d │ estimated row count: 1,000 (missing stats) - │ table: pkbad@primary + │ table: pkbad@pkbad_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) ordering: +b,+a estimated row count: 1,000 (missing stats) - table: pkba@primary + table: pkba@pkba_pkey spans: FULL SCAN query T @@ -990,14 +990,14 @@ vectorized: true │ columns: (a, b, c, d) │ ordering: +b,+a,+c │ estimated row count: 1,000 (missing stats) - │ table: pkbac@primary + │ table: pkbac@pkbac_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) ordering: +b,+a,+c estimated row count: 1,000 (missing stats) - table: pkbac@primary + table: pkbac@pkbac_pkey spans: FULL SCAN query T @@ -1018,14 +1018,14 @@ vectorized: true │ columns: (a, b, c, d) │ ordering: +b,+a,+c │ estimated row count: 1,000 (missing stats) -│ table: pkbac@primary +│ table: pkbac@pkbac_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) ordering: +b,+a,+d estimated row count: 1,000 (missing stats) - table: pkbad@primary + table: pkbad@pkbad_pkey spans: FULL SCAN # Tests with joins with merged columns of collated string type. @@ -1052,13 +1052,13 @@ vectorized: true ├── • scan │ columns: (s) │ estimated row count: 1,000 (missing stats) - │ table: str1@primary + │ table: str1@str1_pkey │ spans: FULL SCAN │ └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: str2@primary + table: str2@str2_pkey spans: FULL SCAN query T @@ -1078,13 +1078,13 @@ vectorized: true ├── • scan │ columns: (s) │ estimated row count: 1,000 (missing stats) - │ table: str1@primary + │ table: str1@str1_pkey │ spans: FULL SCAN │ └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: str2@primary + table: str2@str2_pkey spans: FULL SCAN query T @@ -1108,13 +1108,13 @@ vectorized: true ├── • scan │ columns: (s) │ estimated row count: 1,000 (missing stats) - │ table: str2@primary + │ table: str2@str2_pkey │ spans: FULL SCAN │ └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: str1@primary + table: str1@str1_pkey spans: FULL SCAN query T @@ -1138,13 +1138,13 @@ vectorized: true ├── • scan │ columns: (s) │ estimated row count: 1,000 (missing stats) - │ table: str1@primary + │ table: str1@str1_pkey │ spans: FULL SCAN │ └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: str2@primary + table: str2@str2_pkey spans: FULL SCAN # Verify that we resolve the merged column a to str2.a but use IFNULL for @@ -1173,14 +1173,14 @@ vectorized: true │ columns: (a, s) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: str2@primary + │ table: str2@str2_pkey │ spans: FULL SCAN │ └── • scan columns: (a, s) ordering: +a estimated row count: 1,000 (missing stats) - table: str1@primary + table: str1@str1_pkey spans: FULL SCAN @@ -1210,14 +1210,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 333 (missing stats) - │ table: xyu@primary + │ table: xyu@xyu_pkey │ spans: /3- │ └── • scan columns: (x, y, v) ordering: +x,+y estimated row count: 333 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /3- query T @@ -1240,14 +1240,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 333 (missing stats) - │ table: xyu@primary + │ table: xyu@xyu_pkey │ spans: /3- │ └── • scan columns: (x, y, v) ordering: +x,+y estimated row count: 333 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /3- query T @@ -1270,14 +1270,14 @@ vectorized: true │ columns: (x, y, v) │ ordering: +x,+y │ estimated row count: 333 (missing stats) - │ table: xyv@primary + │ table: xyv@xyv_pkey │ spans: /3- │ └── • scan columns: (x, y, u) ordering: +x,+y estimated row count: 333 (missing stats) - table: xyu@primary + table: xyu@xyu_pkey spans: /3- query T @@ -1309,14 +1309,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 1,000 (missing stats) - │ table: xyu@primary + │ table: xyu@xyu_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y, v) ordering: +x,+y estimated row count: 1,000 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: FULL SCAN # Verify that we transfer constraints between the two sides. @@ -1336,14 +1336,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +y │ estimated row count: 9 (missing stats) -│ table: xyu@primary +│ table: xyu@xyu_pkey │ spans: /1-/1/10 │ └── • scan columns: (x, y, v) ordering: +y estimated row count: 9 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /1-/1/10 query T @@ -1362,14 +1362,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +y │ estimated row count: 9 (missing stats) -│ table: xyu@primary +│ table: xyu@xyu_pkey │ spans: /1-/1/10 │ └── • scan columns: (x, y, v) ordering: +y estimated row count: 9 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /1-/1/10 query T @@ -1388,14 +1388,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 1,000 (missing stats) -│ table: xyu@primary +│ table: xyu@xyu_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y, v) ordering: +y estimated row count: 9 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /1-/1/10 query T @@ -1414,14 +1414,14 @@ vectorized: true │ columns: (x, y, v) │ ordering: +x,+y │ estimated row count: 1,000 (missing stats) -│ table: xyv@primary +│ table: xyv@xyv_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y, u) ordering: +y estimated row count: 9 (missing stats) - table: xyu@primary + table: xyu@xyu_pkey spans: /1-/1/10 @@ -1447,14 +1447,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 333 (missing stats) - │ table: xyu@primary + │ table: xyu@xyu_pkey │ spans: /3- │ └── • scan columns: (x, y, v) ordering: +x,+y estimated row count: 333 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /3- query T @@ -1477,14 +1477,14 @@ vectorized: true │ columns: (x, y, v) │ ordering: +x,+y │ estimated row count: 333 (missing stats) - │ table: xyv@primary + │ table: xyv@xyv_pkey │ spans: /3- │ └── • scan columns: (x, y, u) ordering: +x,+y estimated row count: 333 (missing stats) - table: xyu@primary + table: xyu@xyu_pkey spans: /3- query T @@ -1516,14 +1516,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 1,000 (missing stats) - │ table: xyu@primary + │ table: xyu@xyu_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y, v) ordering: +x,+y estimated row count: 1,000 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: FULL SCAN query T @@ -1542,14 +1542,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 1,000 (missing stats) -│ table: xyu@primary +│ table: xyu@xyu_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y, v) ordering: +y estimated row count: 9 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: /1-/1/10 query T @@ -1568,14 +1568,14 @@ vectorized: true │ columns: (x, y, v) │ ordering: +x,+y │ estimated row count: 1,000 (missing stats) -│ table: xyv@primary +│ table: xyv@xyv_pkey │ spans: FULL SCAN │ └── • scan columns: (x, y, u) ordering: +y estimated row count: 9 (missing stats) - table: xyu@primary + table: xyu@xyu_pkey spans: /1-/1/10 # Regression test for #20472: break up tuple inequalities. @@ -1599,14 +1599,14 @@ vectorized: true │ columns: (x, y, u) │ ordering: +x,+y │ estimated row count: 333 (missing stats) - │ table: xyu@primary + │ table: xyu@xyu_pkey │ spans: /1/2/4- │ └── • scan columns: (x, y, v) ordering: +x,+y estimated row count: 1,000 (missing stats) - table: xyv@primary + table: xyv@xyv_pkey spans: FULL SCAN @@ -1641,13 +1641,13 @@ vectorized: true ├── • scan │ columns: (a, b1) │ estimated row count: 1 (missing stats) - │ table: l@primary + │ table: l@l_pkey │ spans: /3/0 │ └── • scan columns: (a, b2) estimated row count: 1 (missing stats) - table: r@primary + table: r@r_pkey spans: /3/0 query T @@ -1667,13 +1667,13 @@ vectorized: true ├── • scan │ columns: (a, b1) │ estimated row count: 1 (missing stats) -│ table: l@primary +│ table: l@l_pkey │ spans: /3/0 │ └── • scan columns: (a, b2) estimated row count: 1 (missing stats) - table: r@primary + table: r@r_pkey spans: /3/0 query T @@ -1697,13 +1697,13 @@ vectorized: true ├── • scan │ columns: (a, b2) │ estimated row count: 1 (missing stats) - │ table: r@primary + │ table: r@r_pkey │ spans: /3/0 │ └── • scan columns: (a, b1) estimated row count: 1 (missing stats) - table: l@primary + table: l@l_pkey spans: /3/0 query T @@ -1723,13 +1723,13 @@ vectorized: true ├── • scan │ columns: (a, b2) │ estimated row count: 1 (missing stats) -│ table: r@primary +│ table: r@r_pkey │ spans: /3/0 │ └── • scan columns: (a, b1) estimated row count: 1 (missing stats) - table: l@primary + table: l@l_pkey spans: /3/0 # Regression tests for #21243 @@ -1764,12 +1764,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: abcdef@primary +│ table: abcdef@abcdef_pkey │ spans: [/1/2/6/9 - ] │ └── • scan missing stats - table: abg@primary + table: abg@abg_pkey spans: FULL SCAN # Regression tests for mixed-type equality columns (#22514). @@ -1809,13 +1809,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) - │ table: foo@primary + │ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # b can't be an equality column. @@ -1837,13 +1837,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) - │ table: foo@primary + │ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # Only a can be an equality column. @@ -1866,13 +1866,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) - │ table: foo@primary + │ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # Only a and c can be equality columns. @@ -1895,13 +1895,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) - │ table: foo@primary + │ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # b can't be an equality column. @@ -1919,13 +1919,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) -│ table: foo@primary +│ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # Only a can be an equality column. @@ -1944,13 +1944,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) -│ table: foo@primary +│ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN query T @@ -1967,13 +1967,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) -│ table: foo@primary +│ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # Only a can be an equality column. @@ -1992,13 +1992,13 @@ vectorized: true ├── • scan │ columns: (a, b, c, d) │ estimated row count: 1,000 (missing stats) -│ table: foo@primary +│ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # Only a and c can be equality columns. @@ -2014,12 +2014,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: foo@primary +│ table: foo@foo_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: bar@primary + table: bar@bar_pkey spans: FULL SCAN # Zigzag join tests. @@ -2045,7 +2045,7 @@ vectorized: true │ filter: c = 6.0 │ └── • index join - │ table: zigzag@primary + │ table: zigzag@zigzag_pkey │ └── • scan missing stats @@ -2065,7 +2065,7 @@ vectorized: true │ filter: c = 6.0 │ └── • index join - │ table: zigzag@primary + │ table: zigzag@zigzag_pkey │ └── • scan missing stats @@ -2101,7 +2101,7 @@ distribution: local vectorized: true · • lookup join -│ table: zigzag@primary +│ table: zigzag@zigzag_pkey │ equality: (a) = (a) │ equality cols are key │ @@ -2122,7 +2122,7 @@ distribution: local vectorized: true · • lookup join -│ table: zigzag@primary +│ table: zigzag@zigzag_pkey │ equality: (a) = (a) │ equality cols are key │ pred: d > 4.0 @@ -2160,7 +2160,7 @@ vectorized: true │ filter: c IS NULL │ └── • index join - │ table: zigzag2@primary + │ table: zigzag2@zigzag2_pkey │ └── • scan missing stats @@ -2182,7 +2182,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: onecolumn@primary +│ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • sort @@ -2190,7 +2190,7 @@ vectorized: true │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN # Test that we can force a merge join using the NATURAL syntax. @@ -2208,7 +2208,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: onecolumn@primary +│ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • sort @@ -2216,7 +2216,7 @@ vectorized: true │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN # Test that we can force a merge join using the CROSS syntax. @@ -2234,7 +2234,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: onecolumn@primary +│ table: onecolumn@onecolumn_pkey │ spans: FULL SCAN │ └── • sort @@ -2242,7 +2242,7 @@ vectorized: true │ └── • scan missing stats - table: twocolumn@primary + table: twocolumn@twocolumn_pkey spans: FULL SCAN statement error LOOKUP can only be used with INNER or LEFT joins @@ -2267,10 +2267,10 @@ vectorized: true │ ├── • scan │ missing stats -│ table: cards@primary +│ table: cards@cards_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: customers@primary + table: customers@customers_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/join_order b/pkg/sql/opt/exec/execbuilder/testdata/join_order index 93d02f3846da..30823a1c3850 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/join_order +++ b/pkg/sql/opt/exec/execbuilder/testdata/join_order @@ -45,21 +45,21 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, b, x, c, y) │ estimated row count: 1 (missing stats) -│ table: cy@primary +│ table: cy@cy_pkey │ equality: (c) = (c) │ equality cols are key │ └── • lookup join (inner) │ columns: (a, b, c, d, b, x) │ estimated row count: 1 (missing stats) - │ table: bx@primary + │ table: bx@bx_pkey │ equality: (b) = (b) │ equality cols are key │ └── • scan columns: (a, b, c, d) estimated row count: 1 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: /1/0 statement ok @@ -74,19 +74,19 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, b, x, c, y) │ estimated row count: 1 (missing stats) -│ table: cy@primary +│ table: cy@cy_pkey │ equality: (c) = (c) │ equality cols are key │ └── • lookup join (inner) │ columns: (a, b, c, d, b, x) │ estimated row count: 1 (missing stats) - │ table: bx@primary + │ table: bx@bx_pkey │ equality: (b) = (b) │ equality cols are key │ └── • scan columns: (a, b, c, d) estimated row count: 1 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: /1/0 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/limit b/pkg/sql/opt/exec/execbuilder/testdata/limit index 54ffdcd3ee20..f7d44a2d77d5 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/limit +++ b/pkg/sql/opt/exec/execbuilder/testdata/limit @@ -25,7 +25,7 @@ vectorized: true │ columns: (k, v, w) │ ordering: +v │ estimated row count: 30 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ key columns: k │ └── • scan @@ -66,7 +66,7 @@ vectorized: true └── • scan columns: (w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -79,7 +79,7 @@ vectorized: true columns: (k, v) ordering: +k estimated row count: 5 (missing stats) - table: t@primary + table: t@t_pkey spans: LIMITED SCAN limit: 5 @@ -98,7 +98,7 @@ vectorized: true columns: (k, v) ordering: +k estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -172,7 +172,7 @@ vectorized: true columns: (k, v, w) ordering: +k estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -250,7 +250,7 @@ vectorized: true └── • scan columns: (k, v, w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -266,7 +266,7 @@ vectorized: true │ columns: (k, v, w) │ ordering: +v │ estimated row count: 10 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ key columns: k │ └── • scan @@ -307,7 +307,7 @@ vectorized: true columns: (k, v, w) ordering: +k estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Regression test for #47283: scan with both hard limit and soft limit. @@ -334,7 +334,7 @@ vectorized: true └── • scan columns: (k, a) estimated row count: 4 (missing stats) - table: t_47283@primary + table: t_47283@t_47283_pkey spans: LIMITED SCAN limit: 4 @@ -488,7 +488,7 @@ vectorized: true └── • scan columns: (k, v, w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/lookup_join b/pkg/sql/opt/exec/execbuilder/testdata/lookup_join index 2197daf43e8b..50a77d7e56f3 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/lookup_join +++ b/pkg/sql/opt/exec/execbuilder/testdata/lookup_join @@ -37,13 +37,13 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, e, f) │ estimated row count: 99 -│ table: def@primary +│ table: def@def_pkey │ equality: (b) = (f) │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -55,14 +55,14 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, e, f) │ estimated row count: 0 -│ table: def@primary +│ table: def@def_pkey │ equality: (b, c) = (f,e) │ equality cols are key │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -74,13 +74,13 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, e, f) │ estimated row count: 33 -│ table: def@primary +│ table: def@def_pkey │ lookup condition: (f = b) AND (e > 1) │ └── • scan columns: (a, b, c) estimated row count: 33 (33% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: /2- query T @@ -92,14 +92,14 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, e, f) │ estimated row count: 33 -│ table: def@primary +│ table: def@def_pkey │ equality: (a) = (f) │ pred: f > 1 │ └── • scan columns: (a, b, c) estimated row count: 33 (33% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: /2- query T @@ -111,14 +111,14 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, e, f) │ estimated row count: 33 -│ table: def@primary +│ table: def@def_pkey │ equality: (b) = (f) │ pred: a >= e │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -130,14 +130,14 @@ vectorized: true • lookup join (inner) │ columns: (a, b, c, d, e, f) │ estimated row count: 33 -│ table: def@primary +│ table: def@def_pkey │ equality: (b) = (f) │ pred: a >= e │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Verify a distsql plan. @@ -195,7 +195,7 @@ vectorized: true └── • lookup join (inner) │ columns: (a, b, c, d, a, b, c, d) │ estimated row count: 0 - │ table: data@primary + │ table: data@data_pkey │ equality: (a, b, c, d) = (a,b,c,d) │ equality cols are key │ pred: c > 0 @@ -208,7 +208,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 100,000 (100% of the table; stats collected ago) - table: data@primary + table: data@data_pkey spans: FULL SCAN query T @@ -222,7 +222,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: data@primary +│ table: data@data_pkey │ equality: (a, b, c, d) = (a,b,c,d) │ equality cols are key │ pred: c > 0 @@ -233,7 +233,7 @@ vectorized: true │ └── • scan estimated row count: 100,000 (100% of the table; stats collected ago) - table: data@primary + table: data@data_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzElV-P0kwYxe_fT_Hkudp9M007_bMLk5iUKBvZYFkBo4lyUelkrXY7ddomGsJ3N22VpQRmKhC8nOmcnvPM7ySzwvx7ggyHHx7Gg1EAV69Gs_ns7fgaZsPx8OUc_oe76eQNXLWXUViE8P71cDqEJbwAeg2DGSQQDObvpoMx3E-qXykkn0rLcjhYtU4iwVREPAifeI7sI1IkaCNBBwm6SNDDBcFMiiXPcyGrI6taMIp-ILMIxmlWFtX2guBSSI5shUVcJBwZzsPPCZ_yMOLStJBgxIswTmqbKpGfyfgplD-R4CwL05yBYVII0wgoiOILl7hYExRl8eyQF-EjR0bXpHuKuzgpuOTS9NoRmn0GvlPdImNsFMx7By3tv7G8F3H6e26qHnwsxLcyg68iTkGkDHxKfJv4DvGry58E4N9ugP2JSHBSFu2jh1I7B1M_hy1TISMuedQKuljvmSsQhshM6u2c3O_ttrxp96rQLlUxqWHaR5RFk2NTlpvzlUVjuV0W9egXLYvdHZjdCZhtmM4RwDQ5NsBuzwdMY7kNTD36RYE53YE5nYA5hukeAUyTYwOsdz5gGsttYOrRLwrM7Q7M7QTMNUzvCGCaHBtg_fMB01huA1OP_s_ezz2ppzzPRJrzTq-jVb2vPHrkzWOci1Iu-YMUy9qmWU5qXb0R8bxovtJmMUqbT1XAbTFVim212FaKnZaY7ooddewbtbWrVHtqsacUa5xvThn6VinuqZ17SnFfLe6fEptqOqYrmbplVFMzelLPqKZorsZc3TSqqRpVd203-2L9368AAAD__3AfaVA= @@ -284,7 +284,7 @@ vectorized: true │ columns: (title, shelf, title, shelf) │ ordering: +title │ estimated row count: 327 - │ table: books2@primary + │ table: books2@books2_pkey │ equality: (title) = (title) │ pred: shelf != shelf │ @@ -292,7 +292,7 @@ vectorized: true columns: (title, shelf) ordering: +title estimated row count: 100 (100% of the table; stats collected ago) - table: books@primary + table: books@books_pkey spans: FULL SCAN statement ok @@ -325,7 +325,7 @@ vectorized: true └── • lookup join (inner) │ columns: (title, shelf, name, book, title, shelf) │ estimated row count: 323 - │ table: books2@primary + │ table: books2@books2_pkey │ equality: (book) = (title) │ pred: shelf != shelf │ @@ -337,13 +337,13 @@ vectorized: true ├── • scan │ columns: (title, shelf) │ estimated row count: 100 (100% of the table; stats collected ago) - │ table: books@primary + │ table: books@books_pkey │ spans: FULL SCAN │ └── • scan columns: (name, book) estimated row count: 100 (100% of the table; stats collected ago) - table: authors@primary + table: authors@authors_pkey spans: FULL SCAN # Verify data placement. @@ -365,7 +365,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 323 - │ table: books2@primary + │ table: books2@books2_pkey │ equality: (book) = (title) │ pred: shelf != shelf │ @@ -375,12 +375,12 @@ vectorized: true │ ├── • scan │ estimated row count: 100 (100% of the table; stats collected ago) - │ table: books@primary + │ table: books@books_pkey │ spans: FULL SCAN │ └── • scan estimated row count: 100 (100% of the table; stats collected ago) - table: authors@primary + table: authors@authors_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyck1Fv2jAQx9_3KW73lEheIU7opEiVggpTmRh0gLRJEw8JuULWYGe2I21CfPcpDl0bBOnoW86-3__-d77sUP_KMcTh9_txfzQBZzCaL-Zfxy7Mh-Ph7QKqeDS5XUBcmo1U-krEW4JPs-kXSKR81NCfQ-KxOuA24uwpGb7dDWdDcJzEuzKZyQluIOH1pwv9yQCcJ9mKr24Pie7hOvGu9IbyB3hvSfvtIkMhU5rEW9IY_kAPlwwLJVektVTV0c4mjNLfGHYZZqIoTXW8ZLiSijDcoa2CIS7iJKcZxSmpThcZpmTiLLeytqWoUNk2Vn-Q4byIhQ7hAzKcliaEyGORj8s9Q1ma5wraxGvC0Nuzt7nwmi4OA3rFBz_rg5_18Vy-FFKlpChtlF5W5GspJ5q5i_Xms8wEqQ5v9pLTg3Eiz71R2XpjnIi7jR5Y5LMoONuJf8lEKwOHgfonnpW_mOdYyseygJ8yEyBFCFFQuZpAxKutiz7-83j-sYNLrA0ybTKxMp2gaSzyzur33qTf-2_960v0Z6QLKTQdL8tJ5W61IZSuqd44LUu1onslV7ZMHU4tZw9S0qa-5XUwEvbK_k0vYe8CmB_DvBX2G3D3GPZb4aAdDlrhXjvca4Wvj-Dl_t3fAAAA___-ZuVx @@ -400,7 +400,7 @@ vectorized: true │ columns: (name, book, title) │ ordering: +name │ estimated row count: 990 - │ table: books2@primary + │ table: books2@books2_pkey │ equality: (book) = (title) │ └── • sort @@ -412,7 +412,7 @@ vectorized: true └── • scan columns: (name, book) estimated row count: 100 (100% of the table; stats collected ago) - table: authors@primary + table: authors@authors_pkey spans: FULL SCAN # Cross joins should not be planned as lookup joins. @@ -429,13 +429,13 @@ vectorized: true ├── • scan │ columns: (title, edition, shelf) │ estimated row count: 10,000 (100% of the table; stats collected ago) -│ table: books2@primary +│ table: books2@books2_pkey │ spans: FULL SCAN │ └── • scan columns: (title, edition, shelf) estimated row count: 100 (100% of the table; stats collected ago) - table: books@primary + table: books@books_pkey spans: FULL SCAN query T @@ -445,7 +445,7 @@ distribution: full vectorized: true · • lookup join -│ table: books2@primary +│ table: books2@books2_pkey │ equality: (book, lookup_join_const_col_@7) = (title,edition) │ equality cols are key │ @@ -454,7 +454,7 @@ vectorized: true │ └── • scan estimated row count: 100 (100% of the table; stats collected ago) - table: authors@primary + table: authors@authors_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyUkd-L00AQx9_9K4Z5Upm7a1JPZOFgRSPmqMmZFhSkD3vd4VyvtxN3N6CU_u-S5Iqt0KpvmR-fbz7JbDB-X6PC4vPN7HVZwdO35Xwx_zh7BvNiVrxZwHN419QfwHTpq4QIZVUVDVzXZQW3Ivcxh3r3dM7WJSceriCDT--LptgNkktrhqtdyHnfRkIvlivzwBHVF8yQ8BKXhG2QFccooW9vhqXS_kA1IXS-7VLfXhKuJDCqDQ7ZqLCSM2kvciS0nIxbD2tbQunSbygmc8eoplvaC85OBy_M7ZobNpbDxeQgHh-_R7fBPZjwEwnnrfFRwRkSNuwtBwWZUqqsFq8IdEagczxmlf2P1bU4_yiVHUqN_3zPaSZy37XwTZwH8Qr0lHTP1F1SoHPq6xekL0m_POqWH7j95RQNx1Z85H-6xWS7JGR7x-O5o3RhxTdBVsNrxrIeuKFhOaZxOh2L0o-jXnAfzk7C-Wk4PwlP_oCX2ye_AgAA__98nw4O @@ -520,7 +520,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN # Lookup join on non-covering secondary index @@ -540,7 +540,7 @@ vectorized: true │ └── • lookup join (inner) │ columns: (a, a, b, d) - │ table: large@primary + │ table: large@large_pkey │ equality: (a, b) = (a,b) │ equality cols are key │ @@ -553,7 +553,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN ############################ @@ -570,13 +570,13 @@ vectorized: true • lookup join (left outer) │ columns: (b, a) │ estimated row count: 100 -│ table: large@primary +│ table: large@large_pkey │ equality: (b) = (a) │ └── • scan columns: (b) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN # Left join should preserve input order. @@ -595,7 +595,7 @@ vectorized: true │ columns: (a, a, b) │ ordering: +a │ estimated row count: 100 - │ table: large@primary + │ table: large@large_pkey │ equality: (a) = (a) │ pred: (b % 6) = 0 │ @@ -603,7 +603,7 @@ vectorized: true columns: (a) ordering: +a estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN query T @@ -614,13 +614,13 @@ vectorized: true · • lookup join (left outer) │ estimated row count: 100 -│ table: large@primary +│ table: large@large_pkey │ equality: (a) = (a) │ pred: (b % 6) = 0 │ └── • scan estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlVFr2z4Uxd__n-Jy4Q8JU-rIdtJUUEi3uuCS2Z3jwcbIgxqLzptrebICKyXffVguq1MW2-CXvMVSjs45vyvQM5a_MmTofblbXfkBjK79dbz-tBrD2lt5H2LQ9IwT0PbZPdxE4UcoH3mWwdUaNIWVdxPDbegHkHH1IMyqDWEAo0oFl5WMj-EquIbRyBzxP8zHcAnTMYTRtRfB-6_GAAnmMhEBfxQlsm9IkaCNBB0k6CLBGW4IFkpuRVlKVf3l2Qj85DeyKcE0L3a6Wt4Q3EolkD2jTnUmkGHM7zMRCZ4IZU2RYCI0TzNjY7osC5U-cvWEBNcFz0sGE4sCzxOgIPV3oZBguNMMlhQ3e4Jyp1_NSs0fBDK6J_0D3co0f8kzO8wTPxWC1VTDz7EXGbZI0NBt5FxJ-XNXwA-Z5iBzk4xghX3pVIQZY34QLwzol9-vHcjSJkvnaBP7aJPXAlIlQonkMPuSvsPN_h91AzmRhUXfoP-b5ngU5yAK7T9l2mvKFp1Y9qA5d0RqzHl-4nO2-8O1-8G1J5YzCG5HpAbc8xOH6_SH6_SD60wsdxDcjkgNuIsTh-v2h-v2g-tOrNkguB2RGnAvThxux0MWibKQeSkOWhw7eVq9DSJ5EPVbUsqd2oo7JbfGpv4Mjc4sJKLU9S6tP_y83qoCNsW0VWwfiOlbsd3u3GHttKrddrE7JPesVTxvd54PcT5vFS_anRdDnC_aZzXtuCbtl-yt92b_358AAAD__1JDeNY= @@ -645,7 +645,7 @@ vectorized: true └── • scan columns: (c) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN # Left join against non-covering secondary index @@ -665,7 +665,7 @@ vectorized: true │ └── • lookup join (left outer) │ columns: (c, a, b, d) - │ table: large@primary + │ table: large@large_pkey │ equality: (a, b) = (a,b) │ equality cols are key │ @@ -678,7 +678,7 @@ vectorized: true └── • scan columns: (c) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN # Left join with ON filter on covering index @@ -702,7 +702,7 @@ vectorized: true └── • scan columns: (c) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN # Left join with ON filter on non-covering index @@ -731,13 +731,13 @@ vectorized: true │ └── • scan │ columns: (b, d) │ estimated row count: 10,000 (100% of the table; stats collected ago) - │ table: large@primary + │ table: large@large_pkey │ spans: FULL SCAN │ └── • scan columns: (c) estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN ########################################################### @@ -778,7 +778,7 @@ vectorized: true └── • scan columns: (a, d, e) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Test unique version of same index. (Lookup join should not use column a.) @@ -814,7 +814,7 @@ vectorized: true └── • scan columns: (a, d, e) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Test index with first primary key column explicit and the rest implicit. @@ -848,7 +848,7 @@ vectorized: true └── • scan columns: (a, b, d, e) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Test index with middle primary key column explicit and the rest implicit. @@ -882,7 +882,7 @@ vectorized: true └── • scan columns: (a, b, d, e) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Test index with last primary key column explicit and the rest implicit. @@ -917,7 +917,7 @@ vectorized: true └── • scan columns: (a, d, e) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -930,14 +930,14 @@ vectorized: true │ columns: (d, e, f, a, b, c) │ ordering: +a │ estimated row count: 100 -│ table: def@primary +│ table: def@def_pkey │ equality: (a) = (f) │ └── • scan columns: (a, b, c) ordering: +a estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Test that we don't get a lookup join if we force a merge join. @@ -958,14 +958,14 @@ vectorized: true │ columns: (d, e, f) │ ordering: +f │ estimated row count: 10,000 (100% of the table; stats collected ago) -│ table: def@primary +│ table: def@def_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c) ordering: +a estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Test that we don't get a lookup join if we force a hash join. @@ -989,13 +989,13 @@ vectorized: true ├── • scan │ columns: (d, e, f) │ estimated row count: 10,000 (100% of the table; stats collected ago) - │ table: def@primary + │ table: def@def_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Test lookup semi and anti join. @@ -1008,13 +1008,13 @@ vectorized: true • lookup join (semi) │ columns: (a, b, c) │ estimated row count: 100 -│ table: def@primary +│ table: def@def_pkey │ equality: (a) = (f) │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -1026,13 +1026,13 @@ vectorized: true • lookup join (anti) │ columns: (a, b, c) │ estimated row count: 0 -│ table: def@primary +│ table: def@def_pkey │ equality: (a) = (f) │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -1044,14 +1044,14 @@ vectorized: true • lookup join (semi) │ columns: (a, b, c) │ estimated row count: 100 -│ table: def@primary +│ table: def@def_pkey │ equality: (a, c) = (f,e) │ equality cols are key │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -1063,14 +1063,14 @@ vectorized: true • lookup join (anti) │ columns: (a, b, c) │ estimated row count: 0 -│ table: def@primary +│ table: def@def_pkey │ equality: (a, c) = (f,e) │ equality cols are key │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -1082,14 +1082,14 @@ vectorized: true • lookup join (semi) │ columns: (a, b, c) │ estimated row count: 33 -│ table: def@primary +│ table: def@def_pkey │ equality: (a) = (f) │ pred: (d + b) > 1 │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -1101,14 +1101,14 @@ vectorized: true • lookup join (anti) │ columns: (a, b, c) │ estimated row count: 67 -│ table: def@primary +│ table: def@def_pkey │ equality: (a) = (f) │ pred: (d + b) > 1 │ └── • scan columns: (a, b, c) estimated row count: 100 (100% of the table; stats collected ago) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -1120,12 +1120,12 @@ vectorized: true · • lookup join (semi) │ estimated row count: 100 -│ table: data@primary +│ table: data@data_pkey │ equality: (a) = (a) │ └── • scan estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMlFFvmzwUhu-_X3F0rlp9psRA0hRpUraValRp0pFI6zTlwg1Wx0Ywsx1pVZT_PgGdSqrWWOIiu8ScV-_Dc5B3qH7lGGJ0dzt9H8_g5DJeLBefp6ewiKbRxyUwAvdwlcxvQG1YnsOXT1ESQXRXjcHJ36FmImWaPQ3Uw2cM3tWHZ-wU5slllMCHr8CQYCFSPmMbrjD8hhQJekjQR4IBEhziimApxZorJWQ1sqsDcfobwwHBrCi3ujpeEVwLyTHcoc50zjHEJbvPecJZyqU7QIIp1yzL65oaaVLKbMPkIxJclKxQITguBVakQEHo71wiwflWhzChZOLhak9QbPVzn9LsgWNI98Se6VpkxRPS8BBp-VjyEKbR1RIW0U0M1_N4Vk0wzVqgUyF-bkv4IbICRFGh2UF6b0I-swmZcsnTQ6wJ_R9X-1e-ZCYcUbr0UOxb9f5BPbXfG7Xam0sd1-u7uQ6q1uZGx9ucZ6_Os1PnOa7fV10HVUvd-fHU-fbqfDt1vuMGfdV1ULXUjY-nLrBXF9ipCxx32FddB1VL3cW_cdW-AplwVYpCcatbdFDdwzx94M29rcRWrvmtFOu6pnmc17n6IOVKN29p8xAXzasKsB2mxrB3EKYvw565uaPaN6YDczjowz00hkfm5lGf5nNjeGxuHvdpvjDvatDxm5h_spfdq_1_fwIAAP__leZNdA== @@ -1139,7 +1139,7 @@ vectorized: true · • lookup join (semi) │ estimated row count: 11 -│ table: data@primary +│ table: data@data_pkey │ equality: (a) = (a) │ pred: (b + c) > 15 │ @@ -1149,7 +1149,7 @@ vectorized: true │ └── • scan estimated row count: 100 (100% of the table; stats collected ago) - table: small@primary + table: small@small_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzMll9vmzAUxd_3Ka7uE1GcEvOnTZEm0a1Uo0pJl0Rapy0PTrA6NooZEGlVle8-AW1KqsVmQpHymAuHc3x_R4qfMP8do4Pe3e34wg9Au_Rn89nncQ9m3tj7OAdGYAlX08kN5A8sjuHLJ2_qgaYx6MOyB9_Xw6G5AmPYg4vgEry7Ug7ai7hWhqxgL8LqKycM3lfTE1brtOf5Evr1fPX8aQ7U7vVgMr30pvDhKzAkmIiQB-yB5-h8Q4oEDSRoIkELCdq4IJhmYsXzXGTlK0-VwA__oDMkGCXpuijHC4IrkXF0nrCIipijg3O2jPmUs5Bn-hAJhrxgUVzZVPHcNIseWPaIBGcpS3IHBjoFloRAQRQ_eIYEJ-vCAZcS18DFhqBYF69-ecHuOTp0Q9pnuorigmc80-3dQPXcAc2l0AfXaKBwHMcP5qO9_sb_-F-LKHleCX2zk_ljyh0Ye1dzmHk3PlxP_KB8gxWssamxEL_WKfwUUQIiKXdTbikAzTXK4HYD9EvwVls0957iNbzIQp7xcDe2S_u42PzjqIEYiFSnu4veZ2_t2NP2xaKtiqXTgW50rZYi1bZapweqlsK_WS16vNUy2rM12rE1BrrZla0i1Zbt2YHYKvybbI3jZWu2Z2u2Y2sOdKsrW0WqLdvRgdgq_JtszeNla7Vna7Vjaw10uytbRaot2_MDsVX4N9lax8tWcWmZ8jwVSc5b_ZMPy7sAD-95fXfIxTpb8dtMrCqb-uek0lWDkOdF_ZTWP_ykflQGbIqpVGzIxYZUbO6I6VuxKY99Kre2pGpbLralYoXzaZdDn0nFI7nzSCo-l4vPu8Smio6pSiZvGVXUjHbqGVUUzVKYy5tGFVWj8q69zb7YvPsbAAD__4PTrR8= @@ -1719,25 +1719,25 @@ vectorized: true │ └── • lookup join (semi) │ estimated row count: 0 - │ table: lineitem@primary + │ table: lineitem@lineitem_pkey │ equality: (l_orderkey) = (l_orderkey) │ pred: l_suppkey != l_suppkey │ └── • lookup join │ estimated row count: 0 - │ table: orders@primary + │ table: orders@orders_pkey │ equality: (l_orderkey) = (o_orderkey) │ equality cols are key │ pred: o_orderstatus = 'F' │ └── • lookup join (anti) │ estimated row count: 0 - │ table: lineitem@primary + │ table: lineitem@lineitem_pkey │ equality: (l_orderkey) = (l_orderkey) │ pred: l_receiptdate > l_commitdate │ └── • lookup join - │ table: lineitem@primary + │ table: lineitem@lineitem_pkey │ equality: (l_orderkey, l_linenumber) = (l_orderkey,l_linenumber) │ equality cols are key │ pred: l_receiptdate > l_commitdate @@ -1749,7 +1749,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 400 - │ table: supplier@primary + │ table: supplier@supplier_pkey │ equality: (s_suppkey) = (s_suppkey) │ equality cols are key │ @@ -1764,7 +1764,7 @@ vectorized: true │ └── • scan estimated row count: 25 (100% of the table; stats collected ago) - table: nation@primary + table: nation@nation_pkey spans: FULL SCAN # Regression test for #50964. @@ -1806,7 +1806,7 @@ vectorized: true └── • index join │ columns: (pk, col0, col3) │ estimated row count: 10 (missing stats) - │ table: tab4@primary + │ table: tab4@tab4_pkey │ key columns: pk │ └── • scan @@ -1837,7 +1837,7 @@ distribution: local vectorized: true · • lookup join (left outer) -│ table: t59615@primary +│ table: t59615@t59615_pkey │ lookup condition: (column1 = y) AND (x IN (1, 3)) │ └── • values @@ -1854,7 +1854,7 @@ distribution: local vectorized: true · • lookup join (anti) -│ table: t59615@primary +│ table: t59615@t59615_pkey │ lookup condition: (column1 = y) AND (x IN (1, 3)) │ └── • values diff --git a/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_spans b/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_spans index 995d743c188f..577fe4f0e59f 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_spans +++ b/pkg/sql/opt/exec/execbuilder/testdata/lookup_join_spans @@ -124,12 +124,12 @@ vectorized: true │ └── • lookup join │ estimated row count: 33 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND ("time" > '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -154,12 +154,12 @@ vectorized: true │ order: +value │ └── • lookup join - │ table: metric_values_desc@primary + │ table: metric_values_desc@metric_values_desc_pkey │ lookup condition: (metric_id = id) AND ("time" > '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -186,12 +186,12 @@ vectorized: true │ └── • lookup join │ estimated row count: 33 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND ("time" >= '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -216,12 +216,12 @@ vectorized: true │ order: +value │ └── • lookup join - │ table: metric_values_desc@primary + │ table: metric_values_desc@metric_values_desc_pkey │ lookup condition: (metric_id = id) AND ("time" >= '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -243,12 +243,12 @@ vectorized: true · • lookup join │ estimated row count: 33 -│ table: metric_values@primary +│ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND ("time" < '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -269,12 +269,12 @@ distribution: local vectorized: true · • lookup join -│ table: metric_values_desc@primary +│ table: metric_values_desc@metric_values_desc_pkey │ lookup condition: (metric_id = id) AND ("time" < '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -301,12 +301,12 @@ vectorized: true │ └── • lookup join │ estimated row count: 33 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND ("time" <= '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -331,12 +331,12 @@ vectorized: true │ order: +value │ └── • lookup join - │ table: metric_values_desc@primary + │ table: metric_values_desc@metric_values_desc_pkey │ lookup condition: (metric_id = id) AND ("time" <= '2020-01-01 00:00:00+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -363,12 +363,12 @@ vectorized: true │ └── • lookup join │ estimated row count: 33 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND ("time" < '2020-01-01 00:00:10+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -393,12 +393,12 @@ vectorized: true │ order: +value │ └── • lookup join - │ table: metric_values_desc@primary + │ table: metric_values_desc@metric_values_desc_pkey │ lookup condition: (metric_id = id) AND ("time" < '2020-01-01 00:00:10+00:00') │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -425,12 +425,12 @@ vectorized: true │ └── • lookup join │ estimated row count: 11 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND (("time" >= '2020-01-01 00:00:00+00:00') AND ("time" <= '2020-01-01 00:10:00+00:00')) │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -455,12 +455,12 @@ vectorized: true │ order: +value │ └── • lookup join - │ table: metric_values_desc@primary + │ table: metric_values_desc@metric_values_desc_pkey │ lookup condition: (metric_id = id) AND (("time" >= '2020-01-01 00:00:00+00:00') AND ("time" <= '2020-01-01 00:10:00+00:00')) │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -487,13 +487,13 @@ vectorized: true │ └── • lookup join (left outer) │ estimated row count: 11 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND (("time" >= '2020-01-01 00:00:00+00:00') AND ("time" <= '2020-01-01 00:10:00+00:00')) │ pred: name = 'cpu' │ └── • scan estimated row count: 10 (100% of the table; stats collected ago) - table: metrics@primary + table: metrics@metrics_pkey spans: FULL SCAN # Test lookup conditions w/ a semi join. @@ -509,12 +509,12 @@ vectorized: true · • lookup join (semi) │ estimated row count: 10 -│ table: metric_values@primary +│ table: metric_values@metric_values_pkey │ lookup condition: (metric_id = id) AND (("time" >= '2020-01-01 00:00:00+00:00') AND ("time" <= '2020-01-01 00:10:00+00:00')) │ └── • scan estimated row count: 10 (100% of the table; stats collected ago) - table: metrics@primary + table: metrics@metrics_pkey spans: FULL SCAN # Test NULL values in pre-join where conditions. @@ -539,7 +539,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 3 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -550,7 +550,7 @@ vectorized: true │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -574,7 +574,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: metrics@primary +│ table: metrics@metrics_pkey │ equality: (id) = (id) │ equality cols are key │ @@ -584,7 +584,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 0 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -615,7 +615,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: metrics@primary +│ table: metrics@metrics_pkey │ equality: (id) = (id) │ equality cols are key │ @@ -625,7 +625,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 0 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -656,7 +656,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: metrics@primary +│ table: metrics@metrics_pkey │ equality: (id) = (id) │ equality cols are key │ @@ -666,7 +666,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 0 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -698,7 +698,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: metrics@primary +│ table: metrics@metrics_pkey │ equality: (id) = (id) │ equality cols are key │ @@ -708,7 +708,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 0 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -739,7 +739,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: metrics@primary +│ table: metrics@metrics_pkey │ equality: (id) = (id) │ equality cols are key │ @@ -749,7 +749,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 0 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -785,7 +785,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 3 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -796,7 +796,7 @@ vectorized: true │ └── • index join │ estimated row count: 1 - │ table: metrics@primary + │ table: metrics@metrics_pkey │ └── • scan estimated row count: 1 (10% of the table; stats collected ago) @@ -822,7 +822,7 @@ vectorized: true · • lookup join │ estimated row count: 0 -│ table: metrics@primary +│ table: metrics@metrics_pkey │ equality: (id) = (id) │ equality cols are key │ @@ -832,7 +832,7 @@ vectorized: true │ └── • lookup join │ estimated row count: 0 - │ table: metric_values@primary + │ table: metric_values@metric_values_pkey │ equality: (metric_id, time) = (metric_id,time) │ equality cols are key │ @@ -897,7 +897,7 @@ vectorized: true └── • scan columns: (s_i_id) estimated row count: 1,000 (missing stats) - table: stock@primary + table: stock@stock_pkey spans: FULL SCAN # Make sure we don't confuse logic to handle constants and inequalities. @@ -933,7 +933,7 @@ vectorized: true ├── • scan │ columns: (s_i_id) │ estimated row count: 1,000 (missing stats) - │ table: stock@primary + │ table: stock@stock_pkey │ spans: FULL SCAN │ └── • values diff --git a/pkg/sql/opt/exec/execbuilder/testdata/materialized_view b/pkg/sql/opt/exec/execbuilder/testdata/materialized_view index 71c8d66af04b..3e700ab63d70 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/materialized_view +++ b/pkg/sql/opt/exec/execbuilder/testdata/materialized_view @@ -18,7 +18,7 @@ vectorized: true · • scan missing stats - table: v@primary + table: v@v_pkey spans: FULL SCAN # Create an index on a materialized view, and ensure that we use it. @@ -32,7 +32,7 @@ distribution: local vectorized: true · • index join -│ table: v@primary +│ table: v@v_pkey │ └── • scan missing stats diff --git a/pkg/sql/opt/exec/execbuilder/testdata/merge_join_dist_vec b/pkg/sql/opt/exec/execbuilder/testdata/merge_join_dist_vec index 56dcbe5e5525..d945f4227765 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/merge_join_dist_vec +++ b/pkg/sql/opt/exec/execbuilder/testdata/merge_join_dist_vec @@ -55,12 +55,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: l@primary +│ table: l@l_pkey │ spans: [/2 - /2] │ └── • scan missing stats - table: r@primary + table: r@r_pkey spans: [/2 - /2] · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzEk9GPk0AQxt_9Kybz1OoaWIovJJdglFMuPTiBiyaGh70ytiQci7tLYtP0fzeASQV7tY1R39jd-X0z3zdhh_prhR4Gn-6Wr8MIZm_DNEs_LOeQBsvgTQbP4TqJb6GCZXCdwU0cRqDgPg2jdzATc_j4PkgCEHAFDjKsZUGReCSN3mfkyNDBnGGj5Iq0lqq73vVFYfENPZthWTet6a5zhiupCL0dmtJUhB5m4qGihERByuq0CjKirHpp5TeqfBRqiwzTRtTaA8uxbMz3DGVrfmgepB62sBF6MxbxOeb7nKE2Yk3oOXv2xGwHnbaWqiBFxUgp78jflRwxeEtqTTeyrElZi_Fs2bYhb4g8vs-CpA8eGVb0xcx8_mJ-pcr1ZvhEhnFrPPA58x3mu5MUDg4Xf-DwyPiRfCkby51GcbS1O2rNz1-8Pc6l-guL50_O9i8W7_zXxR8ZLiHdyFrTWXu1O3tUrGmIS8tWrehOyVXfZjjGPdcnW5A2w6s7HMK6f-r_vfNhfhrmU9j-GXZGMJ_Czkn41Qi2p_DiAs-_dD4N89Owe5HnfP_sewAAAP__ZsHuOw== diff --git a/pkg/sql/opt/exec/execbuilder/testdata/mvcc b/pkg/sql/opt/exec/execbuilder/testdata/mvcc index 877c1784b3cc..48d9f266820e 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/mvcc +++ b/pkg/sql/opt/exec/execbuilder/testdata/mvcc @@ -14,7 +14,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/1 - /1] query T @@ -25,7 +25,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: [/1 - /1] # Ensure that the presence of mutation columns doesn't affect accessing system @@ -42,7 +42,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN statement ok @@ -60,7 +60,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN # Regression test for #62798. Using crdb_internal_mvcc_timestamp shouldn't cause diff --git a/pkg/sql/opt/exec/execbuilder/testdata/orderby b/pkg/sql/opt/exec/execbuilder/testdata/orderby index 25da60d838db..fbf0f40a9ad3 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/orderby +++ b/pkg/sql/opt/exec/execbuilder/testdata/orderby @@ -19,7 +19,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -33,7 +33,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN # TODO(radu): Should set "strategy top 2" on sort node @@ -49,7 +49,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -73,7 +73,7 @@ vectorized: true └── • scan columns: (b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -84,7 +84,7 @@ vectorized: true · • revscan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN # Check that LIMIT propagates past nosort nodes. @@ -96,7 +96,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: LIMITED SCAN limit: 1 @@ -108,7 +108,7 @@ vectorized: true · • revscan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -119,7 +119,7 @@ vectorized: true · • revscan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -137,7 +137,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -155,7 +155,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -173,7 +173,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -191,7 +191,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Check that sort is skipped if the ORDER BY clause is constant. @@ -203,7 +203,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -216,7 +216,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -227,7 +227,7 @@ vectorized: true · • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN # Check that the sort key reuses the existing render. @@ -251,7 +251,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Check that the sort picks up a renamed render properly. @@ -275,7 +275,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN statement ok @@ -302,10 +302,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /abc/primary/1/2/3 -> NULL -fetched: /abc/primary/1/2/3/d -> 'one' -fetched: /abc/primary/4/5/6 -> NULL -fetched: /abc/primary/4/5/6/d -> 'Two' +fetched: /abc/abc_pkey/1/2/3 -> NULL +fetched: /abc/abc_pkey/1/2/3/d -> 'one' +fetched: /abc/abc_pkey/4/5/6 -> NULL +fetched: /abc/abc_pkey/4/5/6/d -> 'Two' output row: [1 2 3 'one'] output row: [4 5 6 'Two'] @@ -347,7 +347,7 @@ vectorized: true │ already ordered: +b,+a │ └── • index join - │ table: abc@primary + │ table: abc@abc_pkey │ └── • scan missing stats @@ -369,7 +369,7 @@ vectorized: true │ └── • scan missing stats - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query III @@ -404,7 +404,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -490,10 +490,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /abc/primary/4/5/6/d -> 'Two' -fetched: /abc/primary/4/5/6 -> NULL -fetched: /abc/primary/1/2/3/d -> 'one' -fetched: /abc/primary/1/2/3 -> NULL +fetched: /abc/abc_pkey/4/5/6/d -> 'Two' +fetched: /abc/abc_pkey/4/5/6 -> NULL +fetched: /abc/abc_pkey/1/2/3/d -> 'one' +fetched: /abc/abc_pkey/1/2/3 -> NULL output row: [4] output row: [1] @@ -505,7 +505,7 @@ vectorized: true · • revscan missing stats - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -546,7 +546,7 @@ vectorized: true columns: (a, b, c) ordering: +b,+c estimated row count: 10 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: /1-/2 statement ok @@ -748,7 +748,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /3/0 query T @@ -779,7 +779,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -838,7 +838,7 @@ vectorized: true └── • scan columns: (block_id, writer_id, block_num) estimated row count: 1 (missing stats) - table: blocks@primary + table: blocks@blocks_pkey spans: LIMITED SCAN limit: 1 @@ -872,7 +872,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN query T @@ -901,7 +901,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -925,7 +925,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -943,7 +943,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -967,7 +967,7 @@ vectorized: true columns: (k, v) ordering: +k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -983,7 +983,7 @@ vectorized: true columns: (k, v) ordering: +k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -999,7 +999,7 @@ vectorized: true columns: (k, v) ordering: -k estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1020,7 +1020,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -1116,7 +1116,7 @@ vectorized: true └── • lookup join (inner) │ columns: (column1, k, v) │ estimated row count: 2 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ equality: (column1) = (k) │ equality cols are key │ @@ -1183,7 +1183,7 @@ vectorized: true │ columns: (x, y, z) │ ordering: +y │ estimated row count: 10 (missing stats) - │ table: xyz@primary + │ table: xyz@xyz_pkey │ key columns: rowid │ └── • scan @@ -1213,7 +1213,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1241,7 +1241,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1269,7 +1269,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1287,7 +1287,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1317,7 +1317,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN statement ok diff --git a/pkg/sql/opt/exec/execbuilder/testdata/ordinality b/pkg/sql/opt/exec/execbuilder/testdata/ordinality index 182407aaaa51..449ced4ea130 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/ordinality +++ b/pkg/sql/opt/exec/execbuilder/testdata/ordinality @@ -21,7 +21,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN query T @@ -43,7 +43,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN query T @@ -70,7 +70,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN # Show that the primary key is used under ordinalityNode. @@ -87,7 +87,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 333 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: /"a\x00"- # Show that the primary key cannot be used with a PK predicate @@ -110,5 +110,5 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: foo@primary + table: foo@foo_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/partial_index b/pkg/sql/opt/exec/execbuilder/testdata/partial_index index f6171f375fe9..771b19e78cb9 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/partial_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/partial_index @@ -47,7 +47,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: [/11 - ] query T @@ -71,7 +71,7 @@ vectorized: true │ filter: c = 'foo' │ └── • index join - │ table: inv@primary + │ table: inv@inv_pkey │ └── • scan missing stats @@ -85,7 +85,7 @@ distribution: local vectorized: true · • index join -│ table: inv@primary +│ table: inv@inv_pkey │ └── • scan missing stats @@ -116,7 +116,7 @@ vectorized: true │ ├── • scan │ missing stats -│ table: a@primary +│ table: a@a_pkey │ spans: FULL SCAN │ └── • scan diff --git a/pkg/sql/opt/exec/execbuilder/testdata/prepare b/pkg/sql/opt/exec/execbuilder/testdata/prepare index 92387fccd08b..f90197667797 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/prepare +++ b/pkg/sql/opt/exec/execbuilder/testdata/prepare @@ -19,7 +19,7 @@ vectorized: true │ └── • scan missing stats - table: ab@primary + table: ab@ab_pkey spans: FULL SCAN statement ok @@ -50,7 +50,7 @@ vectorized: true │ └── • scan missing stats - table: ab@primary + table: ab@ab_pkey spans: FULL SCAN ## Statistics change: Create statistics and ensure that the plan is recalculated. @@ -73,12 +73,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: ab@primary +│ table: ab@ab_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: cd@primary + table: cd@cd_pkey spans: FULL SCAN statement ok @@ -94,13 +94,13 @@ distribution: local vectorized: true · • lookup join -│ table: cd@primary +│ table: cd@cd_pkey │ equality: (a) = (c) │ equality cols are key │ └── • scan estimated row count: 1 (100% of the table; stats collected ago) - table: ab@primary + table: ab@ab_pkey spans: FULL SCAN # Verify the plan of a very simple query which should be using the placeholder @@ -129,7 +129,7 @@ regions: KV rows read: 1 KV bytes read: 8 B estimated row count: 0 - table: ab@primary + table: ab@ab_pkey spans: [/1 - /1] query T @@ -152,5 +152,5 @@ regions: KV rows read: 0 KV bytes read: 0 B estimated row count: 0 - table: ab@primary + table: ab@ab_pkey spans: [/2 - /2] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/scalar b/pkg/sql/opt/exec/execbuilder/testdata/scalar index 47b0e5cad75a..21f9b601dcb3 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/scalar +++ b/pkg/sql/opt/exec/execbuilder/testdata/scalar @@ -76,7 +76,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -93,7 +93,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -110,7 +110,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -127,7 +127,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -144,7 +144,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -161,7 +161,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -178,7 +178,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -195,7 +195,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -212,7 +212,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -229,7 +229,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -246,7 +246,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -263,7 +263,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -280,7 +280,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -297,7 +297,7 @@ vectorized: true └── • scan columns: (a, b, c, s) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -314,7 +314,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -331,7 +331,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -348,7 +348,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -365,7 +365,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -382,7 +382,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -399,7 +399,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -416,7 +416,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -433,7 +433,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -450,7 +450,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -467,7 +467,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -484,7 +484,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -501,7 +501,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -518,7 +518,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -535,7 +535,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Tests for CASE with no ELSE statement @@ -553,7 +553,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -570,7 +570,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # TODO(radu): IS OF not supported yet. @@ -597,7 +597,7 @@ vectorized: true └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -614,7 +614,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -631,7 +631,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -648,7 +648,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -665,7 +665,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -682,7 +682,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -699,7 +699,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -716,7 +716,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -733,7 +733,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -750,7 +750,7 @@ vectorized: true └── • scan columns: (j) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN @@ -769,7 +769,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -786,7 +786,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -803,7 +803,7 @@ vectorized: true └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -874,7 +874,7 @@ vectorized: true └── • scan columns: (a, b, d) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -895,7 +895,7 @@ vectorized: true └── • scan columns: (a, b, d) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -912,7 +912,7 @@ vectorized: true └── • scan columns: (a, b, d) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -929,7 +929,7 @@ vectorized: true └── • scan columns: (a, b, d) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -946,7 +946,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -963,7 +963,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -980,7 +980,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -997,7 +997,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1014,7 +1014,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1031,7 +1031,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1048,7 +1048,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1104,7 +1104,7 @@ vectorized: true └── • scan columns: (s) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -1171,7 +1171,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # Regression test for #47327. The span should have an end value of -1. @@ -1206,5 +1206,5 @@ vectorized: true └── • scan columns: (c0) estimated row count: 1,000 (missing stats) - table: t0@primary + table: t0@t0_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/scan_parallel b/pkg/sql/opt/exec/execbuilder/testdata/scan_parallel index e28a5c60d48c..946ae042557f 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/scan_parallel +++ b/pkg/sql/opt/exec/execbuilder/testdata/scan_parallel @@ -48,7 +48,7 @@ vectorized: true · • scan missing stats - table: data@primary + table: data@data_pkey spans: [/0 - /0] [/2 - /2] [/4 - /4] [/6 - /6] … (1 more) query T @@ -81,7 +81,7 @@ vectorized: true · • scan missing stats - table: data@primary + table: data@data_pkey spans: [/0 - /0] [/2 - /2] [/4 - /4] [/6 - /6] … (1 more) # We allow to retry because the concurrency limit on the semaphore might not be diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select b/pkg/sql/opt/exec/execbuilder/testdata/select index f918db2fc866..cb4d1ee10d0b 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select +++ b/pkg/sql/opt/exec/execbuilder/testdata/select @@ -72,7 +72,7 @@ vectorized: true • scan columns: (p, d, c) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -84,7 +84,7 @@ vectorized: true • scan columns: (c) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -96,7 +96,7 @@ vectorized: true • scan columns: (p, c) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -108,7 +108,7 @@ vectorized: true • scan columns: (p, d, c) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -120,7 +120,7 @@ vectorized: true • scan columns: (c, d, p) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -132,7 +132,7 @@ vectorized: true • scan columns: (col1, col2, col3) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -192,7 +192,7 @@ vectorized: true • scan columns: (p) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -216,7 +216,7 @@ vectorized: true • scan columns: (d) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -240,7 +240,7 @@ vectorized: true • scan columns: (c) estimated row count: 1,000 (missing stats) - table: num_ref@primary + table: num_ref@num_ref_pkey spans: FULL SCAN query T @@ -264,7 +264,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: num_ref_hidden@primary + table: num_ref_hidden@num_ref_hidden_pkey spans: FULL SCAN query T @@ -276,7 +276,7 @@ vectorized: true • scan columns: () estimated row count: 1,000 (missing stats) - table: num_ref_hidden@primary + table: num_ref_hidden@num_ref_hidden_pkey spans: FULL SCAN query T @@ -288,7 +288,7 @@ vectorized: true • scan columns: (rowid) estimated row count: 1,000 (missing stats) - table: num_ref_hidden@primary + table: num_ref_hidden@num_ref_hidden_pkey spans: FULL SCAN query error pq: \[666\(1\) AS num_ref_alias\]: relation \"\[666\]\" does not exist @@ -327,7 +327,7 @@ vectorized: true • scan columns: (x, y) estimated row count: 333 (missing stats) - table: a@primary + table: a@a_pkey spans: /2- query T @@ -344,7 +344,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -356,7 +356,7 @@ vectorized: true • scan columns: (x, y) estimated row count: 1 (missing stats) - table: a@primary + table: a@a_pkey spans: /2/0 query T @@ -373,7 +373,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 333 (missing stats) - table: a@primary + table: a@a_pkey spans: /2- query T @@ -390,7 +390,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -411,7 +411,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -434,7 +434,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -449,7 +449,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -472,7 +472,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN statement ok @@ -493,7 +493,7 @@ vectorized: true • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: b@primary + table: b@b_pkey spans: FULL SCAN query T @@ -505,7 +505,7 @@ vectorized: true • scan columns: (x, y, rowid) estimated row count: 333 (missing stats) - table: b@primary + table: b@b_pkey spans: /1- statement ok @@ -537,10 +537,10 @@ t c_idx false 1 c ASC false t c_idx false 2 b N/A true false t c_idx false 3 d N/A true false t c_idx false 4 a ASC false true -t primary false 1 a ASC false false -t primary false 2 b N/A true false -t primary false 3 c N/A true false -t primary false 4 d N/A true false +t t_pkey false 1 a ASC false false +t t_pkey false 2 b N/A true false +t t_pkey false 3 c N/A true false +t t_pkey false 4 d N/A true false statement ok INSERT INTO t VALUES (1, 2, 3, 4) @@ -725,7 +725,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: nocols@primary + table: nocols@nocols_pkey spans: FULL SCAN statement ok @@ -753,7 +753,7 @@ vectorized: true columns: (a collatedstring{da}, b int) ordering: +a,+b estimated row count: 1,000 (missing stats) - table: coll@primary + table: coll@coll_pkey spans: FULL SCAN query T @@ -829,9 +829,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /dt/primary/'2015-08-25 04:45:45.53453' -> NULL -fetched: /dt/primary/'2015-08-25 04:45:45.53453'/b -> '2015-08-25' -fetched: /dt/primary/'2015-08-25 04:45:45.53453'/c -> '02:45:02.234' +fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453' -> NULL +fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453'/b -> '2015-08-25' +fetched: /dt/dt_pkey/'2015-08-25 04:45:45.53453'/c -> '02:45:02.234' output row: ['2015-08-25 04:45:45.53453' '2015-08-25' '02:45:02.234'] statement ok @@ -876,7 +876,7 @@ vectorized: true • scan columns: (d decimal, v decimal) estimated row count: 1 (missing stats) - table: dec@primary + table: dec@dec_pkey spans: /NaN/NaN/0 # Test again with separate column families. @@ -893,7 +893,7 @@ vectorized: true • scan columns: (d decimal, v decimal) estimated row count: 1 (missing stats) - table: decfam@primary + table: decfam@decfam_pkey spans: /NaN/NaN-/NaN/NaN/# # The NaN suffix is decimalNaNDesc, not decimalNaN(Asc). @@ -906,7 +906,7 @@ vectorized: true • scan columns: (d decimal, v decimal) estimated row count: 1 (missing stats) - table: dec@primary + table: dec@dec_pkey spans: /Infinity/Infinity/0 query T @@ -918,7 +918,7 @@ vectorized: true • scan columns: (d decimal, v decimal) estimated row count: 1 (missing stats) - table: dec@primary + table: dec@dec_pkey spans: /-Infinity/-Infinity/0 statement ok @@ -1004,7 +1004,7 @@ vectorized: true └── • scan columns: (d decimal) estimated row count: 1,000 (missing stats) - table: dec2@primary + table: dec2@dec2_pkey spans: FULL SCAN statement ok @@ -1057,7 +1057,7 @@ vectorized: true └── • scan columns: (f float) estimated row count: 1,000 (missing stats) - table: flt@primary + table: flt@flt_pkey spans: FULL SCAN statement ok @@ -1344,7 +1344,7 @@ vectorized: true columns: (a, b, c) ordering: +a estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN query T @@ -1371,7 +1371,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN @@ -1396,7 +1396,7 @@ vectorized: true columns: (a, b, c) ordering: -a,-b estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN # Ensure that filter nodes (and filtered scan nodes) get populated with the correct ordering. @@ -1416,7 +1416,7 @@ vectorized: true columns: (a, b, c, d) ordering: +a estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN query T @@ -1439,7 +1439,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN query T @@ -1458,7 +1458,7 @@ vectorized: true columns: (a, b) ordering: +a estimated row count: 10 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: LIMITED SCAN limit: 10 @@ -1485,7 +1485,7 @@ vectorized: true columns: (a, b, c) ordering: +a estimated row count: 10 (missing stats) - table: abcd@primary + table: abcd@abcd_pkey spans: LIMITED SCAN limit: 10 @@ -1531,7 +1531,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/10 - /10] query T @@ -1542,7 +1542,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/10 - /10] [/20 - /20] query T @@ -1553,7 +1553,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/10 - /10] [/20 - /20] # Verify that consolidated point spans are still parallelized. @@ -1565,7 +1565,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/10 - /11] query T @@ -1576,7 +1576,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/11 - /19] # This ticks all the boxes for parallelization apart from the fact that there @@ -1589,7 +1589,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/11 - ] # Test non-int types. @@ -1602,7 +1602,7 @@ distribution: local vectorized: true · • index join -│ table: a@primary +│ table: a@a_pkey │ └── • scan missing stats @@ -1618,7 +1618,7 @@ distribution: local vectorized: true · • index join -│ table: a@primary +│ table: a@a_pkey │ └── • scan missing stats @@ -1633,7 +1633,7 @@ vectorized: true · • scan missing stats - table: b@primary + table: b@b_pkey spans: [/10/10 - /10/10] [/20/20 - /20/20] # This one isn't parallelizable because it's not a point lookup - only part of @@ -1646,7 +1646,7 @@ vectorized: true · • scan missing stats - table: b@primary + table: b@b_pkey spans: [/10 - /10] [/20 - /20] # This one isn't parallelizable because it has a LIMIT clause. @@ -1658,7 +1658,7 @@ vectorized: true · • scan missing stats - table: a@primary + table: a@a_pkey spans: [/10 - /10] [/20 - /20] limit: 1 @@ -1806,12 +1806,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: e@primary + │ table: e@e_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: s@primary + table: s@s_pkey spans: FULL SCAN # Check that we have a sane row count estimate when there are a lot of null @@ -1860,5 +1860,5 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 11,110,000 (100% of the table; stats collected ago) - table: nulls@primary + table: nulls@nulls_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select_for_update b/pkg/sql/opt/exec/execbuilder/testdata/select_for_update index 64d6ab8e94ca..3942d07c3e45 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select_for_update +++ b/pkg/sql/opt/exec/execbuilder/testdata/select_for_update @@ -22,7 +22,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -35,7 +35,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for no key update @@ -48,7 +48,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for share @@ -61,7 +61,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for key share @@ -74,7 +74,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for share @@ -87,7 +87,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for no key update @@ -100,7 +100,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -113,7 +113,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -134,7 +134,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -147,7 +147,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update @@ -160,7 +160,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for no key update @@ -173,7 +173,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for share @@ -186,7 +186,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for key share @@ -199,7 +199,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for share @@ -212,7 +212,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for no key update @@ -225,7 +225,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update @@ -238,7 +238,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update @@ -259,7 +259,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update @@ -276,7 +276,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -292,7 +292,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -310,7 +310,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -323,7 +323,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -343,7 +343,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -356,7 +356,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -382,7 +382,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -398,7 +398,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -419,7 +419,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -432,7 +432,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -445,7 +445,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for no key update @@ -458,7 +458,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for no key update @@ -474,7 +474,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -487,7 +487,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -500,7 +500,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -516,7 +516,7 @@ vectorized: true • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -546,7 +546,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -575,7 +575,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -608,7 +608,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -638,7 +638,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -667,7 +667,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -700,7 +700,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -717,7 +717,7 @@ vectorized: true └── • lookup join (inner) │ columns: (b, a, b) │ estimated row count: 99 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (b) = (a) │ equality cols are key │ @@ -729,7 +729,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -745,7 +745,7 @@ vectorized: true └── • lookup join (inner) │ columns: (b, a, b) │ estimated row count: 99 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (b) = (a) │ equality cols are key │ @@ -757,7 +757,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -774,7 +774,7 @@ vectorized: true └── • lookup join (inner) │ columns: (b, a, b) │ estimated row count: 99 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (b) = (a) │ equality cols are key │ @@ -786,7 +786,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -802,7 +802,7 @@ vectorized: true └── • lookup join (inner) │ columns: (b, a, b) │ estimated row count: 99 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (b) = (a) │ equality cols are key │ @@ -814,7 +814,7 @@ vectorized: true └── • scan columns: (b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -843,7 +843,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -860,7 +860,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -889,7 +889,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -919,7 +919,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -938,7 +938,7 @@ vectorized: true ├── • scan │ columns: (c) │ estimated row count: 1,000 (missing stats) -│ table: u@primary +│ table: u@u_pkey │ spans: FULL SCAN │ └── • subquery @@ -953,7 +953,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -983,7 +983,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -991,7 +991,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1017,7 +1017,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1025,7 +1025,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN query T @@ -1050,14 +1050,14 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ └── • scan columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1083,7 +1083,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1091,7 +1091,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1117,7 +1117,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1125,7 +1125,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for share @@ -1154,7 +1154,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1162,7 +1162,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for share @@ -1188,7 +1188,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1196,7 +1196,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1222,7 +1222,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for no key update │ @@ -1230,7 +1230,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for key share @@ -1256,7 +1256,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for no key update │ @@ -1264,7 +1264,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1294,7 +1294,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1302,7 +1302,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1337,7 +1337,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1345,7 +1345,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN query T @@ -1370,14 +1370,14 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ └── • scan columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1403,7 +1403,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1411,7 +1411,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1441,7 +1441,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1449,7 +1449,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1484,7 +1484,7 @@ vectorized: true │ columns: (a, b) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1492,7 +1492,7 @@ vectorized: true columns: (a, c) ordering: +a estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1513,14 +1513,14 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1537,14 +1537,14 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN query T @@ -1560,14 +1560,14 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for share │ └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1584,14 +1584,14 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ locking strength: for update │ └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1611,13 +1611,13 @@ vectorized: true ├── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: u@primary + table: u@u_pkey spans: FULL SCAN locking strength: for update @@ -1634,7 +1634,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update locking wait policy: nowait @@ -1648,7 +1648,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for no key update locking wait policy: nowait @@ -1662,7 +1662,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for share locking wait policy: nowait @@ -1676,7 +1676,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for key share locking wait policy: nowait @@ -1690,7 +1690,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for share locking wait policy: nowait @@ -1704,7 +1704,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for no key update locking wait policy: nowait @@ -1718,7 +1718,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update locking wait policy: nowait @@ -1732,7 +1732,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update locking wait policy: nowait @@ -1754,7 +1754,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update locking wait policy: nowait @@ -1768,7 +1768,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update locking wait policy: nowait @@ -1782,7 +1782,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for no key update locking wait policy: nowait @@ -1796,7 +1796,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for share locking wait policy: nowait @@ -1810,7 +1810,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for key share locking wait policy: nowait @@ -1824,7 +1824,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for share locking wait policy: nowait @@ -1838,7 +1838,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for no key update locking wait policy: nowait @@ -1852,7 +1852,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update locking wait policy: nowait @@ -1866,7 +1866,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update locking wait policy: nowait @@ -1888,7 +1888,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1 (missing stats) - table: t@primary + table: t@t_pkey spans: /1/0 locking strength: for update locking wait policy: nowait diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select_index b/pkg/sql/opt/exec/execbuilder/testdata/select_index index 0ad7791b62fb..0ccecfc344d0 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select_index +++ b/pkg/sql/opt/exec/execbuilder/testdata/select_index @@ -29,9 +29,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/2/'two' -> NULL -fetched: /t/primary/2/'two'/c -> 22 -fetched: /t/primary/2/'two'/d -> 'bar' +fetched: /t/t_pkey/2/'two' -> NULL +fetched: /t/t_pkey/2/'two'/c -> 22 +fetched: /t/t_pkey/2/'two'/d -> 'bar' output row: [2 'two' 22 'bar'] statement ok @@ -42,12 +42,12 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'one' -> NULL -fetched: /t/primary/1/'one'/c -> 11 -fetched: /t/primary/1/'one'/d -> 'foo' -fetched: /t/primary/3/'three' -> NULL -fetched: /t/primary/3/'three'/c -> 33 -fetched: /t/primary/3/'three'/d -> 'blah' +fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one'/c -> 11 +fetched: /t/t_pkey/1/'one'/d -> 'foo' +fetched: /t/t_pkey/3/'three' -> NULL +fetched: /t/t_pkey/3/'three'/c -> 33 +fetched: /t/t_pkey/3/'three'/d -> 'blah' output row: [1 'one' 11 'foo'] output row: [3 'three' 33 'blah'] @@ -96,9 +96,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'one' -> NULL -fetched: /t/primary/1/'one'/c -> 11 -fetched: /t/primary/1/'one'/d -> 'foo' +fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one'/c -> 11 +fetched: /t/t_pkey/1/'one'/d -> 'foo' output row: [1 'one' 11 'foo'] statement ok @@ -109,12 +109,12 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'one' -> NULL -fetched: /t/primary/1/'one'/c -> 11 -fetched: /t/primary/1/'one'/d -> 'foo' -fetched: /t/primary/2/'two' -> NULL -fetched: /t/primary/2/'two'/c -> 22 -fetched: /t/primary/2/'two'/d -> 'bar' +fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one'/c -> 11 +fetched: /t/t_pkey/1/'one'/d -> 'foo' +fetched: /t/t_pkey/2/'two' -> NULL +fetched: /t/t_pkey/2/'two'/c -> 22 +fetched: /t/t_pkey/2/'two'/d -> 'bar' output row: [1 'one' 11 'foo'] output row: [2 'two' 22 'bar'] @@ -150,15 +150,15 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'one' -> NULL -fetched: /t/primary/1/'one'/c -> 11 -fetched: /t/primary/1/'one'/d -> 'foo' -fetched: /t/primary/2/'two' -> NULL -fetched: /t/primary/2/'two'/c -> 22 -fetched: /t/primary/2/'two'/d -> 'bar' -fetched: /t/primary/3/'three' -> NULL -fetched: /t/primary/3/'three'/c -> 33 -fetched: /t/primary/3/'three'/d -> 'blah' +fetched: /t/t_pkey/1/'one' -> NULL +fetched: /t/t_pkey/1/'one'/c -> 11 +fetched: /t/t_pkey/1/'one'/d -> 'foo' +fetched: /t/t_pkey/2/'two' -> NULL +fetched: /t/t_pkey/2/'two'/c -> 22 +fetched: /t/t_pkey/2/'two'/d -> 'bar' +fetched: /t/t_pkey/3/'three' -> NULL +fetched: /t/t_pkey/3/'three'/c -> 33 +fetched: /t/t_pkey/3/'three'/d -> 'blah' output row: [2 'two' 22 'bar'] # Use the descending index @@ -211,7 +211,7 @@ vectorized: true ├── • index join │ │ columns: (a, b, c, d) │ │ estimated row count: 10 (missing stats) - │ │ table: t@primary + │ │ table: t@t_pkey │ │ key columns: a, b │ │ │ └── • scan @@ -223,7 +223,7 @@ vectorized: true └── • index join │ columns: (a, b, c, d) │ estimated row count: 10 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ key columns: a, b │ └── • scan @@ -249,7 +249,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'c' -> NULL +fetched: /t/t_pkey/1/'c' -> NULL output row: [1 'c' NULL NULL] statement ok @@ -260,7 +260,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'c' -> NULL +fetched: /t/t_pkey/1/'c' -> NULL output row: [1 'c' NULL NULL] statement ok @@ -288,7 +288,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t/primary/1/'b' -> NULL +fetched: /t/t_pkey/1/'b' -> NULL output row: [1 'b' NULL NULL] statement ok @@ -498,7 +498,7 @@ vectorized: true └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -540,7 +540,7 @@ vectorized: true └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -561,7 +561,7 @@ vectorized: true └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -740,7 +740,7 @@ vectorized: true └── • scan columns: (s, i) estimated row count: 1,000 (missing stats) - table: ab@primary + table: ab@ab_pkey spans: FULL SCAN statement ok @@ -772,9 +772,9 @@ CREATE TABLE abz(a INT, b INT, c INT, PRIMARY KEY (a DESC, b ASC), UNIQUE(c DESC abz abz_c_b_key false 1 c DESC false false abz abz_c_b_key false 2 b ASC false false abz abz_c_b_key false 3 a ASC false true -abz primary false 1 a DESC false false -abz primary false 2 b ASC false false -abz primary false 3 c N/A true false +abz abz_pkey false 1 a DESC false false +abz abz_pkey false 2 b ASC false false +abz abz_pkey false 3 c N/A true false query T EXPLAIN (VERBOSE) SELECT a FROM abz ORDER BY a DESC LIMIT 1 @@ -785,7 +785,7 @@ vectorized: true • scan columns: (a) estimated row count: 1 (missing stats) - table: abz@primary + table: abz@abz_pkey spans: LIMITED SCAN limit: 1 @@ -829,7 +829,7 @@ vectorized: true └── • scan columns: (k, a, b) estimated row count: 1,000 (missing stats) - table: tab0@primary + table: tab0@tab0_pkey spans: FULL SCAN # Check that no extraneous rows are fetched due to excessive batching (#15910) @@ -857,7 +857,7 @@ vectorized: true │ columns: (id, k, v) │ ordering: -k │ estimated row count: 20 (missing stats) -│ table: test2@primary +│ table: test2@test2_pkey │ key columns: id │ └── • revscan @@ -1085,7 +1085,7 @@ vectorized: true • scan columns: (a, b) estimated row count: 333 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: /1/2-/3/4/# # Regression test for #21831. @@ -1163,7 +1163,7 @@ vectorized: true • index join │ columns: (x, y) │ estimated row count: 10 (missing stats) -│ table: xy@primary +│ table: xy@xy_pkey │ key columns: rowid │ └── • scan @@ -1181,7 +1181,7 @@ vectorized: true • index join │ columns: (x, y) │ estimated row count: 10 (missing stats) -│ table: xy@primary +│ table: xy@xy_pkey │ key columns: rowid │ └── • scan @@ -1202,7 +1202,7 @@ vectorized: true └── • index join │ columns: (x, y) │ estimated row count: 10 (missing stats) - │ table: xy@primary + │ table: xy@xy_pkey │ key columns: rowid │ └── • scan @@ -1225,7 +1225,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xy@primary + table: xy@xy_pkey spans: FULL SCAN query T @@ -1242,7 +1242,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xy@primary + table: xy@xy_pkey spans: FULL SCAN # Regression tests for #22670. @@ -1303,7 +1303,7 @@ distribution: local vectorized: true · • index join -│ table: noncover@primary +│ table: noncover@noncover_pkey │ └── • scan missing stats @@ -1319,10 +1319,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- fetched: /noncover/b/2/1 -> NULL -fetched: /noncover/primary/1 -> NULL -fetched: /noncover/primary/1/b -> 2 -fetched: /noncover/primary/1/c -> 3 -fetched: /noncover/primary/1/d -> 4 +fetched: /noncover/noncover_pkey/1 -> NULL +fetched: /noncover/noncover_pkey/1/b -> 2 +fetched: /noncover/noncover_pkey/1/c -> 3 +fetched: /noncover/noncover_pkey/1/d -> 4 output row: [1 2 3 4] # Verify that the index join span created doesn't include any potential child @@ -1340,7 +1340,7 @@ distribution: local vectorized: true · • index join -│ table: noncover@primary +│ table: noncover@noncover_pkey │ └── • scan missing stats @@ -1356,10 +1356,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- fetched: /noncover/c/7 -> /5 -fetched: /noncover/primary/5 -> NULL -fetched: /noncover/primary/5/b -> 6 -fetched: /noncover/primary/5/c -> 7 -fetched: /noncover/primary/5/d -> 8 +fetched: /noncover/noncover_pkey/5 -> NULL +fetched: /noncover/noncover_pkey/5/b -> 6 +fetched: /noncover/noncover_pkey/5/c -> 7 +fetched: /noncover/noncover_pkey/5/d -> 8 output row: [5 6 7 8] query T @@ -1382,7 +1382,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: noncover@primary + table: noncover@noncover_pkey spans: FULL SCAN query T @@ -1405,7 +1405,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: noncover@primary + table: noncover@noncover_pkey spans: FULL SCAN query T @@ -1422,7 +1422,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: noncover@primary + table: noncover@noncover_pkey spans: FULL SCAN # The following testcases verify that when we have a small limit, we prefer an @@ -1439,7 +1439,7 @@ vectorized: true │ └── • scan missing stats - table: noncover@primary + table: noncover@noncover_pkey spans: FULL SCAN query T @@ -1449,7 +1449,7 @@ distribution: local vectorized: true · • index join -│ table: noncover@primary +│ table: noncover@noncover_pkey │ └── • scan missing stats @@ -1477,7 +1477,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: noncover@primary + table: noncover@noncover_pkey spans: FULL SCAN # TODO(radu): need to prefer the order-matching index when OFFSET is present. @@ -1496,7 +1496,7 @@ vectorized: true │ columns: (a, b, c, d) │ ordering: +c │ estimated row count: 10 (missing stats) - │ table: noncover@primary + │ table: noncover@noncover_pkey │ key columns: a │ └── • scan @@ -1523,7 +1523,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1,000 (missing stats) - table: noncover@primary + table: noncover@noncover_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -1576,7 +1576,7 @@ vectorized: true • index join │ columns: (a, b, c, s) │ estimated row count: 1 -│ table: t2@primary +│ table: t2@t2_pkey │ key columns: a │ └── • filter @@ -1602,10 +1602,10 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY fetched: /t2/bc/2/1/4 -> NULL fetched: /t2/bc/2/2/5 -> NULL fetched: /t2/bc/2/3/6 -> NULL -fetched: /t2/primary/5 -> NULL -fetched: /t2/primary/5/b -> 2 -fetched: /t2/primary/5/c -> 2 -fetched: /t2/primary/5/s -> '22' +fetched: /t2/t2_pkey/5 -> NULL +fetched: /t2/t2_pkey/5/b -> 2 +fetched: /t2/t2_pkey/5/c -> 2 +fetched: /t2/t2_pkey/5/s -> '22' output row: [5 2 2 '22'] query T @@ -1617,7 +1617,7 @@ vectorized: true • index join │ columns: (a, b, c, s) │ estimated row count: 3 -│ table: t2@primary +│ table: t2@t2_pkey │ key columns: a │ └── • scan @@ -1637,14 +1637,14 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- fetched: /t2/bc/2/1/4 -> NULL fetched: /t2/bc/2/3/6 -> NULL -fetched: /t2/primary/4 -> NULL -fetched: /t2/primary/4/b -> 2 -fetched: /t2/primary/4/c -> 1 -fetched: /t2/primary/4/s -> '21' -fetched: /t2/primary/6 -> NULL -fetched: /t2/primary/6/b -> 2 -fetched: /t2/primary/6/c -> 3 -fetched: /t2/primary/6/s -> '23' +fetched: /t2/t2_pkey/4 -> NULL +fetched: /t2/t2_pkey/4/b -> 2 +fetched: /t2/t2_pkey/4/c -> 1 +fetched: /t2/t2_pkey/4/s -> '21' +fetched: /t2/t2_pkey/6 -> NULL +fetched: /t2/t2_pkey/6/b -> 2 +fetched: /t2/t2_pkey/6/c -> 3 +fetched: /t2/t2_pkey/6/s -> '23' output row: [4 2 1 '21'] output row: [6 2 3 '23'] @@ -1659,14 +1659,14 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY ---- fetched: /t2/bc/2/1/4 -> NULL fetched: /t2/bc/2/3/6 -> NULL -fetched: /t2/primary/4 -> NULL -fetched: /t2/primary/4/b -> 2 -fetched: /t2/primary/4/c -> 1 -fetched: /t2/primary/4/s -> '21' -fetched: /t2/primary/6 -> NULL -fetched: /t2/primary/6/b -> 2 -fetched: /t2/primary/6/c -> 3 -fetched: /t2/primary/6/s -> '23' +fetched: /t2/t2_pkey/4 -> NULL +fetched: /t2/t2_pkey/4/b -> 2 +fetched: /t2/t2_pkey/4/c -> 1 +fetched: /t2/t2_pkey/4/s -> '21' +fetched: /t2/t2_pkey/6 -> NULL +fetched: /t2/t2_pkey/6/b -> 2 +fetched: /t2/t2_pkey/6/c -> 3 +fetched: /t2/t2_pkey/6/s -> '23' output row: [6 2 3 '23'] # We only look up the table rows where c = b+1 or a > b+4: '23', '32', '33'. @@ -1679,42 +1679,42 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t2/primary/1 -> NULL -fetched: /t2/primary/1/b -> 1 -fetched: /t2/primary/1/c -> 1 -fetched: /t2/primary/1/s -> '11' -fetched: /t2/primary/2 -> NULL -fetched: /t2/primary/2/b -> 1 -fetched: /t2/primary/2/c -> 2 -fetched: /t2/primary/2/s -> '12' -fetched: /t2/primary/3 -> NULL -fetched: /t2/primary/3/b -> 1 -fetched: /t2/primary/3/c -> 3 -fetched: /t2/primary/3/s -> '13' -fetched: /t2/primary/4 -> NULL -fetched: /t2/primary/4/b -> 2 -fetched: /t2/primary/4/c -> 1 -fetched: /t2/primary/4/s -> '21' -fetched: /t2/primary/5 -> NULL -fetched: /t2/primary/5/b -> 2 -fetched: /t2/primary/5/c -> 2 -fetched: /t2/primary/5/s -> '22' -fetched: /t2/primary/6 -> NULL -fetched: /t2/primary/6/b -> 2 -fetched: /t2/primary/6/c -> 3 -fetched: /t2/primary/6/s -> '23' -fetched: /t2/primary/7 -> NULL -fetched: /t2/primary/7/b -> 3 -fetched: /t2/primary/7/c -> 1 -fetched: /t2/primary/7/s -> '31' -fetched: /t2/primary/8 -> NULL -fetched: /t2/primary/8/b -> 3 -fetched: /t2/primary/8/c -> 2 -fetched: /t2/primary/8/s -> '32' -fetched: /t2/primary/9 -> NULL -fetched: /t2/primary/9/b -> 3 -fetched: /t2/primary/9/c -> 3 -fetched: /t2/primary/9/s -> '33' +fetched: /t2/t2_pkey/1 -> NULL +fetched: /t2/t2_pkey/1/b -> 1 +fetched: /t2/t2_pkey/1/c -> 1 +fetched: /t2/t2_pkey/1/s -> '11' +fetched: /t2/t2_pkey/2 -> NULL +fetched: /t2/t2_pkey/2/b -> 1 +fetched: /t2/t2_pkey/2/c -> 2 +fetched: /t2/t2_pkey/2/s -> '12' +fetched: /t2/t2_pkey/3 -> NULL +fetched: /t2/t2_pkey/3/b -> 1 +fetched: /t2/t2_pkey/3/c -> 3 +fetched: /t2/t2_pkey/3/s -> '13' +fetched: /t2/t2_pkey/4 -> NULL +fetched: /t2/t2_pkey/4/b -> 2 +fetched: /t2/t2_pkey/4/c -> 1 +fetched: /t2/t2_pkey/4/s -> '21' +fetched: /t2/t2_pkey/5 -> NULL +fetched: /t2/t2_pkey/5/b -> 2 +fetched: /t2/t2_pkey/5/c -> 2 +fetched: /t2/t2_pkey/5/s -> '22' +fetched: /t2/t2_pkey/6 -> NULL +fetched: /t2/t2_pkey/6/b -> 2 +fetched: /t2/t2_pkey/6/c -> 3 +fetched: /t2/t2_pkey/6/s -> '23' +fetched: /t2/t2_pkey/7 -> NULL +fetched: /t2/t2_pkey/7/b -> 3 +fetched: /t2/t2_pkey/7/c -> 1 +fetched: /t2/t2_pkey/7/s -> '31' +fetched: /t2/t2_pkey/8 -> NULL +fetched: /t2/t2_pkey/8/b -> 3 +fetched: /t2/t2_pkey/8/c -> 2 +fetched: /t2/t2_pkey/8/s -> '32' +fetched: /t2/t2_pkey/9 -> NULL +fetched: /t2/t2_pkey/9/b -> 3 +fetched: /t2/t2_pkey/9/c -> 3 +fetched: /t2/t2_pkey/9/s -> '33' output row: [9 3 3 '33'] # Check that splitting of the expression filter does not mistakenly @@ -1753,7 +1753,7 @@ vectorized: true │ columns: (v, w) │ ordering: +v │ estimated row count: 90 (missing stats) - │ table: t3@primary + │ table: t3@t3_pkey │ key columns: k │ └── • scan @@ -1795,7 +1795,7 @@ vectorized: true · • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/10/20 - /10/20] statement ok @@ -1806,8 +1806,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t4/primary/10/20 -> NULL -fetched: /t4/primary/10/20/c -> 30 +fetched: /t4/t4_pkey/10/20 -> NULL +fetched: /t4/t4_pkey/10/20/c -> 30 output row: [30] # Point lookup on d does not touch the c or e families. @@ -1819,7 +1819,7 @@ vectorized: true · • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/10/20 - /10/20] statement ok @@ -1830,8 +1830,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /t4/primary/10/20 -> NULL -fetched: /t4/primary/10/20/d -> 40 +fetched: /t4/t4_pkey/10/20 -> NULL +fetched: /t4/t4_pkey/10/20/d -> 40 output row: [40] # Point lookup on both d and e uses a single span for the two adjacent column @@ -1844,7 +1844,7 @@ vectorized: true · • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/10/20 - /10/20] # Optimization should also be applied for updates. @@ -1863,7 +1863,7 @@ vectorized: true │ └── • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/10/20 - /10/20] locking strength: for update @@ -1888,7 +1888,7 @@ vectorized: true · • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/10/20 - /10/21] # Optimization should not be applied for partial primary key filter. @@ -1900,7 +1900,7 @@ vectorized: true · • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/10 - /10] # Regression test for #40890: a point lookup on a single column family of a @@ -1913,5 +1913,5 @@ vectorized: true · • scan missing stats - table: t4@primary + table: t4@t4_pkey spans: [/1/1 - /1/1] [/1/5 - /1/5] [/5/1 - /5/1] [/5/5 - /5/5] diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select_index_flags b/pkg/sql/opt/exec/execbuilder/testdata/select_index_flags index e0c0a228ad05..09ce0d51ac27 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select_index_flags +++ b/pkg/sql/opt/exec/execbuilder/testdata/select_index_flags @@ -20,7 +20,7 @@ vectorized: true · • scan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: [/20 - /30] # No hint, reverse scan. @@ -32,48 +32,48 @@ vectorized: true · • revscan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: [/20 - /30] # Force primary query T -EXPLAIN SELECT * FROM abcd@primary WHERE a >= 20 AND a <= 30 +EXPLAIN SELECT * FROM abcd@abcd_pkey WHERE a >= 20 AND a <= 30 ---- distribution: local vectorized: true · • scan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: [/20 - /30] # Force primary, reverse scan. query T -EXPLAIN SELECT * FROM abcd@{FORCE_INDEX=primary,DESC} WHERE a >= 20 AND a <= 30 +EXPLAIN SELECT * FROM abcd@{FORCE_INDEX=abcd_pkey,DESC} WHERE a >= 20 AND a <= 30 ---- distribution: local vectorized: true · • revscan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: [/20 - /30] # Force primary, allow reverse scan. query T -EXPLAIN SELECT * FROM abcd@primary WHERE a >= 20 AND a <= 30 ORDER BY a DESC +EXPLAIN SELECT * FROM abcd@abcd_pkey WHERE a >= 20 AND a <= 30 ORDER BY a DESC ---- distribution: local vectorized: true · • revscan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: [/20 - /30] # Force primary, forward scan. query T -EXPLAIN SELECT * FROM abcd@{FORCE_INDEX=primary,ASC} WHERE a >= 20 AND a <= 30 ORDER BY a DESC +EXPLAIN SELECT * FROM abcd@{FORCE_INDEX=abcd_pkey,ASC} WHERE a >= 20 AND a <= 30 ORDER BY a DESC ---- distribution: local vectorized: true @@ -83,7 +83,7 @@ vectorized: true │ └── • scan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: [/20 - /30] # Force index b @@ -97,7 +97,7 @@ vectorized: true │ filter: (a >= 20) AND (a <= 30) │ └── • index join - │ table: abcd@primary + │ table: abcd@abcd_pkey │ └── • scan missing stats @@ -115,7 +115,7 @@ vectorized: true │ filter: (a >= 20) AND (a <= 30) │ └── • index join - │ table: abcd@primary + │ table: abcd@abcd_pkey │ └── • revscan missing stats @@ -130,7 +130,7 @@ distribution: local vectorized: true · • index join -│ table: abcd@primary +│ table: abcd@abcd_pkey │ └── • revscan missing stats @@ -146,7 +146,7 @@ distribution: local vectorized: true · • index join -│ table: abcd@primary +│ table: abcd@abcd_pkey │ └── • revscan missing stats @@ -163,7 +163,7 @@ distribution: local vectorized: true · • index join -│ table: abcd@primary +│ table: abcd@abcd_pkey │ └── • top-k │ order: -b @@ -185,7 +185,7 @@ vectorized: true │ filter: (a >= 20) AND (a <= 30) │ └── • index join - │ table: abcd@primary + │ table: abcd@abcd_pkey │ └── • scan missing stats @@ -233,7 +233,7 @@ vectorized: true │ filter: (c >= 20) AND (c <= 30) │ └── • index join - │ table: abcd@primary + │ table: abcd@abcd_pkey │ └── • scan missing stats @@ -254,7 +254,7 @@ vectorized: true # Force primary index query T -EXPLAIN SELECT c, d FROM abcd@primary WHERE c >= 20 AND c < 40 +EXPLAIN SELECT c, d FROM abcd@abcd_pkey WHERE c >= 20 AND c < 40 ---- distribution: local vectorized: true @@ -264,7 +264,7 @@ vectorized: true │ └── • scan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN # Force index b @@ -278,7 +278,7 @@ vectorized: true │ filter: (c >= 20) AND (c < 40) │ └── • index join - │ table: abcd@primary + │ table: abcd@abcd_pkey │ └── • scan missing stats @@ -295,7 +295,7 @@ vectorized: true │ filter: (a >= 20) AND (a <= 30) │ └── • index join - │ table: abcd@primary + │ table: abcd@abcd_pkey │ └── • scan missing stats @@ -309,7 +309,7 @@ distribution: local vectorized: true · • index join -│ table: abcd@primary +│ table: abcd@abcd_pkey │ └── • scan missing stats @@ -327,7 +327,7 @@ vectorized: true │ └── • scan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN query T @@ -345,7 +345,7 @@ vectorized: true spans: FULL SCAN query T -EXPLAIN SELECT b, c, d FROM abcd@{FORCE_INDEX=primary} WHERE c = 10 +EXPLAIN SELECT b, c, d FROM abcd@{FORCE_INDEX=abcd_pkey} WHERE c = 10 ---- distribution: local vectorized: true @@ -355,5 +355,5 @@ vectorized: true │ └── • scan missing stats - table: abcd@primary + table: abcd@abcd_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/select_index_vectorize_off b/pkg/sql/opt/exec/execbuilder/testdata/select_index_vectorize_off index e3af4dc8632d..c7a626d4feed 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/select_index_vectorize_off +++ b/pkg/sql/opt/exec/execbuilder/testdata/select_index_vectorize_off @@ -55,23 +55,23 @@ fetched: /test2/test2_k_key/'014' -> /...PK... fetched: /test2/test2_k_key/'013' -> /...PK... fetched: /test2/test2_k_key/'012' -> /...PK... fetched: /test2/test2_k_key/'011' -> /...PK... -fetched: /test2/primary/...PK.../k/v -> /'030'/42 -fetched: /test2/primary/...PK.../k/v -> /'029'/42 -fetched: /test2/primary/...PK.../k/v -> /'028'/42 -fetched: /test2/primary/...PK.../k/v -> /'027'/42 -fetched: /test2/primary/...PK.../k/v -> /'026'/42 -fetched: /test2/primary/...PK.../k/v -> /'025'/42 -fetched: /test2/primary/...PK.../k/v -> /'024'/42 -fetched: /test2/primary/...PK.../k/v -> /'023'/42 -fetched: /test2/primary/...PK.../k/v -> /'022'/42 -fetched: /test2/primary/...PK.../k/v -> /'021'/42 -fetched: /test2/primary/...PK.../k/v -> /'020'/42 -fetched: /test2/primary/...PK.../k/v -> /'019'/42 -fetched: /test2/primary/...PK.../k/v -> /'018'/42 -fetched: /test2/primary/...PK.../k/v -> /'017'/42 -fetched: /test2/primary/...PK.../k/v -> /'016'/42 -fetched: /test2/primary/...PK.../k/v -> /'015'/42 -fetched: /test2/primary/...PK.../k/v -> /'014'/42 -fetched: /test2/primary/...PK.../k/v -> /'013'/42 -fetched: /test2/primary/...PK.../k/v -> /'012'/42 -fetched: /test2/primary/...PK.../k/v -> /'011'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'030'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'029'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'028'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'027'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'026'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'025'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'024'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'023'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'022'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'021'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'020'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'019'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'018'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'017'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'016'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'015'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'014'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'013'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'012'/42 +fetched: /test2/test2_pkey/...PK.../k/v -> /'011'/42 diff --git a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic index c2e32af26fe9..4442f9c6fcdb 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/show_trace_nonmetamorphic @@ -39,7 +39,7 @@ WHERE message NOT LIKE '%Z/%' AND operation != 'dist sender send' ---- batch flow coordinator CPut /NamespaceTable/30/1/53/29/"kv"/4/1 -> 54 -batch flow coordinator CPut /Table/3/1/54/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<> temporary:false partition_all_by:false > +batch flow coordinator CPut /Table/3/1/54/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<> temporary:false partition_all_by:false > exec stmt rows affected: 0 # We avoid using the full trace output, because that would make the @@ -65,7 +65,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/54/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges: users: owner_proto:"root" version:2 > mutations: interleave:<> partitioning: type:FORWARD created_explicitly:true encoding_type:0 sharded: disabled:false geo_config:<> predicate:"" > state:DELETE_ONLY direction:ADD mutation_id:1 rollback:false > next_mutation_id:2 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/54/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges: users: owner_proto:"root" version:2 > mutations: interleave:<> partitioning: type:FORWARD created_explicitly:true encoding_type:0 sharded: disabled:false geo_config:<> predicate:"" > state:DELETE_ONLY direction:ADD mutation_id:1 rollback:false > next_mutation_id:2 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -91,7 +91,7 @@ SELECT operation, message FROM [SHOW KV TRACE FOR SESSION] ---- batch flow coordinator CPut /Table/54/1/1/0 -> /TUPLE/2:2:Int/2 batch flow coordinator InitPut /Table/54/2/2/0 -> /BYTES/0x89 -exec stmt execution failed after 0 rows: duplicate key value violates unique constraint "primary" +exec stmt execution failed after 0 rows: duplicate key value violates unique constraint "kv_pkey" statement error duplicate key value SET tracing = on,kv,results; INSERT INTO t.kv(k, v) VALUES (2,2); SET tracing = off @@ -120,7 +120,7 @@ WHERE message NOT LIKE '%Z/%' AND operation != 'dist sender send' ---- batch flow coordinator CPut /NamespaceTable/30/1/53/29/"kv2"/4/1 -> 55 -batch flow coordinator CPut /Table/3/1/55/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:ADD offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<> temporary:false partition_all_by:false > +batch flow coordinator CPut /Table/3/1/55/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:ADD offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -137,7 +137,7 @@ WHERE message NOT LIKE '%Z/%' AND operation != 'dist sender send' ---- colbatchscan Scan /Table/55/{1-2} -colbatchscan fetched: /kv2/primary/-9222809086901354496/k/v -> /1/2 +colbatchscan fetched: /kv2/kv2_pkey/-9222809086901354496/k/v -> /1/2 batch flow coordinator Put /Table/55/1/-9222809086901354496/0 -> /TUPLE/1:1:Int/1/1:2:Int/4 batch flow coordinator fast path completed exec stmt rows affected: 1 @@ -168,7 +168,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/55/2/1 -> table: draining_names: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/55/2/1 -> table: draining_names: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:false default_expr:"unique_rowid()" hidden:true inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:4 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:2 privileges: users: owner_proto:"root" version:2 > next_mutation_id:1 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"TABLE t.public.kv" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -179,7 +179,7 @@ SELECT operation, message FROM [SHOW KV TRACE FOR SESSION] WHERE operation != 'dist sender send' AND operation != 'kv.DistSender: sending partial batch' ---- colbatchscan Scan /Table/54/{1-2} -colbatchscan fetched: /kv/primary/1/v -> /2 +colbatchscan fetched: /kv/kv_pkey/1/v -> /2 batch flow coordinator Del /Table/54/2/2/0 batch flow coordinator Del /Table/54/1/1/0 batch flow coordinator fast path completed @@ -202,7 +202,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/54/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges: users: owner_proto:"root" version:2 > mutations: interleave:<> partitioning: type:FORWARD created_explicitly:true encoding_type:0 sharded: disabled:false geo_config:<> predicate:"" > state:DELETE_AND_WRITE_ONLY direction:DROP mutation_id:2 rollback:false > next_mutation_id:3 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/54/2/1 -> table: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges: users: owner_proto:"root" version:2 > mutations: interleave:<> partitioning: type:FORWARD created_explicitly:true encoding_type:0 sharded: disabled:false geo_config:<> predicate:"" > state:DELETE_AND_WRITE_ONLY direction:DROP mutation_id:2 rollback:false > next_mutation_id:3 format_version:3 state:PUBLIC offline_reason:"" view_query:"" is_materialized_view:false mutationJobs:<...> new_schema_change_job_id:0 drop_time:0 replacement_of: > audit_mode:DISABLED drop_job_id:0 create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 statement ok @@ -219,7 +219,7 @@ WHERE message NOT LIKE '%Z/%' AND message NOT LIKE 'querying next range at%' AND tag NOT LIKE '%IndexBackfiller%' AND operation != 'dist sender send' ---- -batch flow coordinator Put /Table/3/1/54/2/1 -> table: draining_names: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 gc_mutations: create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > +batch flow coordinator Put /Table/3/1/54/2/1 -> table: draining_names: parent_id:53 unexposed_parent_schema_id:29 columns: TypeMeta: > nullable:false hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > columns: TypeMeta: > nullable:true hidden:false inaccessible:false generated_as_identity_type:NOT_IDENTITY_COLUMN virtual:false pg_attribute_num:0 alter_column_type_in_progress:false system_column_kind:NONE > next_column_id:3 families: next_family_id:1 primary_index: interleave:<> partitioning: type:FORWARD created_explicitly:false encoding_type:1 sharded: disabled:false geo_config:<> predicate:"" > next_index_id:3 privileges: users: owner_proto:"root" version:2 > next_mutation_id:3 format_version:3 state:DROP offline_reason:"" view_query:"" is_materialized_view:false new_schema_change_job_id:0 drop_time:... replacement_of: > audit_mode:DISABLED drop_job_id:0 gc_mutations: create_query:"" create_as_of_time:<...> temporary:false partition_all_by:false > exec stmt rows affected: 0 # Check that session tracing does not inhibit the fast path for inserts & diff --git a/pkg/sql/opt/exec/execbuilder/testdata/spool b/pkg/sql/opt/exec/execbuilder/testdata/spool index 10d13a29e583..9dca46a13102 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/spool +++ b/pkg/sql/opt/exec/execbuilder/testdata/spool @@ -35,7 +35,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN query T @@ -66,7 +66,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN @@ -101,7 +101,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -165,7 +165,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN query T @@ -195,7 +195,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -228,7 +228,7 @@ vectorized: true │ └── • scan missing stats - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -290,7 +290,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN query T @@ -308,7 +308,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: t@primary +│ table: t@t_pkey │ spans: FULL SCAN │ └── • subquery @@ -324,7 +324,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN # Check that if a spool is already added at some level, then it is not added @@ -359,7 +359,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: t2@primary +│ table: t2@t2_pkey │ spans: FULL SCAN │ └── • subquery @@ -403,7 +403,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN # Check that no spool is used for a top-level INSERT, but @@ -437,7 +437,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN # Check that simple computations using RETURNING get their spool pulled up. @@ -473,7 +473,7 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN # Check that a pulled up spool gets elided at the top level. @@ -506,5 +506,5 @@ vectorized: true │ └── • scan missing stats - table: t2@primary + table: t2@t2_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/sql_fn b/pkg/sql/opt/exec/execbuilder/testdata/sql_fn index 93d69d9b0010..816714708bab 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/sql_fn +++ b/pkg/sql/opt/exec/execbuilder/testdata/sql_fn @@ -44,7 +44,7 @@ SELECT create_statement FROM [SHOW CREATE TABLE my_spatial_table] CREATE TABLE public.my_spatial_table ( k INT8 NOT NULL, geom1 GEOMETRY(POINT,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1) ) @@ -60,7 +60,7 @@ CREATE TABLE public.my_spatial_table ( k INT8 NOT NULL, geom1 GEOMETRY(POINT,4326) NULL, geom2 GEOMETRY(POLYGON,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2) ) @@ -77,7 +77,7 @@ CREATE TABLE public.my_spatial_table ( geom1 GEOMETRY(POINT,4326) NULL, geom2 GEOMETRY(POLYGON,4326) NULL, geom3 GEOMETRY(MULTIPOLYGON,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2, geom3) ) @@ -95,7 +95,7 @@ CREATE TABLE public.my_spatial_table ( geom2 GEOMETRY(POLYGON,4326) NULL, geom3 GEOMETRY(MULTIPOLYGON,4326) NULL, geom4 GEOMETRY(LINESTRING,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2, geom3, geom4) ) @@ -114,7 +114,7 @@ CREATE TABLE public.my_spatial_table ( geom3 GEOMETRY(MULTIPOLYGON,4326) NULL, geom4 GEOMETRY(LINESTRING,4326) NULL, geom5 GEOMETRY(MULTIPOINT,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2, geom3, geom4, geom5) ) @@ -134,7 +134,7 @@ CREATE TABLE public.my_spatial_table ( geom4 GEOMETRY(LINESTRING,4326) NULL, geom5 GEOMETRY(MULTIPOINT,4326) NULL, geom6 GEOMETRY(MULTILINESTRING,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2, geom3, geom4, geom5, geom6) ) @@ -194,7 +194,7 @@ vectorized: true │ └── • scan │ columns: (k) │ estimated row count: 1,000 (missing stats) -│ table: other_table@primary +│ table: other_table@other_table_pkey │ spans: FULL SCAN │ ├── • subquery @@ -236,7 +236,7 @@ CREATE TABLE public.my_spatial_table ( geom6 GEOMETRY(MULTILINESTRING,4326) NULL, geom7 GEOMETRY(POINT,4326) NULL, geom8 GEOMETRY(POINT,4326) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2, geom3, geom4, geom5, geom6, geom7, geom8) ) @@ -268,7 +268,7 @@ CREATE TABLE public.my_spatial_table ( geom8 GEOMETRY(POINT,4326) NULL, geom9 GEOMETRY(GEOMETRY,4326) NULL, geom10 GEOMETRY(GEOMETRYCOLLECTION) NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT my_spatial_table_pkey PRIMARY KEY (k ASC), FAMILY "primary" (k, geom1, geom2, geom3, geom4, geom5, geom6, geom7, geom8, geom9, geom10) ) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/srfs b/pkg/sql/opt/exec/execbuilder/testdata/srfs index aa21efe6d9e0..bad23fb5365d 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/srfs +++ b/pkg/sql/opt/exec/execbuilder/testdata/srfs @@ -91,13 +91,13 @@ vectorized: true │ ├── • scan │ │ columns: (a) │ │ estimated row count: 1,000 (missing stats) -│ │ table: t@primary +│ │ table: t@t_pkey │ │ spans: FULL SCAN │ │ │ └── • scan │ columns: (b) │ estimated row count: 1,000 (missing stats) -│ table: u@primary +│ table: u@u_pkey │ spans: FULL SCAN │ └── • project set @@ -134,7 +134,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: data@primary + table: data@data_pkey spans: FULL SCAN statement ok @@ -182,14 +182,14 @@ vectorized: true │ columns: (x, y) │ ordering: +x │ estimated row count: 1,000 (missing stats) - │ table: xy@primary + │ table: xy@xy_pkey │ spans: FULL SCAN │ └── • scan columns: (x, z) ordering: +x estimated row count: 1,000 (missing stats) - table: xz@primary + table: xz@xz_pkey spans: FULL SCAN query T @@ -220,13 +220,13 @@ vectorized: true │ └── • scan │ columns: (x, y) │ estimated row count: 1,000 (missing stats) - │ table: xy@primary + │ table: xy@xy_pkey │ spans: FULL SCAN │ └── • scan columns: (x, z) estimated row count: 1,000 (missing stats) - table: xz@primary + table: xz@xz_pkey spans: FULL SCAN query T @@ -259,14 +259,14 @@ vectorized: true │ columns: (x, y) │ ordering: +x │ estimated row count: 1,000 (missing stats) - │ table: xy@primary + │ table: xy@xy_pkey │ spans: FULL SCAN │ └── • scan columns: (x, z) ordering: +x estimated row count: 1,000 (missing stats) - table: xz@primary + table: xz@xz_pkey spans: FULL SCAN query T @@ -290,7 +290,7 @@ vectorized: true │ └── • scan │ columns: (z) │ estimated row count: 1,000 (missing stats) -│ table: xz@primary +│ table: xz@xz_pkey │ spans: FULL SCAN │ └── • subquery @@ -313,7 +313,7 @@ vectorized: true └── • scan columns: (x, y) estimated row count: 1,000 (missing stats) - table: xy@primary + table: xy@xy_pkey spans: FULL SCAN # Regression test for #24676. @@ -369,7 +369,7 @@ vectorized: true │ └── • scan │ columns: (id, data) │ estimated row count: 1,000 (missing stats) - │ table: groups@primary + │ table: groups@groups_pkey │ spans: FULL SCAN │ └── • render @@ -381,7 +381,7 @@ vectorized: true └── • scan columns: (data) estimated row count: 1,000 (missing stats) - table: groups@primary + table: groups@groups_pkey spans: FULL SCAN # Regression test for #32162. @@ -460,7 +460,7 @@ vectorized: true └── • scan columns: (id, body, description, title, slug, tag_list, user_id, created_at, updated_at) estimated row count: 1,000 (missing stats) - table: articles@primary + table: articles@articles_pkey spans: FULL SCAN # Regression test for #32723. diff --git a/pkg/sql/opt/exec/execbuilder/testdata/subquery b/pkg/sql/opt/exec/execbuilder/testdata/subquery index 9a6fe842a6f3..daa4176e18ef 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/subquery +++ b/pkg/sql/opt/exec/execbuilder/testdata/subquery @@ -48,7 +48,7 @@ vectorized: true │ └── • scan missing stats - table: abc@primary + table: abc@abc_pkey spans: LIMITED SCAN limit: 1 @@ -69,7 +69,7 @@ vectorized: true │ └── • scan │ columns: (a, b, c) │ estimated row count: 1,000 (missing stats) -│ table: abc@primary +│ table: abc@abc_pkey │ spans: FULL SCAN │ ├── • subquery @@ -90,7 +90,7 @@ vectorized: true │ └── • scan │ columns: (a, b, c) │ estimated row count: 1,000 (missing stats) -│ table: abc@primary +│ table: abc@abc_pkey │ spans: FULL SCAN │ └── • subquery @@ -118,7 +118,7 @@ vectorized: true columns: (a) ordering: -a estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # IN expression transformed into semi-join. @@ -140,7 +140,7 @@ vectorized: true │ columns: (a) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abc@primary +│ table: abc@abc_pkey │ spans: FULL SCAN │ └── • filter @@ -153,7 +153,7 @@ vectorized: true columns: (a, b) ordering: +a estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN query T @@ -234,7 +234,7 @@ vectorized: true └── • scan columns: (col0, col3, col4, rowid) estimated row count: 1,000 (missing stats) - table: tab4@primary + table: tab4@tab4_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -262,14 +262,14 @@ vectorized: true │ columns: (x, y) │ ordering: +x │ estimated row count: 1,000 (missing stats) -│ table: a@primary +│ table: a@a_pkey │ spans: FULL SCAN │ └── • scan columns: (x) ordering: +x estimated row count: 1,000 (missing stats) - table: b@primary + table: b@b_pkey spans: FULL SCAN query T @@ -287,7 +287,7 @@ vectorized: true ├── • scan │ columns: (x, y) │ estimated row count: 1,000 (missing stats) -│ table: a@primary +│ table: a@a_pkey │ spans: FULL SCAN │ └── • render @@ -298,7 +298,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: b@primary + table: b@b_pkey spans: FULL SCAN query T @@ -319,14 +319,14 @@ vectorized: true │ columns: (x, y) │ ordering: +x │ estimated row count: 1,000 (missing stats) -│ table: a@primary +│ table: a@a_pkey │ spans: FULL SCAN │ └── • scan columns: (x) ordering: +x estimated row count: 1,000 (missing stats) - table: b@primary + table: b@b_pkey spans: FULL SCAN query T @@ -344,7 +344,7 @@ vectorized: true ├── • scan │ columns: (x, z) │ estimated row count: 1,000 (missing stats) -│ table: b@primary +│ table: b@b_pkey │ spans: FULL SCAN │ └── • render @@ -355,7 +355,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: a@primary + table: a@a_pkey spans: FULL SCAN query T @@ -380,7 +380,7 @@ vectorized: true └── • scan columns: (x) estimated row count: 1,000 (missing stats) - table: b@primary + table: b@b_pkey spans: FULL SCAN # Case where the plan has an apply join. @@ -398,5 +398,5 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/subquery_correlated b/pkg/sql/opt/exec/execbuilder/testdata/subquery_correlated index 1fbba1e6e1dc..da028d7b7cb8 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/subquery_correlated +++ b/pkg/sql/opt/exec/execbuilder/testdata/subquery_correlated @@ -39,12 +39,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: c@primary + │ table: c@c_pkey │ spans: FULL SCAN │ └── • render │ └── • scan missing stats - table: o@primary + table: o@o_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/topk b/pkg/sql/opt/exec/execbuilder/testdata/topk index 366250a67ed9..679d26419049 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/topk +++ b/pkg/sql/opt/exec/execbuilder/testdata/topk @@ -20,7 +20,7 @@ vectorized: true └── • scan columns: (k, v, w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # No TopK when ordering by an index. @@ -34,7 +34,7 @@ vectorized: true │ columns: (k, v, w) │ ordering: +v │ estimated row count: 10 (missing stats) -│ table: t@primary +│ table: t@t_pkey │ key columns: k │ └── • scan @@ -62,7 +62,7 @@ vectorized: true └── • scan columns: (k, v, w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # TopK added in subquery. @@ -86,7 +86,7 @@ vectorized: true └── • scan columns: (k, w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # TopK with filter. @@ -111,7 +111,7 @@ vectorized: true └── • scan columns: (k, v, w) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN # When partial ordering is available, choose topk. @@ -131,7 +131,7 @@ vectorized: true └── • index join │ columns: (k, v, w) │ estimated row count: 1,000 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ key columns: k │ └── • scan diff --git a/pkg/sql/opt/exec/execbuilder/testdata/tuple b/pkg/sql/opt/exec/execbuilder/testdata/tuple index fabef6144c48..ea67b93851fd 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/tuple +++ b/pkg/sql/opt/exec/execbuilder/testdata/tuple @@ -138,7 +138,7 @@ vectorized: true └── • index join │ columns: (a, b, c) │ estimated row count: 80 (missing stats) - │ table: abc@primary + │ table: abc@abc_pkey │ key columns: rowid │ └── • scan @@ -192,7 +192,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -216,7 +216,7 @@ vectorized: true └── • scan columns: (v int) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T diff --git a/pkg/sql/opt/exec/execbuilder/testdata/union b/pkg/sql/opt/exec/execbuilder/testdata/union index 8b3264e9ff6a..0226c6fd5d62 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/union +++ b/pkg/sql/opt/exec/execbuilder/testdata/union @@ -16,12 +16,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: uniontest@primary +│ table: uniontest@uniontest_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: uniontest@primary + table: uniontest@uniontest_pkey spans: FULL SCAN query T @@ -34,12 +34,12 @@ vectorized: true │ ├── • scan │ missing stats -│ table: uniontest@primary +│ table: uniontest@uniontest_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: uniontest@primary + table: uniontest@uniontest_pkey spans: FULL SCAN # Check that EXPLAIN properly releases memory for virtual tables. @@ -82,7 +82,7 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • project @@ -91,7 +91,7 @@ vectorized: true └── • scan columns: (a, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Regression test for #32723. @@ -188,13 +188,13 @@ vectorized: true │ └── • scan │ columns: (k) │ estimated row count: 1,000 (missing stats) - │ table: uniontest@primary + │ table: uniontest@uniontest_pkey │ spans: FULL SCAN │ └── • scan columns: () estimated row count: 1,000 (missing stats) - table: uniontest@primary + table: uniontest@uniontest_pkey spans: FULL SCAN statement ok @@ -449,7 +449,7 @@ vectorized: true │ columns: (a, b, c, d, e) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • sort @@ -531,7 +531,7 @@ vectorized: true │ columns: (a, b, c, d, e) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • filter @@ -544,7 +544,7 @@ vectorized: true columns: (a, b, c, d, e) ordering: +a estimated row count: 1,000 (missing stats) - table: abcde@primary + table: abcde@abcde_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyskN1q20AQhe_7FMNcSe0GW5YCZcEgp95QgSqlkvtH0cVGOwSBolV319Bi_O7FUiFRiE3S5HJ-znznzA7trxY5iu9X6SrJwFsn5ab8nDL4KoqLvBQ-lCIVHzbwFi6L_BN401Je14rgS5bkGazSFB6Z-vDtoygEeDUsIfBhla3BU7AE8iEv1qKAix8gkWGnFWXylizynxhgxbA3uiZrtTm0dsNCon4jnzNsun7rDu2KYa0NId-ha1xLyHEjr1sqSCoyszkyVORk0w5nB0dxb5pbaf4gw7KXneVwhtWeod66u6PWyRtCHuzZ08GXTevIkJkFU-rY5-DF4eEHnPMk27z_94o4giXE5_5RC4vnWLifffHC7OF_ZQ9fM3t01MIdWRtFhtQUGwfvsNo_4jPTZ7qfRZPtY_T5cx5QkO11Z-mJlyuGpG5ojGL11tR0ZXQ9YMYyH3RDQ5F14zQYi6QbRweD98XBSXE0EQcPxYuT4vA0OXwJOTopPn9ArvZv_gYAAP__aIR-OA== @@ -687,7 +687,7 @@ vectorized: true │ columns: (a, b, c, d, e) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • filter @@ -700,7 +700,7 @@ vectorized: true columns: (a, b, c, d, e) ordering: +a estimated row count: 1,000 (missing stats) - table: abcde@primary + table: abcde@abcde_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyskm-L2kAQxt_3UwzzKqlbNH-EsiCsd-ao4BmbhPZK8UUuO7WBXJLurtBD_O4lSeGMqK3tvZyZ_c0zz5PsUP8okGPwsFpM50uwZvM4iT8uGHwKopswDmyIg0Vwm8BbuIvCe7D6ZfqYSYLg4TZYJTBdLODE2IbPH4IoACuDCTg2TJczsCRMgGwIo1kQwc0XSJFhWUlapk-kkX9FB9cMa1VlpHWlmtaufTCXP5GPGOZlvTVNe80wqxQh36HJTUHIMUkfC4oolaSGI2QoyaR50a5tLxK1yp9S9YwM4zotNYd3uN4zrLbmZak26YaQO3v298J3eWFIkRo6fdWuz8ESXpMB53y-TN7_jkL4MAExts-e4F5zwqF39z-9e__k3XtN7_7ZE16Ut2WlJCmSPeF1Q_7pyQkf96Q2FJMJ66Hfd5I818QPfnZkWNA3YwlnwIQ7YMIbMOEPmBgP7InKN99Pj5BhuDUchMOEy4THhM_E-GwC42s-QkS6rkpNx0mc3Dxq7JPcUBenrrYqo5WqslamK8OWaxuStOmmTlfMy27UHHgIOxdhvwc7x7B7EfYuK3tXKLvHsH8RHh8pr_dvfgUAAP__ApejQg== @@ -814,7 +814,7 @@ vectorized: true │ columns: (a, b, c) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • scan @@ -841,7 +841,7 @@ vectorized: true │ columns: (a, b, c) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • scan @@ -902,7 +902,7 @@ vectorized: true columns: (a, d, e) ordering: +a estimated row count: 1,000 (missing stats) - table: abcde@primary + table: abcde@abcde_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyckt9r2zAQx9_3V4h7aumNxD_yYhioaz0IuHUWm1EYxijWLTO4lifJ0BLyvw_blMYh8Za-BHS6jz7fu3gH5k8FAYRPq-h2-ciu7pdJmnyPkP0I11_jJLxmSRiFdynbICuQSfZtHT8wsSkksfDpLlylbw0CmURGBw2AUCtJj-KZDAQ_wYEModGqIGOU7kq7vmEpXyCYI5R109qunCEUShMEO7ClrQgCSMWmojUJSXo2BwRJVpRV_2zv4v1vvsmLXOaUl_IFEJJG1CZgnwEhbm3AuIvcQ-5DtkdQrX3XGSu2BIGzx49Fck5FanT5LPTrqSAOch_54mwQ95Ig96WxZV3YmTtO0Vm6iTurlqRJDua-ds7sfcjs_Y_5rNM_63xXtbUaXhqZso78V8uJ4A-kt5SQjZuZP46evjYUvH3at1EECBX9slfcuUHu3iD3bq6_6HL7e1w6_Gcn97u4ZL9rMo2qDR3PfPLleTcoyS0NizOq1QWttCp6zXCMe64vSDJ2uHWHw7IerrqAh7AzCXvTsDsJ-yPYOYa9C2D3GPYn4cVR7Gz_6W8AAAD__751mqU= @@ -922,7 +922,7 @@ vectorized: true │ columns: (a, b, c) │ ordering: +a │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • scan @@ -948,13 +948,13 @@ vectorized: true ├── • scan │ columns: (a, b, c) │ estimated row count: 1,000 (missing stats) -│ table: abcde@primary +│ table: abcde@abcde_pkey │ spans: FULL SCAN │ └── • scan columns: (b, c, d) estimated row count: 1,000 (missing stats) - table: abcde@primary + table: abcde@abcde_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJykkUFrq0AUhffvVwx39R7cEDVvNSvT1oJgNdW0FIqLiXMJgnHszAgtwf9eMlKSlKQ07fKee849n84WzEsDHKKnRTKPU_b3Ji6WxX2C7DHKr7Ii-seKKImul0wgWyGr2G2e3TGxqiSxhzTOUjZPkg_PzoBMHngAoVWSUrEhA_wZfCgROq0qMkbpnbR1hli-AvcQ6rbr7U4uESqlCfgWbG0bAg5LsWooJyFJTz1AkGRF3bizrivsdL0R-g0Qik60hrMJIGS95SwMMJxh-B_KAUH1dl9irFgTcH_An4H4F4L46FjOggRnQfb9hnQtGta3SkvSJI8QyuEEcaomqpsGn4ynCbxLfkVOplOtoW9eLhFIrmn8HKN6XdFCq8rVjGPmck6QZOy4DcYhbt3KvdVh2P9NOPgyPDsKe0M5_HkPAAD__-GfBxI= @@ -981,7 +981,7 @@ vectorized: true │ columns: (d, e, f) │ ordering: +d │ estimated row count: 1,000 (missing stats) -│ table: def@primary +│ table: def@def_pkey │ spans: FULL SCAN │ └── • scan @@ -1013,7 +1013,7 @@ vectorized: true │ columns: (e, f, g, h) │ ordering: +e │ estimated row count: 1,000 (missing stats) -│ table: efgh@primary +│ table: efgh@efgh_pkey │ spans: FULL SCAN │ └── • sort @@ -1056,7 +1056,7 @@ vectorized: true │ columns: (k, tableoid) │ ordering: +k │ estimated row count: 1,000 (missing stats) -│ table: t68702@primary +│ table: t68702@t68702_pkey │ spans: FULL SCAN │ └── • values diff --git a/pkg/sql/opt/exec/execbuilder/testdata/unique b/pkg/sql/opt/exec/execbuilder/testdata/unique index fd8c4986cefb..5598bf8653b0 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/unique +++ b/pkg/sql/opt/exec/execbuilder/testdata/unique @@ -267,7 +267,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -283,7 +283,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -318,7 +318,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -337,7 +337,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: uniq(k, v, w, x, y) │ auto commit -│ arbiter indexes: primary, uniq_v_key +│ arbiter indexes: uniq_pkey, uniq_v_key │ arbiter constraints: unique_w, unique_x_y │ └── • cross join (right anti) @@ -347,7 +347,7 @@ vectorized: true ├── • scan │ columns: (k) │ estimated row count: 1 (missing stats) - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: /1/0 │ └── • hash join (right anti) @@ -359,7 +359,7 @@ vectorized: true ├── • scan │ columns: (w) │ estimated row count: 1,000 (missing stats) - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • lookup join (anti) @@ -378,7 +378,7 @@ vectorized: true ├── • scan │ columns: (x, y) │ estimated row count: 1,000 (missing stats) - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • values @@ -407,7 +407,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -423,7 +423,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq@primary +│ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -439,7 +439,7 @@ vectorized: true │ └── • scan missing stats - table: uniq@primary + table: uniq@uniq_pkey spans: FULL SCAN # Add inequality filters for the primary key columns that are not part of each @@ -471,7 +471,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_overlaps_pk@primary +│ │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -482,7 +482,7 @@ vectorized: true │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: uniq_overlaps_pk@primary +│ │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ │ equality: (column1) = (a) │ │ pred: column2 != b │ │ @@ -499,7 +499,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_overlaps_pk@primary + │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -526,7 +526,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -542,7 +542,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_hidden_pk@primary +│ table: uniq_hidden_pk@uniq_hidden_pk_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -558,7 +558,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_hidden_pk@primary +│ table: uniq_hidden_pk@uniq_hidden_pk_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -574,7 +574,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_hidden_pk@primary + table: uniq_hidden_pk@uniq_hidden_pk_pkey spans: FULL SCAN # Combine unique checks with foreign keys. @@ -608,7 +608,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -624,7 +624,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_fk_parent@primary + │ table: uniq_fk_parent@uniq_fk_parent_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -662,7 +662,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_child@primary +│ │ table: uniq_fk_child@uniq_fk_child_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -677,7 +677,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -692,7 +692,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_fk_parent@primary + │ table: uniq_fk_parent@uniq_fk_parent_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -753,7 +753,7 @@ vectorized: true │ │ │ └── • lookup join (semi) │ │ columns: ("lookup_join_const_col_@12", column1, column3) -│ │ table: uniq_enum@primary +│ │ table: uniq_enum@uniq_enum_pkey │ │ equality: (lookup_join_const_col_@12, column3) = (r,i) │ │ equality cols are key │ │ pred: column1 != r @@ -876,7 +876,7 @@ vectorized: true │ └── • lookup join (semi) │ columns: ("lookup_join_const_col_@12", r_default, column2) - │ table: uniq_enum@primary + │ table: uniq_enum@uniq_enum_pkey │ equality: (lookup_join_const_col_@12, column2) = (r,i) │ equality cols are key │ pred: r_default != r @@ -914,7 +914,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: uniq_enum(r, s, i, j) │ auto commit -│ arbiter indexes: primary, uniq_enum_r_s_j_key +│ arbiter indexes: uniq_enum_pkey, uniq_enum_r_s_j_key │ arbiter constraints: unique_i, unique_s_j │ └── • render @@ -936,14 +936,14 @@ vectorized: true └── • lookup join (anti) │ columns: (column1, column2, column3, column4) │ estimated row count: 0 (missing stats) - │ table: uniq_enum@primary + │ table: uniq_enum@uniq_enum_pkey │ equality cols are key │ lookup condition: (column3 = i) AND (r IN ('us-east', 'us-west', 'eu-west')) │ └── • lookup join (anti) │ columns: (column1, column2, column3, column4) │ estimated row count: 0 (missing stats) - │ table: uniq_enum@primary + │ table: uniq_enum@uniq_enum_pkey │ equality: (column1, column3) = (r,i) │ equality cols are key │ @@ -997,7 +997,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -1021,7 +1021,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -1062,7 +1062,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -1085,7 +1085,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: uniq_partial(k, a, b) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: uniq_partial_pkey │ arbiter constraints: unique_a, unique_b │ └── • project @@ -1134,7 +1134,7 @@ vectorized: true │ └── • scan │ columns: (b) │ estimated row count: 1,000 (missing stats) - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • hash join (right anti) @@ -1152,7 +1152,7 @@ vectorized: true │ └── • scan │ columns: (a, b) │ estimated row count: 1,000 (missing stats) - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • cross join (anti) @@ -1169,7 +1169,7 @@ vectorized: true └── • scan columns: (k) estimated row count: 1 (missing stats) - table: uniq_partial@primary + table: uniq_partial@uniq_partial_pkey spans: /1/0 # Insert with non-constant input. @@ -1189,7 +1189,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -1205,7 +1205,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -1227,7 +1227,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -1269,7 +1269,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -1291,7 +1291,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial_hidden_pk@primary + table: uniq_partial_hidden_pk@uniq_partial_hidden_pk_pkey spans: FULL SCAN # Test that we use the partial index when available for the insert checks. @@ -1392,7 +1392,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: uniq_partial_enum(r, a, b, c) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: uniq_partial_enum_pkey │ arbiter constraints: unique_b │ └── • render @@ -1430,7 +1430,7 @@ vectorized: true └── • lookup join (anti) │ columns: (column1, column2, column3, column4) │ estimated row count: 0 - │ table: uniq_partial_enum@primary + │ table: uniq_partial_enum@uniq_partial_enum_pkey │ equality: (column1, column2) = (r,a) │ equality cols are key │ @@ -1515,7 +1515,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_uuid@primary + │ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -1552,7 +1552,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_uuid@primary + │ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -1577,7 +1577,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -1593,7 +1593,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_uuid@primary + table: uniq_uuid@uniq_uuid_pkey spans: FULL SCAN statement ok @@ -1628,7 +1628,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_uuid@primary +│ │ table: uniq_uuid@uniq_uuid_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -1645,7 +1645,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_uuid@primary + │ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -1678,7 +1678,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq@primary +│ table: uniq@uniq_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1695,7 +1695,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq@primary +│ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -1711,7 +1711,7 @@ vectorized: true │ └── • scan missing stats - table: uniq@primary + table: uniq@uniq_pkey spans: FULL SCAN # No need to plan checks for x,y since x is always null. @@ -1735,7 +1735,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq@primary +│ table: uniq@uniq_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -1752,7 +1752,7 @@ vectorized: true │ └── • scan missing stats - table: uniq@primary + table: uniq@uniq_pkey spans: FULL SCAN # No need to plan checks since none of the columns requiring checks are updated. @@ -1771,7 +1771,7 @@ vectorized: true │ └── • scan missing stats - table: uniq@primary + table: uniq@uniq_pkey spans: FULL SCAN locking strength: for update @@ -1796,7 +1796,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_overlaps_pk@primary +│ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ spans: [/5 - /5] │ locking strength: for update │ @@ -1810,7 +1810,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_overlaps_pk@primary +│ │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -1821,7 +1821,7 @@ vectorized: true │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: uniq_overlaps_pk@primary +│ │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ │ equality: (a_new) = (a) │ │ pred: b_new != b │ │ @@ -1838,7 +1838,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_overlaps_pk@primary + │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -1868,7 +1868,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_overlaps_pk@primary +│ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ spans: [/5 - /5] │ locking strength: for update │ @@ -1883,7 +1883,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_overlaps_pk@primary +│ │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -1894,7 +1894,7 @@ vectorized: true │ └── • error if rows │ │ │ └── • lookup join (semi) -│ │ table: uniq_overlaps_pk@primary +│ │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ │ equality: (a_new) = (a) │ │ pred: b_new != b │ │ @@ -1912,7 +1912,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_overlaps_pk@primary + │ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -1940,12 +1940,12 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_hidden_pk@primary +│ │ table: uniq_hidden_pk@uniq_hidden_pk_pkey │ │ spans: FULL SCAN │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -1961,7 +1961,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_hidden_pk@primary +│ table: uniq_hidden_pk@uniq_hidden_pk_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -1977,7 +1977,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_hidden_pk@primary + table: uniq_hidden_pk@uniq_hidden_pk_pkey spans: FULL SCAN # Combine unique checks with foreign keys. @@ -2001,7 +2001,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_fk_parent@primary +│ table: uniq_fk_parent@uniq_fk_parent_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2022,7 +2022,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_fk_parent@primary + table: uniq_fk_parent@uniq_fk_parent_pkey spans: FULL SCAN # Combine unique checks with foreign keys. @@ -2046,7 +2046,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_fk_child@primary +│ table: uniq_fk_child@uniq_fk_child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2060,7 +2060,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -2081,7 +2081,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_fk_parent@primary + table: uniq_fk_parent@uniq_fk_parent_pkey spans: FULL SCAN # Combine unique checks with foreign keys. @@ -2105,7 +2105,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_fk_child@primary +│ table: uniq_fk_child@uniq_fk_child_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2122,7 +2122,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_fk_child@primary +│ table: uniq_fk_child@uniq_fk_child_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -2137,7 +2137,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_fk_parent@primary + table: uniq_fk_parent@uniq_fk_parent_pkey spans: FULL SCAN # Test that we use the index when available for the update checks. @@ -2186,7 +2186,7 @@ vectorized: true │ └── • scan │ columns: (r, s, i, j) │ estimated row count: 9 (missing stats) -│ table: uniq_enum@primary +│ table: uniq_enum@uniq_enum_pkey │ spans: /"\xc0"/11-/"\xc0"/20/# │ parallel │ locking strength: for update @@ -2206,7 +2206,7 @@ vectorized: true │ │ │ └── • lookup join (semi) │ │ columns: (r_new, i_new, "lookup_join_const_col_@17") -│ │ table: uniq_enum@primary +│ │ table: uniq_enum@uniq_enum_pkey │ │ equality: (lookup_join_const_col_@17, i_new) = (r,i) │ │ equality cols are key │ │ pred: r_new != r @@ -2289,7 +2289,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2312,7 +2312,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -2334,7 +2334,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial@primary + table: uniq_partial@uniq_partial_pkey spans: FULL SCAN # No need to plan checks for a since a is always null. @@ -2358,7 +2358,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2381,7 +2381,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial@primary + table: uniq_partial@uniq_partial_pkey spans: FULL SCAN # No need to plan checks since none of the columns requiring checks are updated. @@ -2400,7 +2400,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial@primary + table: uniq_partial@uniq_partial_pkey spans: FULL SCAN locking strength: for update @@ -2424,7 +2424,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2447,7 +2447,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -2469,7 +2469,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial@primary + table: uniq_partial@uniq_partial_pkey spans: FULL SCAN # Test that we use the index when available for the update checks. @@ -2508,7 +2508,7 @@ vectorized: true │ └── • scan │ columns: (r, a, b, c) │ estimated row count: 1 (0.10% of the table; stats collected ago) -│ table: uniq_partial_enum@primary +│ table: uniq_partial_enum@uniq_partial_enum_pkey │ spans: /"@"/2/0 /"@"/2/2/1-/"@"/2/3/2 /"\x80"/2/0 /"\x80"/2/2/1-/"\x80"/2/3/2 /"\xc0"/2/0 /"\xc0"/2/2/1-/"\xc0"/2/3/2 │ parallel │ locking strength: for update @@ -2577,7 +2577,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_uuid@primary +│ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2594,7 +2594,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_uuid@primary + table: uniq_uuid@uniq_uuid_pkey spans: FULL SCAN statement ok @@ -2620,7 +2620,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_uuid@primary +│ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ locking strength: for update │ @@ -2637,7 +2637,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_uuid@primary +│ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -2653,7 +2653,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_uuid@primary + table: uniq_uuid@uniq_uuid_pkey spans: FULL SCAN statement ok @@ -2674,7 +2674,7 @@ vectorized: true │ ├── • upsert │ │ into: uniq(k, v, w, x, y) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -2682,7 +2682,7 @@ vectorized: true │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ equality: (column1) = (k) │ │ equality cols are key │ │ locking strength: for update @@ -2700,7 +2700,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -2716,7 +2716,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -2734,7 +2734,7 @@ vectorized: true │ ├── • upsert │ │ into: uniq(k, v, w, x, y) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -2742,7 +2742,7 @@ vectorized: true │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ equality: (column1) = (k) │ │ equality cols are key │ │ locking strength: for update @@ -2763,7 +2763,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -2779,7 +2779,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -2797,7 +2797,7 @@ vectorized: true │ ├── • upsert │ │ into: uniq(k, v, w, x, y) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -2805,7 +2805,7 @@ vectorized: true │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ equality: (column1) = (k) │ │ equality cols are key │ │ locking strength: for update @@ -2826,7 +2826,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -2842,7 +2842,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -2861,7 +2861,7 @@ vectorized: true │ ├── • upsert │ │ into: uniq(k, v, w, x, y) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -2869,7 +2869,7 @@ vectorized: true │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ equality: (column1) = (k) │ │ equality cols are key │ │ locking strength: for update @@ -2890,7 +2890,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -2906,7 +2906,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -2944,12 +2944,12 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: other@primary +│ │ table: other@other_pkey │ │ spans: FULL SCAN │ │ │ └── • scan │ missing stats -│ table: uniq@primary +│ table: uniq@uniq_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -2965,7 +2965,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq@primary +│ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -2981,7 +2981,7 @@ vectorized: true │ └── • scan missing stats - table: uniq@primary + table: uniq@uniq_pkey spans: FULL SCAN # On conflict do update with constant input, conflict on UNIQUE WITHOUT INDEX @@ -3008,7 +3008,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • render @@ -3027,7 +3027,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq@primary +│ │ table: uniq@uniq_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -3043,7 +3043,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq@primary + │ table: uniq@uniq_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -3071,7 +3071,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -3087,7 +3087,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_overlaps_pk@primary +│ table: uniq_overlaps_pk@uniq_overlaps_pk_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -3103,7 +3103,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_overlaps_pk@primary + table: uniq_overlaps_pk@uniq_overlaps_pk_pkey spans: FULL SCAN # Upsert with non-constant input. @@ -3126,7 +3126,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -3142,7 +3142,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_hidden_pk@primary +│ table: uniq_hidden_pk@uniq_hidden_pk_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -3158,7 +3158,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_hidden_pk@primary +│ table: uniq_hidden_pk@uniq_hidden_pk_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -3174,7 +3174,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_hidden_pk@primary + table: uniq_hidden_pk@uniq_hidden_pk_pkey spans: FULL SCAN # Combine unique checks with foreign keys. @@ -3189,7 +3189,7 @@ vectorized: true │ ├── • upsert │ │ into: uniq_fk_parent(a, b, c, rowid) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_fk_parent_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -3197,7 +3197,7 @@ vectorized: true │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ equality: (rowid_default) = (rowid) │ │ equality cols are key │ │ @@ -3227,7 +3227,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -3243,7 +3243,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -3259,7 +3259,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_fk_child@primary + │ table: uniq_fk_child@uniq_fk_child_pkey │ spans: FULL SCAN │ └── • except @@ -3301,7 +3301,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_child@primary +│ │ table: uniq_fk_child@uniq_fk_child_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -3316,7 +3316,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_fk_parent@primary +│ │ table: uniq_fk_parent@uniq_fk_parent_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -3331,7 +3331,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_fk_parent@primary + │ table: uniq_fk_parent@uniq_fk_parent_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -3351,7 +3351,7 @@ vectorized: true │ │ columns: () │ │ estimated row count: 0 (missing stats) │ │ into: uniq_enum(r, s, i, j) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_enum_pkey │ │ │ └── • buffer │ │ columns: (column1, column2, column3, column4, r, s, i, j, column2, column4, r, check1, upsert_r, upsert_i) @@ -3392,7 +3392,7 @@ vectorized: true │ └── • lookup join (left outer) │ │ columns: (column1, column2, column3, column4, r, s, i, j) │ │ estimated row count: 2 (missing stats) -│ │ table: uniq_enum@primary +│ │ table: uniq_enum@uniq_enum_pkey │ │ equality: (column1, column3) = (r,i) │ │ equality cols are key │ │ locking strength: for update @@ -3424,7 +3424,7 @@ vectorized: true │ │ │ └── • lookup join (semi) │ │ columns: ("lookup_join_const_col_@20", upsert_r, upsert_i) -│ │ table: uniq_enum@primary +│ │ table: uniq_enum@uniq_enum_pkey │ │ equality: (lookup_join_const_col_@20, upsert_i) = (r,i) │ │ equality cols are key │ │ pred: upsert_r != r @@ -3575,7 +3575,7 @@ vectorized: true │ └── • lookup join (semi) │ columns: ("lookup_join_const_col_@23", upsert_r, upsert_i) - │ table: uniq_enum@primary + │ table: uniq_enum@uniq_enum_pkey │ equality: (lookup_join_const_col_@23, upsert_i) = (r,i) │ equality cols are key │ pred: upsert_r != r @@ -3630,7 +3630,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -3653,7 +3653,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -3675,7 +3675,7 @@ vectorized: true │ ├── • upsert │ │ into: uniq_partial(k, a, b) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_partial_pkey │ │ │ └── • buffer │ │ label: buffer 1 @@ -3683,7 +3683,7 @@ vectorized: true │ └── • render │ │ │ └── • lookup join (left outer) -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ equality: (column1) = (k) │ │ equality cols are key │ │ locking strength: for update @@ -3707,7 +3707,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -3729,7 +3729,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -3769,7 +3769,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -3808,7 +3808,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ spans: FULL SCAN │ │ │ └── • distinct @@ -3836,7 +3836,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: uniq_partial@primary +│ │ table: uniq_partial@uniq_partial_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -3858,7 +3858,7 @@ vectorized: true │ │ │ └── • scan │ missing stats - │ table: uniq_partial@primary + │ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • filter @@ -3900,7 +3900,7 @@ vectorized: true │ │ │ │ │ └── • scan │ │ missing stats -│ │ table: other@primary +│ │ table: other@other_pkey │ │ spans: FULL SCAN │ │ │ └── • filter @@ -3908,7 +3908,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ ├── • constraint-check @@ -3930,7 +3930,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: uniq_partial@primary +│ table: uniq_partial@uniq_partial_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -3952,7 +3952,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial@primary + table: uniq_partial@uniq_partial_pkey spans: FULL SCAN # No need to build uniqueness checks when the primary key columns are a subset @@ -3990,7 +3990,7 @@ vectorized: true │ │ │ └── • scan │ missing stats -│ table: other@primary +│ table: other@other_pkey │ spans: FULL SCAN │ └── • constraint-check @@ -4012,7 +4012,7 @@ vectorized: true │ └── • scan missing stats - table: uniq_partial_hidden_pk@primary + table: uniq_partial_hidden_pk@uniq_partial_hidden_pk_pkey spans: FULL SCAN # Test that we use the index when available for the upsert checks. @@ -4029,7 +4029,7 @@ vectorized: true │ │ columns: () │ │ estimated row count: 0 (missing stats) │ │ into: uniq_partial_enum(r, a, b, c) -│ │ arbiter indexes: primary +│ │ arbiter indexes: uniq_partial_enum_pkey │ │ │ └── • buffer │ │ columns: (column1, column2, column3, column4, r, a, b, c, column3, column4, r, check1, partial_index_put1, partial_index_del1, upsert_r, upsert_a) @@ -4072,7 +4072,7 @@ vectorized: true │ └── • lookup join (left outer) │ │ columns: (column1, column2, column3, column4, r, a, b, c) │ │ estimated row count: 2 -│ │ table: uniq_partial_enum@primary +│ │ table: uniq_partial_enum@uniq_partial_enum_pkey │ │ equality: (column1, column2) = (r,a) │ │ equality cols are key │ │ locking strength: for update @@ -4170,7 +4170,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (arbiter_unique_b_distinct, column1, column2, column3, column4, r, a, b, c) │ estimated row count: 2 - │ table: uniq_partial_enum@primary + │ table: uniq_partial_enum@uniq_partial_enum_pkey │ equality: (r, a) = (r,a) │ equality cols are key │ @@ -4239,7 +4239,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_uuid@primary + │ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ └── • scan buffer @@ -4277,7 +4277,7 @@ vectorized: true │ │ │ ├── • scan │ │ missing stats -│ │ table: uniq_uuid@primary +│ │ table: uniq_uuid@uniq_uuid_pkey │ │ spans: FULL SCAN │ │ │ └── • scan buffer @@ -4294,7 +4294,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: uniq_uuid@primary + │ table: uniq_uuid@uniq_uuid_pkey │ spans: FULL SCAN │ └── • scan buffer diff --git a/pkg/sql/opt/exec/execbuilder/testdata/update b/pkg/sql/opt/exec/execbuilder/testdata/update index 29393e0062f3..f837456c71bc 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/update +++ b/pkg/sql/opt/exec/execbuilder/testdata/update @@ -20,14 +20,14 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv2/primary/'a' -> NULL -fetched: /kv2/primary/'a'/v -> 'b' -fetched: /kv2/primary/'c' -> NULL -fetched: /kv2/primary/'c'/v -> 'd' -fetched: /kv2/primary/'e' -> NULL -fetched: /kv2/primary/'e'/v -> 'f' -fetched: /kv2/primary/'f' -> NULL -fetched: /kv2/primary/'f'/v -> 'g' +fetched: /kv2/kv2_pkey/'a' -> NULL +fetched: /kv2/kv2_pkey/'a'/v -> 'b' +fetched: /kv2/kv2_pkey/'c' -> NULL +fetched: /kv2/kv2_pkey/'c'/v -> 'd' +fetched: /kv2/kv2_pkey/'e' -> NULL +fetched: /kv2/kv2_pkey/'e'/v -> 'f' +fetched: /kv2/kv2_pkey/'f' -> NULL +fetched: /kv2/kv2_pkey/'f'/v -> 'g' output row: ['a' 'b'] output row: ['c' 'd'] output row: ['e' 'f'] @@ -61,14 +61,14 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv2/primary/'a' -> NULL -fetched: /kv2/primary/'a'/v -> 'b' -fetched: /kv2/primary/'c' -> NULL -fetched: /kv2/primary/'c'/v -> 'd' -fetched: /kv2/primary/'e' -> NULL -fetched: /kv2/primary/'e'/v -> 'f' -fetched: /kv2/primary/'f' -> NULL -fetched: /kv2/primary/'f'/v -> 'g' +fetched: /kv2/kv2_pkey/'a' -> NULL +fetched: /kv2/kv2_pkey/'a'/v -> 'b' +fetched: /kv2/kv2_pkey/'c' -> NULL +fetched: /kv2/kv2_pkey/'c'/v -> 'd' +fetched: /kv2/kv2_pkey/'e' -> NULL +fetched: /kv2/kv2_pkey/'e'/v -> 'f' +fetched: /kv2/kv2_pkey/'f' -> NULL +fetched: /kv2/kv2_pkey/'f'/v -> 'g' output row: ['a' 'b'] output row: ['c' 'd'] output row: ['e' 'f'] @@ -111,7 +111,7 @@ vectorized: true │ └── • scan missing stats - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN locking strength: for update @@ -140,7 +140,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN locking strength: for update @@ -163,7 +163,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN locking strength: for update @@ -194,7 +194,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN locking strength: for update @@ -233,7 +233,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN # With the hint, we use a constrained scan. @@ -261,7 +261,7 @@ vectorized: true └── • index join │ columns: (x, y, z) │ estimated row count: 990 (missing stats) - │ table: xyz@primary + │ table: xyz@xyz_pkey │ key columns: x │ └── • scan @@ -301,8 +301,8 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /pks/primary/2/2 -> NULL -fetched: /pks/primary/2/2/v -> 3 +fetched: /pks/pks_pkey/2/2 -> NULL +fetched: /pks/pks_pkey/2/2/v -> 3 output row: [2 2 3] # Check that UPDATE properly supports ORDER BY (MySQL extension) @@ -333,7 +333,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Use case for UPDATE ... ORDER BY: renumbering a PK without unique violation. @@ -352,7 +352,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: [ - /2] limit: 1 locking strength: for update @@ -408,7 +408,7 @@ vectorized: true └── • scan columns: (a, b, c, rowid) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN locking strength: for update @@ -469,7 +469,7 @@ vectorized: true └── • index join │ columns: (a, b, c) │ estimated row count: 1,000 (missing stats) - │ table: t38799@primary + │ table: t38799@t38799_pkey │ key columns: a │ └── • scan @@ -498,7 +498,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: [/3 - /3] locking strength: for update @@ -515,7 +515,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: [/2 - /9] locking strength: for update @@ -534,7 +534,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN locking strength: for update @@ -561,7 +561,7 @@ vectorized: true └── • render │ └── • index join - │ table: kv3@primary + │ table: kv3@kv3_pkey │ └── • scan missing stats @@ -581,7 +581,7 @@ vectorized: true │ auto commit │ └── • index join - │ table: kv3@primary + │ table: kv3@kv3_pkey │ └── • scan missing stats @@ -607,7 +607,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: [/3 - /3] query T @@ -623,7 +623,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: [/2 - /9] query T @@ -641,7 +641,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -669,7 +669,7 @@ vectorized: true └── • scan columns: (x, y, z) estimated row count: 1,000 (missing stats) - table: xyz@primary + table: xyz@xyz_pkey spans: FULL SCAN query T @@ -687,7 +687,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: [ - /2] limit: 1 @@ -705,7 +705,7 @@ vectorized: true └── • render │ └── • index join - │ table: kv3@primary + │ table: kv3@kv3_pkey │ └── • scan missing stats @@ -724,7 +724,7 @@ vectorized: true │ auto commit │ └── • index join - │ table: kv3@primary + │ table: kv3@kv3_pkey │ └── • scan missing stats diff --git a/pkg/sql/opt/exec/execbuilder/testdata/update_from b/pkg/sql/opt/exec/execbuilder/testdata/update_from index 8c77bc971e9e..d3c3f01353ae 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/update_from +++ b/pkg/sql/opt/exec/execbuilder/testdata/update_from @@ -24,12 +24,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Update from another table. @@ -56,12 +56,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: new_abc@primary + table: new_abc@new_abc_pkey spans: FULL SCAN # Returning old values. @@ -93,12 +93,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Check if RETURNING * returns everything @@ -139,14 +139,14 @@ vectorized: true │ columns: (a, b, c) │ ordering: +a │ estimated row count: 1,000 (missing stats) - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • scan columns: (a, b, c) ordering: +a estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # Update values of table from values expression @@ -165,7 +165,7 @@ vectorized: true │ distinct on: a │ └── • lookup join - │ table: abc@primary + │ table: abc@abc_pkey │ equality: (column1) = (a) │ equality cols are key │ @@ -198,7 +198,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: ab@primary + │ table: ab@ab_pkey │ spans: FULL SCAN │ └── • hash join @@ -207,12 +207,12 @@ vectorized: true │ ├── • scan │ missing stats - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: ac@primary + table: ac@ac_pkey spans: FULL SCAN # Make sure UPDATE ... FROM works with LATERAL. @@ -244,7 +244,7 @@ vectorized: true │ ├── • scan │ missing stats - │ table: ab@primary + │ table: ab@ab_pkey │ spans: FULL SCAN │ └── • hash join @@ -253,10 +253,10 @@ vectorized: true │ ├── • scan │ missing stats - │ table: abc@primary + │ table: abc@abc_pkey │ spans: FULL SCAN │ └── • scan missing stats - table: ac@primary + table: ac@ac_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic index 60968d533f26..95ca696819e5 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/update_nonmetamorphic @@ -32,7 +32,7 @@ vectorized: true └── • scan columns: (a, c, d) estimated row count: 1,000 (missing stats) - table: tu@primary + table: tu@tu_pkey spans: FULL SCAN locking strength: for update @@ -44,9 +44,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE operation != 'dist sender send' ---- Scan /Table/53/{1-2} -fetched: /tu/primary/1 -> NULL -fetched: /tu/primary/1/b -> 2 -fetched: /tu/primary/1/c/d -> /3/4 +fetched: /tu/tu_pkey/1 -> NULL +fetched: /tu/tu_pkey/1/b -> 2 +fetched: /tu/tu_pkey/1/c/d -> /3/4 Put /Table/53/1/1/2/1 -> /TUPLE/3:3:Int/4/1:4:Int/4 fast path completed rows affected: 1 @@ -59,9 +59,9 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WHERE operation != 'dist sender send' ---- Scan /Table/53/{1-2} -fetched: /tu/primary/1 -> NULL -fetched: /tu/primary/1/b -> 2 -fetched: /tu/primary/1/c/d -> /4/4 +fetched: /tu/tu_pkey/1 -> NULL +fetched: /tu/tu_pkey/1/b -> 2 +fetched: /tu/tu_pkey/1/c/d -> /4/4 Del /Table/53/1/1/1/1 Del /Table/53/1/1/2/1 fast path completed @@ -91,7 +91,7 @@ vectorized: true │ └── • scan missing stats - table: tu@primary + table: tu@tu_pkey spans: FULL SCAN # Reset for rest of test. diff --git a/pkg/sql/opt/exec/execbuilder/testdata/upsert b/pkg/sql/opt/exec/execbuilder/testdata/upsert index 9f64b68fe589..e7e611206f15 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/upsert +++ b/pkg/sql/opt/exec/execbuilder/testdata/upsert @@ -32,7 +32,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Use explicit target columns (which can use blind KV Put). @@ -61,7 +61,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Add RETURNING clause (should still use blind KV Put). @@ -90,7 +90,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Use subset of explicit target columns (which cannot use blind KV Put). @@ -105,12 +105,12 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: kv(k, v) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: kv_pkey │ └── • lookup join (inner) │ columns: (k, v_default, k) │ estimated row count: 2 (missing stats) - │ table: kv@primary + │ table: kv@kv_pkey │ equality: (k) = (k) │ equality cols are key │ @@ -137,7 +137,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Use Upsert with indexed table, default columns, computed columns, and check @@ -165,7 +165,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: indexed(a, b, c, d) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: indexed_pkey │ └── • project │ columns: (column1, b_default, c_default, d_comp, a, b, c, d, b_default, c_default, d_comp, a, check1) @@ -198,7 +198,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1 (missing stats) - table: indexed@primary + table: indexed@indexed_pkey spans: /1/0 locking strength: for update @@ -213,7 +213,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: indexed(a, b, c, d) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: indexed_pkey │ └── • project │ columns: (column1, b_default, c_default, d_comp, a, b, c, d, b_default, c_default, d_comp, a, check1) @@ -234,7 +234,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (d_comp, b_default, c_default, column1, a, b, c, d) │ estimated row count: 4 (missing stats) - │ table: indexed@primary + │ table: indexed@indexed_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -270,7 +270,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: indexed(a, b, c, d) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: indexed_pkey │ └── • project │ columns: (column1, column2, column3, d_comp, a, b, c, d, upsert_b, upsert_c, upsert_d, a, check1) @@ -321,7 +321,7 @@ vectorized: true └── • scan columns: (a, b, c, d) estimated row count: 1 (missing stats) - table: indexed@primary + table: indexed@indexed_pkey spans: /1/0 locking strength: for update @@ -461,7 +461,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: abc@primary + table: abc@abc_pkey spans: FULL SCAN # ------------------------------------------------------------------------------ @@ -517,7 +517,7 @@ vectorized: true │ columns: () │ estimated row count: 0 (missing stats) │ into: table38627(a, b) -│ arbiter indexes: primary +│ arbiter indexes: table38627_pkey │ └── • project │ columns: (a, b, a, b, c, b, a) @@ -525,14 +525,14 @@ vectorized: true └── • lookup join (inner) │ columns: (a, b, a, b, c) │ estimated row count: 1 (missing stats) - │ table: table38627@primary + │ table: table38627@table38627_pkey │ equality: (a) = (a) │ equality cols are key │ └── • scan columns: (a, b) estimated row count: 1 (missing stats) - table: table38627@primary + table: table38627@table38627_pkey spans: /1/0 statement ok diff --git a/pkg/sql/opt/exec/execbuilder/testdata/upsert_nonmetamorphic b/pkg/sql/opt/exec/execbuilder/testdata/upsert_nonmetamorphic index 5c94e1321492..95cb6a83bfd0 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/upsert_nonmetamorphic +++ b/pkg/sql/opt/exec/execbuilder/testdata/upsert_nonmetamorphic @@ -66,7 +66,7 @@ SELECT operation, message FROM [SHOW KV TRACE FOR SESSION] WHERE operation != 'dist sender send' AND operation != 'kv.DistSender: sending partial batch' ---- colbatchscan Scan /Table/55/1/2/0 -colbatchscan fetched: /kv/primary/2/v -> /3 +colbatchscan fetched: /kv/kv_pkey/2/v -> /3 batch flow coordinator Put /Table/55/1/2/0 -> /TUPLE/2:2:Int/2 batch flow coordinator Del /Table/55/2/3/0 batch flow coordinator CPut /Table/55/2/2/0 -> /BYTES/0x8a (expecting does not exist) diff --git a/pkg/sql/opt/exec/execbuilder/testdata/vectorize_local b/pkg/sql/opt/exec/execbuilder/testdata/vectorize_local index a8461de3ef1b..634abeac5a7d 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/vectorize_local +++ b/pkg/sql/opt/exec/execbuilder/testdata/vectorize_local @@ -56,7 +56,7 @@ regions: KV rows read: 2,001 KV bytes read: 16 KiB missing stats - table: a@primary + table: a@a_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyMkcFqKjEUhvf3KQ5ndS_kYqaLLrKSigWx1qLipswiJgcbOpNMkzNUkXmsvkCfrMxEF6UIXZ7v_Pnz588J01uFCtfTh-lkAxruV8sFaBTog6VHXVNC9YwFlgKbGAylFGKPToNgZg-opEDnm5Z7XAo0IRKqE7LjilDhRu8qWpG2FEcSBVpi7arBVo-b6Godjyhw3WifFPxHgcuWFYwLFDjfAruaFMjPj5RnEzyTZxf8j1UM7wkiaavgRkh5NtgdmS64uIW5u0OBi-1kAompARNaz_CXDjxynv8pkEPKLCB6vSao9QFqqkM8gq6qYDSTVSChd99pNi-UILTc9G_p9UO4C8jxyk5gJufqEus9oSo68ft6V5Sa4BN9a_aas-xKgWT3lL8whTYaeorBDNfkcTmcG4ClxHlb5GHm86oruz9fAQAA__-9SrYw @@ -81,7 +81,7 @@ regions: │ KV contention time: 0µs │ KV rows read: 1 │ KV bytes read: 8 B -│ table: d@primary +│ table: d@d_pkey │ equality: (b) = (b) │ └── • scan @@ -185,7 +185,7 @@ regions: KV rows read: 2 KV bytes read: 16 B missing stats - table: d@primary + table: d@d_pkey spans: FULL SCAN · Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzkU8Fq20AQvfcrhjklZBtLcuhhIWAa3OK0tosdcik-rHenioi0q-yOqI3xZ_UH-mVFUkMjx3Fr6KHQm-bNe6OZN7MbDA85SpwPPw6vbkCfK3g3m45Bw2gyGc5gPJy9H8L1dDQBA9NJQ7gEc75EgdYZmqiCAsrPGONCYOmdphCcr6FNQxiZFcpIYGbLimt4IVA7Tyg3yBnnhBJv1DKnGSlDvhehQEOssrwpqweBNAqcl8oGCa9R4LRiCYMYBX64Bc4KkhB9_xbaWDvLZDlz9lnKu68BPCkjIWmR5ZrpEYrfwFsUOL69uoLAVIJ2lWU4oRX3MsunEqKmt5ZAdP8SoVArKKhwfg0qz51WTEZC1FRfKtZ3FMBVXNZT1PymrUcgwcVWYBv9NCuwSgllvBV_bujceSbfi7teDuIzFEgr0tVzgw61XefCQw5MRQkmC_dQBZXSX5gqOWaqp2eSdEczg9JnhfLrfaeS_Gen0n_R1F9eVtZ5Q55Mx8dFrfwdZc9mxuRTunaZJd_rdzeT0xc-GcRnp5c-S-_az84j_qfu8eKYe5xRKJ0NtGvh3spR7RuZlNo9BFd5TZ-8081v2nDa6BrAUOA2G7fByLapusGn4viguN8Rx7vi5AhxsivuHxRf7LS92L76EQAA__8gyhMy diff --git a/pkg/sql/opt/exec/execbuilder/testdata/virtual_columns b/pkg/sql/opt/exec/execbuilder/testdata/virtual_columns index 112e00373ec7..5aaa8493fdbe 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/virtual_columns +++ b/pkg/sql/opt/exec/execbuilder/testdata/virtual_columns @@ -30,7 +30,7 @@ t CREATE TABLE public.t ( a INT8 NOT NULL, b INT8 NULL, v INT8 NULL AS (a + b) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_pkey PRIMARY KEY (a ASC), FAMILY fam_0_a (a), FAMILY fam_1_b (b) ) @@ -44,7 +44,7 @@ t_idx CREATE TABLE public.t_idx ( c INT8 NULL, v INT8 NULL AS (a + b) VIRTUAL, w INT8 NULL AS (c + 1:::INT8) VIRTUAL, - CONSTRAINT "primary" PRIMARY KEY (a ASC), + CONSTRAINT t_idx_pkey PRIMARY KEY (a ASC), INDEX t_idx_v_idx (v ASC), UNIQUE INDEX t_idx_w_key (w ASC), FAMILY fam_0_a (a), @@ -66,7 +66,7 @@ TABLE t ├── tableoid oid [hidden] [system] ├── FAMILY fam_0_a (a) ├── FAMILY fam_1_b (b) - └── PRIMARY INDEX primary + └── PRIMARY INDEX t_pkey └── a int not null project ├── scan t @@ -92,7 +92,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -135,7 +135,7 @@ vectorized: true └── • index join │ columns: (a, b) │ estimated row count: 333 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ key columns: a │ └── • scan @@ -174,7 +174,7 @@ vectorized: true • lookup join (inner) │ columns: (a, b, v, x) │ estimated row count: 3 (missing stats) -│ table: t_idx@primary +│ table: t_idx@t_idx_pkey │ equality: (a) = (a) │ equality cols are key │ @@ -287,7 +287,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 333 (missing stats) - table: t@primary + table: t@t_pkey spans: /2- query T @@ -314,7 +314,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -339,7 +339,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 333 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: /2- query T @@ -368,7 +368,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 333 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: /2- query T @@ -393,7 +393,7 @@ vectorized: true └── • index join │ columns: (a, b, c) │ estimated row count: 333 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ key columns: a │ └── • scan @@ -424,7 +424,7 @@ vectorized: true └── • index join │ columns: (a, b, c) │ estimated row count: 333 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ key columns: a │ └── • scan @@ -468,7 +468,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN locking strength: for update @@ -510,7 +510,7 @@ vectorized: true └── • scan columns: (a, b) estimated row count: 1,000 (missing stats) - table: t@primary + table: t@t_pkey spans: FULL SCAN query T @@ -550,7 +550,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: FULL SCAN locking strength: for update @@ -593,7 +593,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: FULL SCAN locking strength: for update @@ -636,7 +636,7 @@ vectorized: true └── • index join │ columns: (a, b, c) │ estimated row count: 333 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ key columns: a │ └── • scan @@ -671,7 +671,7 @@ vectorized: true └── • scan columns: (a, c) estimated row count: 1 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: /2/0 /2/2/1 locking strength: for update @@ -712,7 +712,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: FULL SCAN locking strength: for update @@ -755,7 +755,7 @@ vectorized: true └── • scan columns: (a, b, c) estimated row count: 1,000 (missing stats) - table: t_idx@primary + table: t_idx@t_idx_pkey spans: FULL SCAN locking strength: for update @@ -810,12 +810,12 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: t(a, b, v) │ auto commit - │ arbiter indexes: primary + │ arbiter indexes: t_pkey │ └── • lookup join (anti) │ columns: (column1, column2, v_comp) │ estimated row count: 0 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (column1) = (a) │ equality cols are key │ @@ -845,7 +845,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: t(a, b, v) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: t_pkey │ └── • project │ columns: (column1, column2, v_comp, a, b, v, upsert_b, upsert_v, a) @@ -875,7 +875,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (v_comp, column1, column2, a, b) │ estimated row count: 3 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -908,7 +908,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: t(a, b, v) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: t_pkey │ └── • project │ columns: (column1, column2, v_comp, a, b, v, upsert_b, upsert_v, a) @@ -938,7 +938,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (v_comp, column1, column2, a, b) │ estimated row count: 3 (missing stats) - │ table: t@primary + │ table: t@t_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -971,7 +971,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: t_idx(a, b, c, v, w) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: t_idx_pkey │ └── • project │ columns: (column1, column2, column3, v_comp, w_comp, a, b, c, v, w, column2, column3, v_comp, w_comp, a) @@ -993,7 +993,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (v_comp, w_comp, column1, column2, column3, a, b, c) │ estimated row count: 4 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -1034,7 +1034,7 @@ vectorized: true │ estimated row count: 2 (missing stats) │ into: t_idx(a, b, c, v, w) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: t_idx_pkey │ └── • project │ columns: (column1, column2, column3, v_comp, w_comp, a, b, c, v, w, column2, column3, v_comp, w_comp, a) @@ -1071,7 +1071,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (v_comp, w_comp, column1, column2, column3, a, b, c) │ estimated row count: 2 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -1110,7 +1110,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: t_idx(a, b, c, v, w) │ auto commit - │ arbiter indexes: primary, t_idx_w_key + │ arbiter indexes: t_idx_pkey, t_idx_w_key │ └── • distinct │ columns: (column1, column2, column3, v_comp, w_comp) @@ -1121,7 +1121,7 @@ vectorized: true └── • lookup join (anti) │ columns: (v_comp, w_comp, column1, column2, column3) │ estimated row count: 0 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ equality: (column1) = (a) │ equality cols are key │ @@ -1138,7 +1138,7 @@ vectorized: true │ └── • scan │ columns: (c) │ estimated row count: 1,000 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ spans: FULL SCAN │ └── • render @@ -1174,7 +1174,7 @@ vectorized: true │ estimated row count: 0 (missing stats) │ into: t_idx(a, b, c, v, w) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: t_idx_pkey │ └── • project │ columns: (column1, column2, column3, v_comp, w_comp, a, c, w, upsert_c, upsert_w, a) @@ -1208,7 +1208,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (v_comp, w_comp, column1, column2, column3, a, c) │ estimated row count: 3 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -1246,7 +1246,7 @@ vectorized: true │ estimated row count: 3 (missing stats) │ into: t_idx(a, b, c, v, w) │ auto commit -│ arbiter indexes: primary +│ arbiter indexes: t_idx_pkey │ └── • project │ columns: (column1, column2, column3, v_comp, w_comp, a, b, c, v, w, upsert_c, upsert_w, a) @@ -1287,7 +1287,7 @@ vectorized: true └── • lookup join (left outer) │ columns: (v_comp, w_comp, column1, column2, column3, a, b, c) │ estimated row count: 3 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ equality: (column1) = (a) │ equality cols are key │ locking strength: for update @@ -1365,7 +1365,7 @@ vectorized: true │ └── • scan │ columns: (a, b, c) │ estimated row count: 1,000 (missing stats) - │ table: t_idx@primary + │ table: t_idx@t_idx_pkey │ spans: FULL SCAN │ └── • distinct @@ -1512,7 +1512,7 @@ vectorized: true • render │ └── • index join - │ table: t65343@primary + │ table: t65343@t65343_pkey │ └── • scan missing stats @@ -1528,7 +1528,7 @@ vectorized: true • render │ └── • index join - │ table: t65343@primary + │ table: t65343@t65343_pkey │ └── • scan missing stats @@ -1544,7 +1544,7 @@ vectorized: true • render │ └── • index join - │ table: t65343@primary + │ table: t65343@t65343_pkey │ └── • scan missing stats @@ -1560,7 +1560,7 @@ vectorized: true • render │ └── • index join - │ table: t65343@primary + │ table: t65343@t65343_pkey │ └── • scan missing stats diff --git a/pkg/sql/opt/exec/execbuilder/testdata/window b/pkg/sql/opt/exec/execbuilder/testdata/window index 9bb01c426a92..f540c0418c6c 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/window +++ b/pkg/sql/opt/exec/execbuilder/testdata/window @@ -31,23 +31,23 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY WHERE message LIKE 'fetched:%' OR message LIKE 'output row%' ORDER BY message LIKE 'fetched:%' DESC, ordinality ASC ---- -fetched: /kv/primary/1/v -> /2 -fetched: /kv/primary/1/d -> 1 -fetched: /kv/primary/1/s -> 'a' -fetched: /kv/primary/3/v -> /4 -fetched: /kv/primary/3/d -> 8 -fetched: /kv/primary/3/s -> 'a' -fetched: /kv/primary/5 -> NULL -fetched: /kv/primary/5/d -> -321 -fetched: /kv/primary/6/v -> /2 -fetched: /kv/primary/6/d -> 4.4 -fetched: /kv/primary/6/s -> 'b' -fetched: /kv/primary/7/v -> /2 -fetched: /kv/primary/7/d -> 7.9 -fetched: /kv/primary/7/s -> 'b' -fetched: /kv/primary/8/v -> /4 -fetched: /kv/primary/8/d -> 3 -fetched: /kv/primary/8/s -> 'A' +fetched: /kv/kv_pkey/1/v -> /2 +fetched: /kv/kv_pkey/1/d -> 1 +fetched: /kv/kv_pkey/1/s -> 'a' +fetched: /kv/kv_pkey/3/v -> /4 +fetched: /kv/kv_pkey/3/d -> 8 +fetched: /kv/kv_pkey/3/s -> 'a' +fetched: /kv/kv_pkey/5 -> NULL +fetched: /kv/kv_pkey/5/d -> -321 +fetched: /kv/kv_pkey/6/v -> /2 +fetched: /kv/kv_pkey/6/d -> 4.4 +fetched: /kv/kv_pkey/6/s -> 'b' +fetched: /kv/kv_pkey/7/v -> /2 +fetched: /kv/kv_pkey/7/d -> 7.9 +fetched: /kv/kv_pkey/7/s -> 'b' +fetched: /kv/kv_pkey/8/v -> /4 +fetched: /kv/kv_pkey/8/d -> 3 +fetched: /kv/kv_pkey/8/s -> 'A' output row: [5 NULL] output row: [1 3.4501207708330056852] output row: [6 3.4501207708330056852] @@ -78,7 +78,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -105,7 +105,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN statement error column "v" must appear in the GROUP BY clause or be used in an aggregate function @@ -124,7 +124,7 @@ vectorized: true │ └── • scan missing stats - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -155,7 +155,7 @@ vectorized: true └── • scan columns: (k int, v int, d decimal) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -190,7 +190,7 @@ vectorized: true └── • scan columns: (k int, v int, d decimal) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -217,7 +217,7 @@ vectorized: true └── • scan columns: (k int, v int, d decimal) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -255,7 +255,7 @@ vectorized: true └── • scan columns: (k int, v int, d decimal) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -299,7 +299,7 @@ vectorized: true └── • scan columns: (k int, v int, d decimal) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -332,7 +332,7 @@ vectorized: true └── • scan columns: (k int, v int, d decimal) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Partition @@ -367,7 +367,7 @@ vectorized: true └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN # Ordering @@ -392,7 +392,7 @@ vectorized: true └── • scan columns: (k, v) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN @@ -416,7 +416,7 @@ vectorized: true └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -437,7 +437,7 @@ vectorized: true └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -458,7 +458,7 @@ vectorized: true └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -509,7 +509,7 @@ vectorized: true └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -541,7 +541,7 @@ distribution: local │ └── • scan │ columns: (v, w) │ estimated row count: 1,000 (missing stats) -│ table: kv@primary +│ table: kv@kv_pkey │ spans: FULL SCAN │ └── • subquery @@ -557,7 +557,7 @@ distribution: local └── • scan columns: () estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN query T @@ -588,5 +588,5 @@ vectorized: true └── • scan columns: (k) estimated row count: 1,000 (missing stats) - table: kv@primary + table: kv@kv_pkey spans: FULL SCAN diff --git a/pkg/sql/opt/exec/execbuilder/testdata/with b/pkg/sql/opt/exec/execbuilder/testdata/with index 6fd5d9b60b77..417827f17f5d 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/with +++ b/pkg/sql/opt/exec/execbuilder/testdata/with @@ -42,7 +42,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: y@primary + table: y@y_pkey spans: FULL SCAN query T @@ -60,7 +60,7 @@ vectorized: true └── • scan columns: (a) estimated row count: 1,000 (missing stats) - table: y@primary + table: y@y_pkey spans: FULL SCAN query T @@ -126,13 +126,13 @@ vectorized: true ├── • scan │ columns: () │ estimated row count: 1,000 (missing stats) -│ table: table39010@primary +│ table: table39010@table39010_pkey │ spans: FULL SCAN │ └── • scan columns: (col) estimated row count: 1,000 (missing stats) - table: table39010@primary + table: table39010@table39010_pkey spans: FULL SCAN query T @@ -187,7 +187,7 @@ vectorized: true │ └── • scan missing stats - table: y@primary + table: y@y_pkey spans: FULL SCAN query T diff --git a/pkg/sql/partition_test.go b/pkg/sql/partition_test.go index da6a3d7b6a1d..e3bc6797bdbd 100644 --- a/pkg/sql/partition_test.go +++ b/pkg/sql/partition_test.go @@ -85,7 +85,7 @@ func TestRemovePartitioningOSS(t *testing.T) { exp := `CREATE TABLE public.kv ( k INT8 NOT NULL, v INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT kv_pkey PRIMARY KEY (k ASC), INDEX foo (v ASC) PARTITION BY RANGE (v) ( PARTITION p2 VALUES FROM (1) TO (2) ), @@ -121,7 +121,7 @@ func TestRemovePartitioningOSS(t *testing.T) { } sqlDB.Exec(t, `INSERT INTO system.zones VALUES ($1, $2)`, tableDesc.ID, zoneConfigBytes) for _, p := range []string{ - "PARTITION p1 OF INDEX t.public.kv@primary", + "PARTITION p1 OF INDEX t.public.kv@kv_pkey", "PARTITION p2 OF INDEX t.public.kv@foo", } { if exists := sqlutils.ZoneConfigExists(t, sqlDB, p); !exists { @@ -147,7 +147,7 @@ func TestRemovePartitioningOSS(t *testing.T) { exp = `CREATE TABLE public.kv ( k INT8 NOT NULL, v INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (k ASC), + CONSTRAINT kv_pkey PRIMARY KEY (k ASC), INDEX foo (v ASC), FAMILY fam_0_k (k), FAMILY fam_1_v (v) diff --git a/pkg/sql/schema_changer_test.go b/pkg/sql/schema_changer_test.go index 221489349109..2ae8c1862ba7 100644 --- a/pkg/sql/schema_changer_test.go +++ b/pkg/sql/schema_changer_test.go @@ -2297,7 +2297,7 @@ INSERT INTO t.test VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); x INT8 NOT NULL, y INT8 NOT NULL, z INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (x ASC), + CONSTRAINT test_pkey PRIMARY KEY (x ASC), INDEX i (z ASC), FAMILY "primary" (x, y, z) )` @@ -2318,7 +2318,7 @@ INSERT INTO t.test VALUES (1, 1, 1), (2, 2, 2), (3, 3, 3); x INT8 NOT NULL, y INT8 NOT NULL, z INT8 NULL, - CONSTRAINT "primary" PRIMARY KEY (y ASC), + CONSTRAINT test_pkey PRIMARY KEY (y ASC), UNIQUE INDEX test_x_key (x ASC), INDEX i (z ASC), FAMILY "primary" (x, y, z) @@ -2725,7 +2725,7 @@ UPDATE t.test SET z = NULL, a = $1, b = NULL, c = NULL, d = $1 WHERE y = $2`, 2* // Ensure that the count of rows is correct along both indexes. var count int - row := sqlDB.QueryRow(`SELECT count(*) FROM t.test@primary`) + row := sqlDB.QueryRow(`SELECT count(*) FROM t.test@test_pkey`) if err := row.Scan(&count); err != nil { t.Fatal(err) } diff --git a/pkg/sql/schemachanger/scbuild/testdata/alter_table b/pkg/sql/schemachanger/scbuild/testdata/alter_table index 7c7f062e3758..3067995297e1 100644 --- a/pkg/sql/schemachanger/scbuild/testdata/alter_table +++ b/pkg/sql/schemachanger/scbuild/testdata/alter_table @@ -44,7 +44,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN j INT version: 4 otherPrimaryIndexId: 1 tableId: 52 -- DROP PrimaryIndex:{DescID: 52, ElementName: "primary", IndexID: 1} +- DROP PrimaryIndex:{DescID: 52, ElementName: "foo_pkey", IndexID: 1} state: PUBLIC details: index: @@ -59,7 +59,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN j INT - 1 keyColumnNames: - i - name: primary + name: foo_pkey partitioning: {} sharded: {} unique: true @@ -110,7 +110,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN j INT DEFAULT 123 version: 4 otherPrimaryIndexId: 1 tableId: 52 -- DROP PrimaryIndex:{DescID: 52, ElementName: "primary", IndexID: 1} +- DROP PrimaryIndex:{DescID: 52, ElementName: "foo_pkey", IndexID: 1} state: PUBLIC details: index: @@ -125,7 +125,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN j INT DEFAULT 123 - 1 keyColumnNames: - i - name: primary + name: foo_pkey partitioning: {} sharded: {} unique: true @@ -193,7 +193,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN k INT DEFAULT 456; version: 4 otherPrimaryIndexId: 1 tableId: 52 -- DROP PrimaryIndex:{DescID: 52, ElementName: "primary", IndexID: 1} +- DROP PrimaryIndex:{DescID: 52, ElementName: "foo_pkey", IndexID: 1} state: PUBLIC details: index: @@ -208,7 +208,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN k INT DEFAULT 456; - 1 keyColumnNames: - i - name: primary + name: foo_pkey partitioning: {} sharded: {} unique: true @@ -259,7 +259,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN a INT AS (i+1) STORED version: 4 otherPrimaryIndexId: 1 tableId: 52 -- DROP PrimaryIndex:{DescID: 52, ElementName: "primary", IndexID: 1} +- DROP PrimaryIndex:{DescID: 52, ElementName: "foo_pkey", IndexID: 1} state: PUBLIC details: index: @@ -274,7 +274,7 @@ ALTER TABLE defaultdb.foo ADD COLUMN a INT AS (i+1) STORED - 1 keyColumnNames: - i - name: primary + name: foo_pkey partitioning: {} sharded: {} unique: true @@ -370,7 +370,7 @@ ALTER TABLE defaultdb.bar ADD COLUMN b INT; version: 4 otherPrimaryIndexId: 1 tableId: 53 -- DROP PrimaryIndex:{DescID: 52, ElementName: "primary", IndexID: 1} +- DROP PrimaryIndex:{DescID: 52, ElementName: "foo_pkey", IndexID: 1} state: PUBLIC details: index: @@ -385,14 +385,14 @@ ALTER TABLE defaultdb.bar ADD COLUMN b INT; - 1 keyColumnNames: - i - name: primary + name: foo_pkey partitioning: {} sharded: {} unique: true version: 4 otherPrimaryIndexId: 2 tableId: 52 -- DROP PrimaryIndex:{DescID: 53, ElementName: "primary", IndexID: 1} +- DROP PrimaryIndex:{DescID: 53, ElementName: "bar_pkey", IndexID: 1} state: PUBLIC details: index: @@ -407,7 +407,7 @@ ALTER TABLE defaultdb.bar ADD COLUMN b INT; - 2 keyColumnNames: - rowid - name: primary + name: bar_pkey partitioning: {} sharded: {} storeColumnIds: diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table b/pkg/sql/schemachanger/scplan/testdata/alter_table index 61524908463a..3ae279ffbaf9 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table @@ -84,7 +84,7 @@ Stage 5 - 1 KeyColumnNames: - i - Name: primary + Name: foo_pkey Unique: true Version: 4 TableID: 52 @@ -180,7 +180,7 @@ Stage 5 - 1 KeyColumnNames: - i - Name: primary + Name: foo_pkey Unique: true Version: 4 TableID: 52 @@ -296,7 +296,7 @@ Stage 5 - 1 KeyColumnNames: - i - Name: primary + Name: foo_pkey Unique: true Version: 4 TableID: 52 @@ -395,7 +395,7 @@ Stage 5 - 1 KeyColumnNames: - i - Name: primary + Name: foo_pkey Unique: true Version: 4 TableID: 52 @@ -540,7 +540,7 @@ Stage 5 - 1 KeyColumnNames: - i - Name: primary + Name: foo_pkey Unique: true Version: 4 TableID: 52 @@ -577,7 +577,7 @@ Stage 5 - 2 KeyColumnNames: - rowid - Name: primary + Name: bar_pkey StoreColumnIDs: - 1 StoreColumnNames: diff --git a/pkg/sql/show_test.go b/pkg/sql/show_test.go index cd17d8311a0d..3874d9ad212e 100644 --- a/pkg/sql/show_test.go +++ b/pkg/sql/show_test.go @@ -51,13 +51,13 @@ func TestShowCreateTable(t *testing.T) { FAMILY "primary" (i, v, t, rowid), FAMILY fam_1_s (s) )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL, s STRING NULL, v FLOAT8 NOT NULL, t TIMESTAMP NULL DEFAULT now():::TIMESTAMP, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, v, t, rowid), FAMILY fam_1_s (s), CONSTRAINT check_i CHECK (i > 0:::INT8) @@ -72,13 +72,13 @@ func TestShowCreateTable(t *testing.T) { FAMILY "primary" (i, v, t, rowid), FAMILY fam_1_s (s) )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL, s STRING NULL, v FLOAT8 NOT NULL, t TIMESTAMP NULL DEFAULT now():::TIMESTAMP, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, v, t, rowid), FAMILY fam_1_s (s), CONSTRAINT check_i CHECK (i > 0:::INT8) @@ -92,11 +92,11 @@ func TestShowCreateTable(t *testing.T) { FAMILY "primary" (i, rowid), FAMILY fam_1_s (s) )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL, s STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), FAMILY "primary" (i, rowid), FAMILY fam_1_s (s), CONSTRAINT ck CHECK (i > 0:::INT8) @@ -106,9 +106,9 @@ func TestShowCreateTable(t *testing.T) { CreateStatement: `CREATE TABLE %s ( i INT8 PRIMARY KEY )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NOT NULL, - CONSTRAINT "primary" PRIMARY KEY (i ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (i ASC), FAMILY "primary" (i) )`, }, @@ -120,13 +120,13 @@ func TestShowCreateTable(t *testing.T) { CREATE INDEX idx_if on %[1]s (f, i) STORING (s, d); CREATE UNIQUE INDEX on %[1]s (d); `, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL, f FLOAT8 NULL, s STRING NULL, d DATE NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), INDEX idx_if (f ASC, i ASC) STORING (s, d), UNIQUE INDEX %[1]s_d_key (d ASC), FAMILY "primary" (i, f, d, rowid), @@ -139,7 +139,7 @@ func TestShowCreateTable(t *testing.T) { CONSTRAINT "pri""mary" PRIMARY KEY ("te""st" ASC), FAMILY "primary" ("te""st") )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( "te""st" INT8 NOT NULL, CONSTRAINT "pri""mary" PRIMARY KEY ("te""st" ASC), FAMILY "primary" ("te""st") @@ -151,11 +151,11 @@ func TestShowCreateTable(t *testing.T) { b int8, index c(a asc, b desc) )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( a INT8 NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), INDEX c (a ASC, b DESC), FAMILY "primary" (a, b, rowid) )`, @@ -169,12 +169,12 @@ func TestShowCreateTable(t *testing.T) { FOREIGN KEY (i, j) REFERENCES items (a, b), k int REFERENCES items (c) )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL, j INT8 NULL, k INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_i_ref_items FOREIGN KEY (i, j) REFERENCES public.items(a, b), CONSTRAINT fk_k_ref_items FOREIGN KEY (k) REFERENCES public.items(c), FAMILY "primary" (i, j, k, rowid) @@ -189,12 +189,12 @@ func TestShowCreateTable(t *testing.T) { k int REFERENCES items (c) MATCH FULL, FOREIGN KEY (i, j) REFERENCES items (a, b) MATCH FULL )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL, j INT8 NULL, k INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_i_ref_items FOREIGN KEY (i, j) REFERENCES public.items(a, b) MATCH FULL, CONSTRAINT fk_k_ref_items FOREIGN KEY (k) REFERENCES public.items(c) MATCH FULL, FAMILY "primary" (i, j, k, rowid) @@ -207,10 +207,10 @@ func TestShowCreateTable(t *testing.T) { x INT8, CONSTRAINT fk_ref FOREIGN KEY (x) REFERENCES o.foo (x) )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( x INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_ref FOREIGN KEY (x) REFERENCES o.public.foo(x), FAMILY "primary" (x, rowid) )`, @@ -224,12 +224,12 @@ func TestShowCreateTable(t *testing.T) { FOREIGN KEY (i, j) REFERENCES items (a, b) ON DELETE SET DEFAULT, k int8 REFERENCES items (c) ON DELETE SET NULL )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL DEFAULT 123:::INT8, j INT8 NULL DEFAULT 123:::INT8, k INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_i_ref_items FOREIGN KEY (i, j) REFERENCES public.items(a, b) ON DELETE SET DEFAULT, CONSTRAINT fk_k_ref_items FOREIGN KEY (k) REFERENCES public.items(c) ON DELETE SET NULL, FAMILY "primary" (i, j, k, rowid) @@ -246,13 +246,13 @@ func TestShowCreateTable(t *testing.T) { FOREIGN KEY (i, j) REFERENCES items (a, b) MATCH SIMPLE ON DELETE SET DEFAULT, FOREIGN KEY (k, l) REFERENCES items (a, b) MATCH FULL ON UPDATE CASCADE )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( i INT8 NULL DEFAULT 1:::INT8, j INT8 NULL DEFAULT 2:::INT8, k INT8 NULL DEFAULT 3:::INT8, l INT8 NULL DEFAULT 4:::INT8, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), CONSTRAINT fk_i_ref_items FOREIGN KEY (i, j) REFERENCES public.items(a, b) ON DELETE SET DEFAULT, CONSTRAINT fk_k_ref_items FOREIGN KEY (k, l) REFERENCES public.items(a, b) MATCH FULL ON UPDATE CASCADE, FAMILY "primary" (i, j, k, l, rowid) @@ -264,11 +264,11 @@ func TestShowCreateTable(t *testing.T) { a INT, INDEX (a) USING HASH WITH BUCKET_COUNT = 8 )`, - Expect: `CREATE TABLE public.%s ( + Expect: `CREATE TABLE public.%[1]s ( a INT8 NULL, crdb_internal_a_shard_8 INT4 NOT VISIBLE NOT NULL AS (mod(fnv32(crdb_internal.datums_to_bytes(a)), 8:::INT8)) STORED, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), - CONSTRAINT "primary" PRIMARY KEY (rowid ASC), + CONSTRAINT %[1]s_pkey PRIMARY KEY (rowid ASC), INDEX t12_a_idx (a ASC) USING HASH WITH BUCKET_COUNT = 8, FAMILY "primary" (a, crdb_internal_a_shard_8, rowid), CONSTRAINT check_crdb_internal_a_shard_8 CHECK (crdb_internal_a_shard_8 IN (0:::INT8, 1:::INT8, 2:::INT8, 3:::INT8, 4:::INT8, 5:::INT8, 6:::INT8, 7:::INT8)) diff --git a/pkg/sql/span_builder_test.go b/pkg/sql/span_builder_test.go index a9cef0991178..e6241e2ac23b 100644 --- a/pkg/sql/span_builder_test.go +++ b/pkg/sql/span_builder_test.go @@ -47,21 +47,21 @@ func TestSpanBuilderCanSplitSpan(t *testing.T) { }{ { sql: "a INT, b INT, c INT, d INT, PRIMARY KEY (a, b), FAMILY (a, b, c), FAMILY (d)", - index: "primary", + index: "t_pkey", prefixLen: 2, numNeededFamilies: 1, canSplit: true, }, { sql: "a INT, b INT, c INT, d INT, PRIMARY KEY (a, b), FAMILY (a, b, c), FAMILY (d)", - index: "primary", + index: "t_pkey", prefixLen: 1, numNeededFamilies: 1, canSplit: false, }, { sql: "a INT, b INT, c INT, d INT, PRIMARY KEY (a, b), FAMILY (a, b, c, d)", - index: "primary", + index: "t_pkey", prefixLen: 2, numNeededFamilies: 1, canSplit: true, diff --git a/pkg/sql/testdata/explain_tree b/pkg/sql/testdata/explain_tree index 499549b58b3f..33f1cca79a5a 100644 --- a/pkg/sql/testdata/explain_tree +++ b/pkg/sql/testdata/explain_tree @@ -17,7 +17,7 @@ network usage: 0 B (0 messages) • scan columns: (oid int) estimated row count: 1 (missing stats) - table: orders@primary + table: orders@orders_pkey spans: /123/0 ---- ---- @@ -30,7 +30,7 @@ attrs: - key: missing stats value: "" - key: table - value: orders@primary + value: orders@orders_pkey - key: spans value: 1 span children: [] @@ -49,7 +49,7 @@ network usage: 0 B (0 messages) • scan columns: (cid int, date date, value decimal) estimated row count: 1,000 (missing stats) - table: orders@primary + table: orders@orders_pkey spans: FULL SCAN ---- ---- @@ -62,7 +62,7 @@ attrs: - key: missing stats value: "" - key: table - value: orders@primary + value: orders@orders_pkey - key: spans value: FULL SCAN children: [] @@ -111,7 +111,7 @@ network usage: 0 B (0 messages) └── • scan columns: (cid int, value decimal, date date) estimated row count: 1,000 (missing stats) - table: orders@primary + table: orders@orders_pkey spans: FULL SCAN ---- ---- @@ -142,7 +142,7 @@ children: - key: missing stats value: "" - key: table - value: orders@primary + value: orders@orders_pkey - key: spans value: FULL SCAN children: [] @@ -161,7 +161,7 @@ network usage: 0 B (0 messages) • scan columns: (value decimal) estimated row count: 1,000 (missing stats) - table: orders@primary + table: orders@orders_pkey spans: FULL SCAN ---- ---- @@ -174,7 +174,7 @@ attrs: - key: missing stats value: "" - key: table - value: orders@primary + value: orders@orders_pkey - key: spans value: FULL SCAN children: [] @@ -203,7 +203,7 @@ network usage: 0 B (0 messages) ├── • scan │ columns: (cid int, value decimal, date date) │ estimated row count: 1,000 (missing stats) - │ table: orders@primary + │ table: orders@orders_pkey │ spans: FULL SCAN │ └── • distinct @@ -214,7 +214,7 @@ network usage: 0 B (0 messages) └── • scan columns: (date date) estimated row count: 1,000 (missing stats) - table: orders@primary + table: orders@orders_pkey spans: FULL SCAN ---- ---- @@ -234,7 +234,7 @@ children: - key: missing stats value: "" - key: table - value: orders@primary + value: orders@orders_pkey - key: spans value: FULL SCAN children: [] @@ -248,7 +248,7 @@ children: - key: missing stats value: "" - key: table - value: orders@primary + value: orders@orders_pkey - key: spans value: FULL SCAN children: [] @@ -293,7 +293,7 @@ network usage: 0 B (0 messages) │ └── • scan │ columns: (id int, title string) │ estimated row count: 1,000 (missing stats) -│ table: movies@primary +│ table: movies@movies_pkey │ spans: FULL SCAN │ └── • subquery @@ -313,7 +313,7 @@ network usage: 0 B (0 messages) └── • scan columns: (name string) estimated row count: 1,000 (missing stats) - table: actors@primary + table: actors@actors_pkey spans: FULL SCAN ---- ---- @@ -332,7 +332,7 @@ children: - key: missing stats value: "" - key: table - value: movies@primary + value: movies@movies_pkey - key: spans value: FULL SCAN children: [] @@ -360,7 +360,7 @@ children: - key: missing stats value: "" - key: table - value: actors@primary + value: actors@actors_pkey - key: spans value: FULL SCAN children: [] diff --git a/pkg/sql/testdata/savepoints b/pkg/sql/testdata/savepoints index e89e0f2d3c71..79ca41963c86 100644 --- a/pkg/sql/testdata/savepoints +++ b/pkg/sql/testdata/savepoints @@ -218,7 +218,7 @@ COMMIT -- NoTxn -> Open #..... (none) 2: SAVEPOINT foo -- 0 rows -- Open -> Open ##.... foo -3: SELECT * FROM t WHERE x = 1 FOR UPDATE NOWAIT -- pq: could not obtain lock on row (x)=(1) in t@primary +3: SELECT * FROM t WHERE x = 1 FOR UPDATE NOWAIT -- pq: could not obtain lock on row (x)=(1) in t@t_pkey -- Open -> Aborted XXXXXX foo 4: ROLLBACK TO SAVEPOINT foo -- 0 rows -- Aborted -> Open ##.... foo @@ -278,7 +278,7 @@ SET lock_timeout = 0 -- NoTxn -> Open ##...... (none) 3: SAVEPOINT foo -- 0 rows -- Open -> Open ###..... foo -4: SELECT * FROM t WHERE x = 1 FOR UPDATE -- pq: canceling statement due to lock timeout on row (x)=(1) in t@primary +4: SELECT * FROM t WHERE x = 1 FOR UPDATE -- pq: canceling statement due to lock timeout on row (x)=(1) in t@t_pkey -- Open -> Aborted XXXXXXXX foo 5: ROLLBACK TO SAVEPOINT foo -- 0 rows -- Aborted -> Open ###..... foo diff --git a/pkg/sql/testdata/telemetry/error b/pkg/sql/testdata/telemetry/error index 060204889d10..a72620922858 100644 --- a/pkg/sql/testdata/telemetry/error +++ b/pkg/sql/testdata/telemetry/error @@ -44,7 +44,7 @@ sql.schema.validation_errors.read.self.type feature-usage CREATE TABLE t (x INT PRIMARY KEY); BEGIN; -ALTER TABLE t DROP CONSTRAINT "primary"; +ALTER TABLE t DROP CONSTRAINT t_pkey; COMMIT; ---- error: pq: relation "t" (56): unimplemented: primary key dropped without subsequent addition of new primary key in same transaction diff --git a/pkg/sql/testdata/telemetry/planning b/pkg/sql/testdata/telemetry/planning index 7714d8b243b7..891af9405c8c 100644 --- a/pkg/sql/testdata/telemetry/planning +++ b/pkg/sql/testdata/telemetry/planning @@ -74,19 +74,19 @@ SELECT a FROM (VALUES ('{"a": "b"}'::jsonb)) AS a(z) INNER INVERTED JOIN y ON b sql.plan.hints.inverted-join feature-usage -SELECT * FROM x@primary +SELECT * FROM x@x_pkey ---- sql.plan.hints.index sql.plan.hints.index.select feature-usage -UPDATE x@primary SET a=1 WHERE a>1 +UPDATE x@x_pkey SET a=1 WHERE a>1 ---- sql.plan.hints.index sql.plan.hints.index.update feature-usage -DELETE FROM x@primary WHERE a>1 +DELETE FROM x@x_pkey WHERE a>1 ---- sql.plan.hints.index sql.plan.hints.index.delete diff --git a/pkg/sql/tests/hash_sharded_test.go b/pkg/sql/tests/hash_sharded_test.go index d5c91487565b..3c6541a8023a 100644 --- a/pkg/sql/tests/hash_sharded_test.go +++ b/pkg/sql/tests/hash_sharded_test.go @@ -108,8 +108,8 @@ func TestBasicHashShardedIndexes(t *testing.T) { t.Fatal(err) } tableDesc := catalogkv.TestingGetTableDescriptor(kvDB, keys.SystemSQLCodec, `d`, `kv_primary`) - verifyTableDescriptorState(t, tableDesc, "primary" /* shardedIndexName */) - shardColID := getShardColumnID(t, tableDesc, "primary" /* shardedIndexName */) + verifyTableDescriptorState(t, tableDesc, "kv_primary_pkey" /* shardedIndexName */) + shardColID := getShardColumnID(t, tableDesc, "kv_primary_pkey" /* shardedIndexName */) // Ensure that secondary indexes on table `kv` have the shard column in their // `KeySuffixColumnIDs` field so they can reconstruct the sharded primary key.