Status: Closed (View Workflow)
Affects Version/s: None
Fix Version/s: None
We have assumed that CQL queries, in conjunction with the limit=0 parameter and the returned "totalRecords" value, can be used to determine the number of records in matching the critera specified in the CQL query.
Being able to use CQL like this to quickly generate simple reports (e.g. how many items did we really create last year?) is tempting for institutions without direct access to their database or - for whatever reason, for example that it's not done - not using LDP.
We are also relying on CQL queries for this handsome dashboard which displays daily statistics for our tenant: http://folio-libris-rtac.azurewebsites.net/statistics/
While working on
CHAL-240, we discovered discrepancies in the numbers returned by SQL queries and seemingly corresponding CQL queries. It was suggested that this might have been due to the issue, described in MODINVSTOR-321, where
totalRecords is useless unless a query matches < limit record because that's the only circumstance when it only returns a non-estimate value
The estimate values, as far as I can tell, can be pretty off the mark. So I would like to better understand in which cases this issue occurs, what determines the accuracy of the estimate, and - ultimately - in which cases CQL queries and "allRecords" can provide us with valuable information about the number records matching specific criteria.
is the documation about the totalRecords field, an estimation based on the estimation returned by the PostgreSQL query planner.