Created index on array and count is slow.
my index definition
create index index_name_array on default(DISTINCT ARRAY name FOR name IN names END,names)
Query
explain Select count(1) from default where ANY name IN names SATISFIES name like ‘test%’ END
[
{
“plan”: {
"#operator": “Sequence”,
"~children": [
{
"#operator": “DistinctScan”,
“scan”: {
"#operator": “IndexScan”,
“covers”: [
“cover ((distinct (array name
for name
in (default
.names
) end)))”,
“cover ((default
.names
))”,
“cover ((meta(default
).id
))”
],
“index”: “index_name_array”,
“index_id”: “70e3dae0425987d”,
“keyspace”: “default”,
“namespace”: “default”,
“spans”: [
{
“Range”: {
“High”: [
"“tesu”"
],
“Inclusion”: 1,
“Low”: [
"“test”"
]
}
}
],
“using”: “gsi”
}
},
{
"#operator": “Parallel”,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “Filter”,
“condition”: “any name
in cover ((default
.names
)) satisfies (name
like “test%”) end”
},
{
"#operator": “InitialGroup”,
“aggregates”: [
“count(1)”
],
“group_keys”: []
}
]
}
},
{
"#operator": “IntermediateGroup”,
“aggregates”: [
“count(1)”
],
“group_keys”: []
},
{
"#operator": “FinalGroup”,
“aggregates”: [
“count(1)”
],
“group_keys”: []
},
{
"#operator": “Parallel”,
"~child": {
"#operator": “Sequence”,
"~children": [
{
"#operator": “InitialProject”,
“result_terms”: [
{
“expr”: “count(1)”
}
]
},
{
"#operator": “FinalProject”
}
]
}
}
]
},
“text”: “Select count(1) from default where ANY name IN names SATISFIES name like ‘test%’ END”
}
]
No IndexScanCounter and query is slow in getting count