Skip to content

Commit

Permalink
Merge #76961 #76963
Browse files Browse the repository at this point in the history
76961: opt: remove redundant arbiter indexes r=mgartner a=mgartner

We select all unique indexes and unique constraints as arbiters for
`INSERT .. ON CONFLICT` statements without explicit conflict columns or
constraints. In some cases, unique constraint arbiters make unique index
arbiters redundant, which results in query plans that perform
unnecessary work to check for conflicts. Most notably, redundant unique
indexes are chosen as arbiters for both partitioned and hash-sharded
indexes which synthesize `UNIQUE WITHOUT INDEX` constraints.

For example, consider the table and statement which mimics a
simplified hash-sharded index:

    CREATE TABLE t (
        a INT,
        shard_a INT,
        UNIQUE INDEX shard_a_a_key (shard_a, a),
        UNIQUE WITHOUT INDEX a_key (a)
    )

    INSERT INTO t VALUES (1, 2) ON CONFLICT DO NOTHING

There is no need to use both `shard_a_a_key` and `a_key` as arbiters for
the `INSERT` statement because any conflict in `shard_a_a_key` will also
be a conflict in `a_key`. Only `a_key` is required to be an arbiter.

This commit removes these redundant arbiter indexes, which improves
query plans.

Fixes #75498

Release note (performance improvement): The optimizer produces more
efficient query plans for `INSERT .. ON CONFLICT` statements that do not
have explicit conflict columns or constraints and are performed on
partitioned tables.

76963: sql: use IndexFetchSpec in JoinReader r=yuzefovich a=RaduBerinde

#### descpb: add IndexID to IndexFetchSpec

Release note: None

#### span: make Builder and Splitter without descriptors

Allow creation of span.Builder and span.Splitter without table and
index descriptors.

Release note: None

#### rowexec: move eqCols to hashjoiner

This commit moves eqCols from joinerBase to hashJoiner because that is
the only processor that uses them. This simplifies the initialization
code for other processors.

Release note: None

#### sql: use IndexFetchSpec in JoinReader

This commit changes `JoinReader` to use an `IndexFetchSpec` (plus a
list of family IDs for span splitting) instead of table and index
descriptors.

As part of making this switch, the "internal schema" of the processor
no longer contains all table columns; instead it contains the specific
`FetchedColumns` in the spec. This simplifies both planning and
execution code.

Release note: None

Co-authored-by: Marcus Gartner <[email protected]>
Co-authored-by: Radu Berinde <[email protected]>
  • Loading branch information
