Need help understanding when and why the query engine executes a fetch.
I have (for example) a simple query:
WHERE `docType’ = “employee” and employeeType = ‘supervisor’ and employmentStartDate > 1568310951
The plan scans two indices defined on “app” like so:
employeeType) WHERE ((
docType= “employee”) and (
Thus seemingly everything for the filtering and the projection is available from the indices.
The plan then does an intersect (good) and then a FETCH. The fetch constitutes 83% of the query run time.
This query is just a sample, but I’m seeing this a lot and am obviously doing something wrong.
Please tell me why it’s doing a fetch and how to avoid it. Really need to understand this to query effectively, please help.