Details
Description
how user can know what index will be used?
I have items like
{
"tasks_points":
,
"name": "employee-20",
"mutated": 0,
"skills": [
"skill2010",
"skill2011"
],
"join_day": 20,
"join_mo": 5,
"email": "20-mail@couchbase.com",
"test_rate": 5.5,
"join_yr": 2010,
"_id": "query-test003d2ed-0",
"VMs": [
,
{ "RAM": 5, "os": "windows", "name": "vm_6", "memory": 5 } ],
"job_title": "Sales"
}
and 2 indexes like:
cbq> select * from system:indexes where "`join_yr`" IN index_key;
{
"requestID": "9283861d-b0e9-4e87-9ab8-e3b705911161",
"signature":
,
"results": [
{
"indexes":
},
{
"indexes":
}
],
"status": "success",
"metrics":
}
cbq>
the query "select join_yr, VMs from default where join_yr>2 and VMs is not null" has to verify join_yr and VMs.
I would expect that ind19 will be used, because it has both fields. But now ind11 is used which has only one of the fields.
Index for second field also exists.
{
"indexes":
},