Index with OR between two different fields

HI! I have a document with two fields

{
"name": "Kitty",
"phone": "123"
}

I want to run a query like this

select * from document where name = "Kitty" OR phone = "123";

I have index for both fields

create index idx_name on document(name);
create index idx_phone on document(phone);

when I run an explain it says that the query use a primary index.

What is the correct index or the way to write the query ?

Thanks!

Use UNION ALL for now. This is fixed in the February dev build and beyond.

1 Like