3 people committed Feb 25, 2022
3 parents 978744d + 8122043 + 170d49c commit 94e64ce
Show file tree
Hide file tree
Showing 73 changed files with 1,863 additions and 1,524 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ vectorized: true
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#eJysk9tO20AQhu_7FKO54aCNEh8gwRKSEU1pUBpoQtVK3Sgy3glsSXbd3bWaCuWqz9b3quyFUqMGCdoLew8z_8x8v-xbtF8XmGD_0_nwaDCC7deDycXk_XAHJv1h__gCtBFkZlIwKIxe6rudzAmOJn4z-ybdtS7drE64j-6CkDbXpXLNRJ8Fb8Zn73xtC6dng5GvbuHDZDA6ge37Xjvw8W1_3P89BRzC1kFM8WUv7rZ683DeirN8r9WL5kFrPw7EPkVi3g27W8hQaUGjbEkWk88Y45RhYXRO1mpTXd3WCQOxwqTDUKqidNX1lGGuDWFyi066BWGCF9nlgsaUCTLtDjIU5DK5qMt6gtQvs-KGviPDY70ol8omDe9kTg8WIsNJkVUpbY4pxzZHzlcHMecrql6XvRPOV715-_TnD85X80BwvgqEOqwO3S2O7Q5kSkAA2l2TwemaoS7dA4J12RVhEqzZyzCD_49ZAXVehLoRL9yI90BlychsAaWqpyTRAJuu_-LDSLd00Q6bDgzlUjoINo7SeY7Tp1qqO6OjZhv_F6R-uTd6qPVNWcAXLRVolUBaicakBJkE0oBBGjFIw-rZTfc2jhg9Z8Qx2UIrS4_s2gQ_ZUjiirz1Vpcmp3Oj87qNP57VuvpCkHU-GvrDQNWh-mv9Uxz8izh8Uhw1xJ3H4uhJcfxIPF2_-hUAAP__SGy-Yw==
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9tO20wQx--_pxjNDQdtlPgACZaQjPhSGpQGmlC1UjeKjHcCW5Jdd3etpkK56rP1vSp7SUNQgwTthb2n-e_M72_PPdqvM0yw--myf9IbwO7_vdHV6H1_D0bdfvf0CrQRZCZSMCiMnuuHmcwJTkZ-Mvkm3a0u3aQOWJ3ug5A216Vym4E-Ct4ML975uy2cX_QG_nYLH0a9wRnsrnLtwce33WH3dxVwDDtHMcXXnbjd6EzDaSPO8oNGJ5oGjcM4EIcUiWk7bO8gQ6UFDbI5WUw-Y4xjhoXROVmrTbV1Xwf0xAKTFkOpitJV22OGuTaEyT066WaECV5l1zMaUibINFvIUJDL5Ky-1hOkfpgUd_QdGZ7qWTlXNtnwTua0thAZjoqsCmlyTDk2OXK-OIo5X1D1uu6ccb7oTJvnP39wvpgGgvNFINRxtWjvcGy2IFMCAtDulgyOlwx16dYI1mU3hEmwZK_DDP49ZgXUehXqVrxwK96aypKR2QxKVVdJYgNsvPyDDwPd0EUz3HSgL-fSQbC1lNZLnD7XUj0YHW2m8V2Q-mFldF_ru7KAL1oq0CqBNHrs_rotVw2HDIekBJkE0oBBGjFIw-rZTw-2AkQvARiSLbSy9MTMbdaMGZK4If9hrC5NTpdG53Uav7yodfWGIOv8aegXPVUf1f_yY3HwN-LwWXG0IW49FUfPiuMn4vHyv18BAAD__47ayRw=

query T nodeidx=3
USE multi_region_test_db; EXPLAIN (DISTSQL) SELECT
Expand Down Expand Up @@ -402,7 +402,7 @@ vectorized: true
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#eJysU19v0zAQf-dTWPcymNw1_9Z2kSZ5GgU6lXa0k0DCVZXF182stYPtQN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K12pSm-ypgIAqIPQpSZbkrzTMKqTYI8T046ZYIMVwl10ucYCLQtD2gINAlclldWzNl9TLP7vAbUDjXy3ylbNwoqkyRklIRUJhmSeluc2Ac2hw4L04izgss_657rzkveov2xY_vnBcLX3Be-EKdlofuAYe2RxIliE-0u0UDszUFnbtH-tYlNwixv6Yvk-j_XYmlGO9FMndKC3ZKe1Rk0chkSXJVMUTREDVb_6YGI93SWTtoqh_KlXTE30nFe06VB-oLGofiQkuFph02U9WTwOplXtZxLkUBdAvrF5khrLMdE1ZeMM5dTJhPWUBZSFm0k2n4HKYlw007RPtYbtphqPVdnpFPWiqiVUxYCRqPCOs2yW7b5vF1eXg3tp0zQSXQVJoIO6aEBeXvkHV2Koueo2yCNtPK4pN-2PV1ZxRQ3GDdW1bnJsVLo9MqTX0cV7jKINC62hvUh4GqXNUo_gr2_wQc7AWHDbD3FBzuBUf7wdFe8PET8Gz9z88AAAD__y7iIUk=

# Regression test for #74890. Code should not panic due to distribution already
# provided by input.
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,56 @@ ORDER BY pk LIMIT 5] OFFSET 2
spans: /"\xc0"-/"\xc0"/PrefixEnd
limit: 5

