When executing a query with USE INDEX before 7.6, if the specified index was not found, it used to fallback to an index chosen by the server.
Since 7.6 offers scans, it is the default fallback for queries on keyspace without index.
Since scans have poor performance, I find this extremely dangerous.
Turning off scans entirely could be an option is some cases.
Could it be possible to introduce a flag either at the cluster level or at the client level to instead throw an error if an index is not found ?
If USE INDEX is not qualified or not available it specified in explain.
The order is as follows
USE INDEX
Any qualified secondary index
Primary Index
Sequential (KV Range) Scan
Error out
Sequential Scan requires collection Sequential RBAC privilege (This avoid whole collection bring to query node impact cluster performance). Administrator has default all (this) privilege. All others must be granted. Without RBAC privilege same as pre 7.6
The reason it don’t give error when MISSING is avoid unexpected error when index specified not present, not online, index node is down/not reachable etc.