Skip to content

Commit 1cf8c98

Browse files
authored
enable chooser by default (#12157)
1 parent aa2f567 commit 1cf8c98

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4437,6 +4437,11 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
44374437
setting.SetValue("1");
44384438
auto serverSettings = TKikimrSettings()
44394439
.SetKqpSettings({setting});
4440+
4441+
NKikimrConfig::TAppConfig appConfig;
4442+
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamIdxLookupJoin(false);
4443+
serverSettings.SetAppConfig(appConfig);
4444+
44404445
TKikimrRunner kikimr(serverSettings);
44414446
auto db = kikimr.GetTableClient();
44424447
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -4593,6 +4598,20 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
45934598
}
45944599

45954600
// Without using index by pk directly
4601+
{
4602+
const TString query1(Q_(R"(
4603+
$ids = (AsList(AsStruct(CAST(1 as Uint64) as id), AsStruct(CAST(2 as Uint64) as id)));
4604+
4605+
SELECT t.id as id, t.yandexuid as yandexuid, t.uid as uid
4606+
FROM AS_TABLE($ids) AS k
4607+
INNER JOIN `/Root/user` VIEW PRIMARY KEY AS t
4608+
ON t.id = k.id
4609+
WHERE uid IS NULL
4610+
;)"));
4611+
const TString expected = R"([[[1u];["abc"];#]])";
4612+
UNIT_ASSERT_VALUES_EQUAL(execQuery(query1), expected);
4613+
}
4614+
45964615
{
45974616
const TString query1(Q_(R"(
45984617
$ids = (AsList(AsStruct(CAST(1 as Uint64) as id), AsStruct(CAST(2 as Uint64) as id)));

ydb/core/protos/table_service_config.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ message TTableServiceConfig {
273273
ONLY_POINTS = 2; // Accepts iff point prefix len > 0
274274
MAX_USED_PREFIX = 3;
275275
}
276-
optional EIndexAutoChooseMode IndexAutoChooseMode = 50 [default = DISABLED];
276+
optional EIndexAutoChooseMode IndexAutoChooseMode = 50 [default = MAX_USED_PREFIX];
277277

278278
optional bool EnableColumnsWithDefault = 51 [default = true];
279279

0 commit comments

Comments
 (0)