# Test that the synthesized UNIQUE WITHOUT INDEX constraints do not cause
# lookups into redundant arbiters.
query T
SELECT * FROM [
EXPLAIN INSERT INTO regional_by_row_table (crdb_region, pk, pk2, a, b)
VALUES ('ca-central-1', 7, 7, 8, 9) ON CONFLICT DO NOTHING
] OFFSET 2
----
·
• insert
│ into: regional_by_row_table(pk, pk2, a, b, j, crdb_region)
│ auto commit
│ arbiter constraints: regional_by_row_table_pkey, regional_by_row_table_b_key, uniq_idx
└── • render
└── • distinct
│ distinct on: arbiter_uniq_idx_distinct
│ nulls are distinct
└── • render
└── • lookup join (anti)
│ table: regional_by_row_table@uniq_idx (partial index)
│ lookup condition: (column4 = a) AND (crdb_region IN ('ap-southeast-2', 'ca-central-1', 'us-east-1'))
│ pred: column5 > 0
└── • lookup join (anti)
│ table: regional_by_row_table@regional_by_row_table_b_key
│ equality cols are key
│ lookup condition: (column5 = b) AND (crdb_region IN ('ap-southeast-2', 'ca-central-1', 'us-east-1'))
└── • cross join (anti)
├── • values
│ size: 6 columns, 1 row
└── • union all
│ limit: 1
├── • scan
│ missing stats
│ table: regional_by_row_table@regional_by_row_table_pkey
│ spans: [/'ap-southeast-2'/7 - /'ap-southeast-2'/7]
└── • scan
missing stats
table: regional_by_row_table@regional_by_row_table_pkey
spans: [/'ca-central-1'/7 - /'ca-central-1'/7] [/'us-east-1'/7 - /'us-east-1'/7]

# Tests for locality optimized search.

# Split the table into 3 regions and change the leaseholders to be "local"
Expand Down Expand Up @@ -624,7 +674,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY
Scan /Table/112/1/"@"/10/0, /Table/112/1/"\x80"/10/0, /Table/112/1/"\xc0"/10/0
fetched: /child/child_pkey/?/10/c_p_id -> /10
Scan /Table/111/1/"@"/10/0, /Table/111/1/"\x80"/10/0, /Table/111/1/"\xc0"/10/0
fetched: /parent/parent_pkey/?/? -> <undecoded>
fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> <undecoded>

# Semi join with locality optimized search disabled.
query T
Expand Down Expand Up @@ -654,7 +704,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY
Scan /Table/112/1/"@"/10/0, /Table/112/1/"\x80"/10/0, /Table/112/1/"\xc0"/10/0
fetched: /child/child_pkey/?/10/c_p_id -> /10
Scan /Table/111/1/"@"/10/0, /Table/111/1/"\x80"/10/0, /Table/111/1/"\xc0"/10/0
fetched: /parent/parent_pkey/?/? -> <undecoded>
fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> <undecoded>
output row: [10 10]

