-
Notifications
You must be signed in to change notification settings - Fork 741
Open
Description
Queries:
CREATE TABLE `optsample0/table1` (
id Text NOT NULL,
t2_id Text,
attr1 Text,
attr2 Text,
PRIMARY KEY(id),
INDEX ix_table1_t2_id GLOBAL ON (t2_id) COVER(attr1, attr2)
);
CREATE TABLE `optsample0/table2` (
id Text NOT NULL,
attr3 Text,
attr4 Text,
PRIMARY KEY(id),
INDEX ix_table2_attr3 GLOBAL ON (attr3)
);
SELECT t1.id AS t1_id, t2_id, attr1, attr2, attr3, attr4
FROM `optsample0/table2` AS t2
INNER JOIN `optsample0/table1` AS t1 ON t2.id = t1.t2_id
WHERE t2.attr3 = 'value'u;
Expected result:
- select from
table2is done usingix_table2_attr3 - select from
table1is done usingix_table1_t2_id
Actual result:
- select from
table2is done usingix_table2_attr3(OK) - select from
table1is done using fullscan oftable1(NOT OK) - when
ix_table1_t2_idis explicitly specified in the request, the index is used (OK)
It's expected that ix_table1_t2_id would be chosen automatically by optimiser.
Metadata
Metadata
Assignees
Labels
No labels