Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: using Like in secondary index don't use index #32

Open
gayratv opened this issue Apr 24, 2022 · 1 comment
Open

bug: using Like in secondary index don't use index #32

gayratv opened this issue Apr 24, 2022 · 1 comment
Labels
area/queryprocessor Query processor issues and requests enhancement New feature or request external

Comments

@gayratv
Copy link

gayratv commented Apr 24, 2022

YDB serverless

Use this table:

CREATE TABLE my_table (
    k1 Uint32,
    k2 Uint64,
    desc Utf8,
    index my_tbl_ind global on(desc),
    PRIMARY KEY (k1,k2)
);
commit;
insert into my_table (k1,k2,desc)
values
(1u,1ul,'desc 11'u),
(2u,2ul,'desc 22'u),
(3u,3ul,'desc 33'u),
(4u,4ul,'desc 44'u),
(5u,5ul,'desc 55'u);
commit;

This query don't using secondary index (as described in docs) and generate FullScan

SELECT * FROM my_table view my_tbl_ind  WHERE desc like 'desc 1%'u
@fomichev3000 fomichev3000 added the area/queryprocessor Query processor issues and requests label May 18, 2022
@fomichev3000
Copy link
Member

I suppose it's all about selecting a query plan, that uses indexes automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/queryprocessor Query processor issues and requests enhancement New feature or request external
Projects
None yet
Development

No branches or pull requests

3 participants