# Inner join with locality optimized search disabled.
Expand Down Expand Up @@ -750,7 +800,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE NOT EXISTS (SELECT *
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#eJy0k2GLm04Qxt__P8Uwb5L82ZLVWHosBAx3hnpYvSZCDy4SrA539oxr3RVyhHz3oqbcGZrQu7Zv1J2dx_09w7M7VN9zFLh0POcyhP9hvgg-wZ1ze-PNXB-GV-4yXH72RtBvSB6yPIUvH52FA0M_CMG5bRph2G8r44oKfegr11kKU0jWzcdoBDP_CoZJVzT4KIJgPl86IZjIsJAp-fGGFIo7NDBiWFYyIaVk1ZR2bYObblFwhllR1ropRwwTWRGKHepM54QCw_hrTguKU6rGHBmmpOMsb3_berDb57p8pCdkeCnzelMoAQ0WO6Aiw2UZN9XxCler7QVf4djgYw5xkYIBUj9QhdGeoaz1M4nS8T2hMPbsbbTGX6C1D6Qn6cyTdM9QiqoszqEuZJVSRWmPK9r_woYv38lybPYNeNkm02CcROGvGdS1zIrDnCb9Y8KnkgR4zjyEmR-6cB24PjLskmh3r58D9KR8rEv4JrMCZCFgaE9gCrZ5yKZtwRS2A4sPhBC2wbnBP4yQYVBrAbbBbPOkmckbzVj_0kxzn7eDi5d2GGwHSc_fbxq0XmNwQaqUhaKj5JzKQcSQ0nvqUqhkXSV0U8mkPaZbBq2uLaSkdLdrdgu3aLfae_dSbPyJ2DwrnvTE_Fg8OSu2zouts-L3R-Jo_9-PAAAA__9jBNRX
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy0k2Fro04Qxt__P8Uwb5L82SOr8biyULC0hrN4ppcIV2gkWHdovdpdb1VIKfnuh5qjMVwCzd29UXd2Hvf3DM--YvkjR4ELL_AuI_gfpvPZF7jzbm-CCz-E4ZW_iBZfgxH0G9LHLJfw7bM392AYziLwbptGGPbbisSQqrZ9xSqTcA7pqvkYjeAivIJh2hUtPophNp0uvAhsZKi0pDB5phLFHVoYMyyMTqkstWlKr22DL9coOMNMFXXVlGOGqTaE4hWrrMoJBUbJfU5zSiSZMUeGkqoky9vfth7c9rkqnugFGV7qvH5WpYAGi21RkeGiSJrqeInL5fqML3Fs8TGHREmwQFePZDDeMNR19UZSVskDobA27DRa6y_QulvSg3T2Qbo3qJJMluRQK20kGZI9rnjzGxuh_qCLsd03EGTPWQXWQRT-nkFd60xt5zTpHxO9FCQg8KYRXISRD9czP0SGXRLd7vVrgIHWT3UB33WmQCsBQ3cC5-Da22y6DpzDeuDwgRDCtTi3-KfR7tyLbu5G3q8MPWRaHTQ3OdGc8y_NNfd7PTjbtcdgPUh7fk807LzH8JzKQquS9pJ1KCcxQ5IP1KW01LVJ6cbotD2mW85aXVuQVFbdrt0tfNVutfdyV2z9idg-Kp70xHxfPDkqdo6LnaPij3viePPfzwAAAP__dhHiVw==

statement ok
SET vectorize=on
Expand Down Expand Up @@ -783,7 +833,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY
Scan /Table/112/1/"@"/10/0
fetched: /child/child_pkey/?/10/c_p_id -> /10
Scan /Table/111/1/"@"/10/0
fetched: /parent/parent_pkey/?/? -> <undecoded>
fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> <undecoded>

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
Expand All @@ -801,7 +851,7 @@ Scan /Table/112/1/"\x80"/20/0, /Table/112/1/"\xc0"/20/0
fetched: /child/child_pkey/?/20/c_p_id -> /20
Scan /Table/111/1/"@"/20/0
Scan /Table/111/1/"\x80"/20/0, /Table/111/1/"\xc0"/20/0
fetched: /parent/parent_pkey/?/? -> <undecoded>
fetched: /parent/parent_pkey/'ca-central-1'/20 -> <undecoded>

# Semi join with locality optimized search enabled.
query T
Expand All @@ -827,7 +877,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE EXISTS (SELECT * FROM
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#eJysk1Fr2z4Uxd__n-JyX5L80YjsFFYEAZfWYS5u0sWGFRoTPPvSenUkT5IhJeS7D9sZrcPS0W0vtnV1jvTT0fUOzfcSBUZ-6F_G8D_MlosbuPfvbsOLYA7DqyCKo8_hCPqC7LEoc_jyyV_64N81Ghj2FVWqSdqDpFoXOUwhWzcfI7iYX8Ew62oOHyWwmM0iPwYXGUqV0zzdkEFxjw4mDCutMjJG6aa0awVBvkXBGRayqm1TThhmShOKHdrCloQC4_RrSUtKc9JjjgxzsmlRtsu29F77XFdP9IwML1VZb6QR0GCxAykyjKq0qY5XuFptz_kKxw4fc0hlDg4o-0gakz1DVdsXEmPTB0Lh7Nmf0Tr_gNY7kJ6kc0_SvUAZ0kVaQi2VzklT3uNK9r84xlx9UNXY7R8gLDaFBeckCn9PUNeqkIecJv1t4ueKBIT-LIbIvwngehHMkWHXiF73-hlgqNRTXcE3VUhQUsDQm8AUPPfQm94ZTGE7OOMDIYTncO7wjyNkuKSNsgTlb93Nr7MdnL_2M9gOst6CzYqL2grwHOa5J-OZvCeeJZlKSUNHV3Uq-IQh5Q_UXbtRtc7oVqus3aYbLlpfW8jJ2G7W7QaBbKfaRn9tdv7G7L5pnvTM_Ng8edN8dmRO9v_9CAAA__-CWJEk
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk1Fr2zAQx9_3KY57STI0IjuBFUHApXWYi5t0sWGFxgTXOlKvjuTJNqSEfPdhO6NxWDq67cW2TveXfve_8w6LHxkKDFzfvQrhI0wX81t4cO_v_EtvBv1rLwiDr_4AugnJU5pJ-PbFXbjg3tc50O9m5LEhVR5S8lUqYQLJqv4YwOXsGvpJG7P4IIL5dBq4IdjIUGlJs3hDBYoHtDBimBudUFFoU4d2TYIntyg4w1TlVVmHI4aJNoRih2VaZoQCw_gxowXFksyQI0NJZZxmzbENvdM8V_kzvSDDK51VG1UIqLHYgRQZBnlcR4dLXC63F3yJQ4sPOcRKggW6fCKD0Z6hrspXkqKM14TC2rO_o7X-A61zID1LZ5-le4UqyKRxBpXSRpIh2eGK9r8pY6Y_6Xxodwvw001agnUWhb_HqBudqoNPo-414UtOAnx3GkLg3npwM_dmyLAdRKd9_TLQ1_q5yuG7ThVoJaDvjGACjn2YTWcME9j2xrwnhHAszi3-eYAMF7TRJUH2R3X962x7F8d6Btte0jlwcNzJvO2kkY8rQ-tUq7N2jd5j14KKXKuCTlp3rhERQ5Jraseg0JVJ6M7opLmmXc4bXROQVJTtrt0uPNVsNYN_LLb-RWy_KR51xPxUPHpTPD4RR_sPPwMAAP__OaSYJA==

statement ok
SET vectorize=on
Expand Down Expand Up @@ -859,7 +909,7 @@ SELECT message FROM [SHOW KV TRACE FOR SESSION] WITH ORDINALITY
Scan /Table/112/1/"@"/10/0
fetched: /child/child_pkey/?/10/c_p_id -> /10
Scan /Table/111/1/"@"/10/0
fetched: /parent/parent_pkey/?/? -> <undecoded>
fetched: /parent/parent_pkey/'ap-southeast-2'/10 -> <undecoded>
output row: [10 10]

statement ok
Expand All @@ -878,7 +928,7 @@ Scan /Table/112/1/"\x80"/20/0, /Table/112/1/"\xc0"/20/0
fetched: /child/child_pkey/?/20/c_p_id -> /20
Scan /Table/111/1/"@"/20/0
Scan /Table/111/1/"\x80"/20/0, /Table/111/1/"\xc0"/20/0
fetched: /parent/parent_pkey/?/? -> <undecoded>
fetched: /parent/parent_pkey/'ca-central-1'/20 -> <undecoded>
output row: [20 20]

# Inner join with locality optimized search enabled.
Expand All @@ -905,7 +955,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child INNER JOIN parent ON p_id =
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#eJysk9Fq2zAUhu_3FIdzk2RoRLYDK4KAS-swl8zunMAGjQmefWi9OpYnyZA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Bt8dwnV0Cxf-JYxhM7jkAyGE73Du8PdDZJjQWluC8rf0_nfYDK6OeQabQd7bcHhcsqormZGPS0OrQitkGDdWgO8w32W-dzZP3lvylFBdaVXTSc3OVSBlSHJFXf1r3Zic7o3O22O6YdxybUBSbbtZtxuEqp1qO_4Ydv4Gdl-FvR7MT2HvVfjyBE53__0IAAD__5JOkJo=

statement ok
SET vectorize=on
Expand Down Expand Up @@ -983,7 +1033,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child LEFT JOIN parent ON p_id =
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#eJysk1Fr2zAUhd_3Ky73Je3QiGwXVgQBl9ZhKZ7dOR4bNCZ49qX16lieJENKyH8fkTNah6Wj215s60jn6tPR9Qb1jxoFzoMwuEzhLUyT-CPcBl9vwotZBCdXs3k6_xSewnBBcV_VJYTBNIXreBZBmytqDMQRtMuqhAkUS_vx5UOQBFD0msMziKfTeZCCiwwbWVKUr0ijuEUHM4atkgVpLdVO2tgFs3KNgjOsmrYzOzljWEhFKDZoKlMTCkzzbzUllJekxhwZlmTyqrZlLadvn8v2gR6R4aWsu1WjhaVie1BkOG_znTpe4GKxPucLHDt8zCFvSnBAmntSmG0Zys48kWiT3xEKZ8v-jtb5D7T-nvQonXuU7glKk6ryGrpGqpIUlQOubPubY0TynWzH7vAAYbWqDDhHUfhrgrqWVbPPyRtukz62JPruiz-nQWJ7EBn2Xej3r18JhlI-dC18l1UDshFw4nswAd89hYvoCk78M5jAenTGR0II3-Hc4e9PkWFCK2kI6j-6d3_JenT-3M9gPSoGBXcV484I8B3mu8z3jkbkvSaihHQrG00H13Us_IwhlXfUX72WnSroRsnCbtMPY-uzQkna9LNuP5g1dso2-3Oz8y9m90WzNzDzQ7P3ovnswJxt3_wMAAD__4udjM4=
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk2Fr2zwQgL-_v-K4L2leNCI7hRVBwaV1WIpnd47HBo0JrnW0Xh3Jk2VIKfnvI3JH67B0dNuXxDrpkR7dnR6x_V6jwEUYhecZ_A-zNPkI1-HXq-hsHsPRxXyRLT5FYxguKO-qWkIUzjK4TOYxNIUhZSGJoVlVEk6hXLmPLx_CNISyj3k8h2Q2W4QZ-MhQaUlxsaYWxTV6mDNsjC6pbbXZhR7dgrncoOAMK9V0dhfOGZbaEIpHtJWtCQVmxU1NKRWSzIQjQ0m2qGq3rfMM3O-quacHZHiu626tWuGs2JMoMlw0xS46WeJyuTnhS5x4fMKhUBI80PaODOZbhrqzzyatLW4Jhbdlf2br_QPb4Mn0oJ1_0O5ZqiVTFTV0ShtJhuTAK9_-4hqxfqebiT-8QFStKwveQRX-lkRd6ko95Wk6PCZ7aEj03Zd8zsLU9SAy7Lsw6P9-ZjDS-r5r4JuuFGgl4CiYwikE_hjO4gs4Co7hFDajYz4SQgQe5x5_P0aGKa21Jah_S-9eyWZ08pJnsBmVgw3HL0vZ9KU08mZl6LbSChkmnRUQeCzwWTA9mL_pW_KXUtto1dJeLQ9VJmdI8pb6vmh1Z0q6Mrp0x_TDxHEuIKm1_azfD-bKTbmX8BL2_gb2X4WnA5jvw9NX4eM9ON_-9yMAAP__uiqW3w==

statement ok
SET vectorize=on
Expand Down Expand Up @@ -2417,7 +2467,7 @@ FROM
regional_by_row_table_as4@a_idx
WHERE
a
IN (1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18,
IN (1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18,
18, 19, 22, 23, 24, 25, 28, 30, 33, 34, 39, 40)
LIMIT
5
Expand Down Expand Up @@ -2479,7 +2529,7 @@ FROM
regional_by_row_table_as4@a_idx
WHERE
a
IN (1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18,
IN (1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18,
18, 19, 22, 23, 24, 25, 28, 30, 33, 34, 39, 40)
LIMIT
5
Expand Down Expand Up @@ -2522,7 +2572,7 @@ FROM
regional_by_row_table_as4@a_idx
WHERE
a
IN (1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18,
IN (1, 2, 4, 5, 6, 8, 10, 11, 12, 14, 15, 16, 17, 18,
18, 19, 22, 23, 24, 25, 28, 30, 33, 34, 39, 40)
LIMIT
5
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/catalog/descpb/index_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (s *IndexFetchSpec) KeyColumns() []IndexFetchSpec_KeyColumn {

// KeyFullColumns returns the key columns in the index, plus all key suffix
// columns if that index is not a unique index. It parallels
// TableDesciptor.IndexFullColumns.
// TableDescriptor.IndexFullColumns.
func (s *IndexFetchSpec) KeyFullColumns() []IndexFetchSpec_KeyColumn {
if s.IsUniqueIndex {
// For unique indexes, the suffix columns are not part of the key (except
Expand Down
Loading

0 comments on commit 94e64ce

Please sign in to comment.