Skip to content

Commit 4c2a546

Browse files
craig[bot]yuzefovich
andcommitted
Merge #148306
148306: sql: lift lookup join parallelization into execbuilder r=yuzefovich a=yuzefovich In preparation for expanding the heuristic for when it's safe to parallelize cross-range reads in the lookup join, this commit lifts the decision into the execbuilder. As a reminder, when Streamer API is not used, we currently choose to enable parallelism when an input row can result in at most one lookup row (which is the case for index joins as well as lookup joins when equality columns form a key), also when the session variable enables it for multi-lookup case. Previously, this was determined when creating the JoinReader, and now we make this determination in the execbuilder. We add a new field to the processor spec based on the execbuilder argument (for compatibility with 25.2 release we also keep the old logic for now). Additionally, this commit enhances the EXPLAIN output to show `parallel` attribute in VERBOSE mode when applicable (when the streamer is used as well as when Parallelize is set to true by the execbuilder). This improvement was part of the reason to lifting the determination up there (so that `parallelize` boolean argument to ConstructLookupJoin is captured by the explain factory). Informs: #134351. Epic: None Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]>
2 parents dbe89ca + fe69095 commit 4c2a546

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+459
-27
lines changed

pkg/ccl/logictestccl/testdata/logic_test/partitioning_hash_sharded_index_query_plan

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ vectorized: true
7272
│ table: t_parent@t_parent_pkey
7373
│ equality cols are key
7474
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_id_shard_16_eq = crdb_internal_id_shard_16)) AND (pid = id)
75+
│ parallel
7576
7677
└── • render
7778
│ columns: (crdb_internal_id_shard_16_eq, pid)
@@ -150,6 +151,7 @@ vectorized: true
150151
│ table: t_parent@t_parent_pkey
151152
│ equality cols are key
152153
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_id_shard_16_eq = crdb_internal_id_shard_16)) AND (pid = id)
154+
│ parallel
153155
154156
└── • render
155157
│ columns: (crdb_internal_id_shard_16_eq, pid)
@@ -244,6 +246,7 @@ vectorized: true
244246
│ table: t_gen_random_uuid@t_gen_random_uuid_pkey
245247
│ equality cols are key
246248
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_user_id_shard_16_eq = crdb_internal_user_id_shard_16)) AND (user_id_default = user_id)
249+
│ parallel
247250
248251
└── • render
249252
│ columns: (crdb_internal_user_id_shard_16_eq, crdb_internal_user_id_shard_16_comp, column2, val_cast, user_id_default)
@@ -297,6 +300,7 @@ vectorized: true
297300
│ table: t_gen_random_uuid@t_gen_random_uuid_pkey
298301
│ equality cols are key
299302
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_user_id_shard_16_eq = crdb_internal_user_id_shard_16)) AND (user_id_default = user_id)
303+
│ parallel
300304
301305
└── • render
302306
│ columns: (crdb_internal_user_id_shard_16_eq, crdb_internal_user_id_shard_16_comp, column2, val_cast, user_id_default)
@@ -420,6 +424,7 @@ vectorized: true
420424
│ table: t_unique_hash_pk@t_unique_hash_pk_pkey
421425
│ equality cols are key
422426
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_id_shard_16_eq = crdb_internal_id_shard_16)) AND (column1 = id)
427+
│ parallel
423428
424429
└── • render
425430
│ columns: (crdb_internal_id_shard_16_eq, crdb_internal_id_shard_16_comp, column1, column2)
@@ -505,6 +510,7 @@ vectorized: true
505510
│ table: t_unique_hash_pk@t_unique_hash_pk_pkey
506511
│ equality cols are key
507512
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_id_shard_16_eq = crdb_internal_id_shard_16)) AND (column1 = id)
513+
│ parallel
508514
509515
└── • render
510516
│ columns: (crdb_internal_id_shard_16_eq, crdb_internal_id_shard_16_comp, column1, column2)
@@ -671,6 +677,7 @@ vectorized: true
671677
│ │ equality cols are key
672678
│ │ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_id_shard_16_eq = crdb_internal_id_shard_16)) AND (column1 = id)
673679
│ │ locking strength: for update
680+
│ │ parallel
674681
│ │
675682
│ └── • render
676683
│ │ columns: (crdb_internal_id_shard_16_eq, crdb_internal_id_shard_16_comp, column1, column2)
@@ -803,6 +810,7 @@ vectorized: true
803810
│ equality cols are key
804811
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_id_shard_16_eq = crdb_internal_id_shard_16)) AND (column1 = id)
805812
│ locking strength: for update
813+
│ parallel
806814
807815
└── • render
808816
│ columns: (crdb_internal_id_shard_16_eq, crdb_internal_id_shard_16_comp, column1, column2)
@@ -956,6 +964,7 @@ vectorized: true
956964
│ table: t_unique_hash_sec_key@idx_uniq_hash_email
957965
│ equality cols are key
958966
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_email_shard_16_eq = crdb_internal_email_shard_16)) AND (column2 = email)
967+
│ parallel
959968
960969
└── • render
961970
│ columns: (crdb_internal_email_shard_16_eq, column1, column2, column3, crdb_internal_email_shard_16_comp)
@@ -1018,6 +1027,7 @@ vectorized: true
10181027
│ table: t_unique_hash_sec_key@idx_uniq_hash_email
10191028
│ equality cols are key
10201029
│ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_email_shard_16_eq = crdb_internal_email_shard_16)) AND (column2 = email)
1030+
│ parallel
10211031
10221032
└── • render
10231033
│ columns: (crdb_internal_email_shard_16_eq, column1, column2, column3, crdb_internal_email_shard_16_comp)
@@ -1033,6 +1043,7 @@ vectorized: true
10331043
│ table: t_unique_hash_sec_key@t_unique_hash_sec_key_pkey
10341044
│ equality cols are key
10351045
│ lookup condition: (part IN ('new york', 'seattle')) AND (column1 = id)
1046+
│ parallel
10361047
10371048
└── • render
10381049
│ columns: (crdb_internal_email_shard_16_comp, column1, column2, column3)
@@ -1158,6 +1169,7 @@ vectorized: true
11581169
│ │ table: t_unique_hash_sec_key@idx_uniq_hash_email
11591170
│ │ equality cols are key
11601171
│ │ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_email_shard_16_eq = crdb_internal_email_shard_16)) AND (column2 = email)
1172+
│ │ parallel
11611173
│ │
11621174
│ └── • render
11631175
│ │ columns: (crdb_internal_email_shard_16_eq, crdb_internal_email_shard_16_comp, column1, column2, column3)
@@ -1414,6 +1426,7 @@ vectorized: true
14141426
│ │ equality cols are key
14151427
│ │ lookup condition: ((part IN ('new york', 'seattle')) AND (crdb_internal_email_shard_16_eq = crdb_internal_email_shard_16)) AND (column2 = email)
14161428
│ │ locking strength: for update
1429+
│ │ parallel
14171430
│ │
14181431
│ └── • render
14191432
│ │ columns: (crdb_internal_email_shard_16_eq, crdb_internal_email_shard_16_comp, column1, column2, column3)
@@ -1638,6 +1651,7 @@ vectorized: true
16381651
│ │ equality cols are key
16391652
│ │ lookup condition: (part IN ('new york', 'seattle')) AND (column1 = id)
16401653
│ │ locking strength: for update
1654+
│ │ parallel
16411655
│ │
16421656
│ └── • render
16431657
│ │ columns: (crdb_internal_email_shard_16_comp, column1, column2, column3)

0 commit comments

Comments
 (0)