Description
There is a bug with filter_covers that prevents correct behavior. They need to wrap the corresponding expressions in Cover(). For example:
CREATE INDEX idx_userprofile_status
ON couchmusic2(status)
WHERE type = "userprofile";
EXPLAIN
SELECT COUNT AS active_profiles
FROM couchmusic2
WHERE status = "active"
AND type = "userprofileā;
[
{
"plan": {
"#operator": "Sequence",
"~children": [
{
"#operator": "IndexScan",
"covers": [
"cover ((`couchmusic2`.`status`))",
"cover ((meta(`couchmusic2`).`id`))"
],
"filter_covers":
,
"index": "idx_userprofile_status",
"index_id": "d4f9d46ba034ae40",
"keyspace": "couchmusic2",
"namespace": "default",
"spans": [
{
"Range":
}
],
"using": "gsi"
},
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
,
{ "#operator": "InitialGroup", "aggregates": [ "count(*)" ], "group_keys": [] } ]
}
},
,
,
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "InitialProject",
"result_terms": [
]
},
]
}
}
]
},
"text": "\nSELECT COUNT AS active_profiles\nFROM couchmusic2\nWHERE status = \"active\"\nAND type = \"userprofile\";"
}
]