I actually have where clause in my index definition.
I think I also have a different use case for this, where I’m creating an index with undefined value.
This is from my local test machine.
Documents
{
"published_at": "value1",
"form": "test"
}
{
"published_at": "value2",
"form": "test"
}
Index
create index tmp_idx2 on catalog(publishedAt, form) where form='test';
Explain
explain update catalog set publishedAt = published_at where publishedAt is missing and form='test';
Output
{
"requestID": "4f74a77b-f3c7-4147-a10d-73778aff5863",
"signature": "json",
"results": [
{
"#operator": "Sequence",
"~children": [
{
"#operator": "PrimaryScan",
"index": "#primary",
"keyspace": "catalog",
"namespace": "default",
"using": "gsi"
},
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Fetch",
"keyspace": "catalog",
"namespace": "default"
},
{
"#operator": "Filter",
"condition": "(((`catalog`.`publishedAt`) is missing) and ((`catalog`.`form`) = \"test\"))"
},
{
"#operator": "Clone"
},
{
"#operator": "Set",
"set_terms": [
{
"path": "(`catalog`.`publishedAt`)",
"value": "(`catalog`.`published_at`)"
}
]
},
{
"#operator": "SendUpdate",
"alias": "catalog",
"keyspace": "catalog",
"limit": null,
"namespace": "default"
}
]
}
},
{
"#operator": "Discard"
}
]
}
],
"status": "success",
"metrics": {
"elapsedTime": "10.611063ms",
"executionTime": "10.5791ms",
"resultCount": 1,
"resultSize": 1998
}
}
Using “use index” does not help in this case.
Do I have to take out where clause?