The generic sort optimisation should be implemented in RMB's cql-to-sql parser and cover all "sortby" cases.
The optimisation is required to ensure that the sort index (if one exists) is used by Postgres rather than retrieval and manual re-sort.
The optimisation should be applied by RMB transparently (to the client calling code) in all cases when sortby is used and when there is an equivalent sort index configured in schema.json.
The "title" sort specific optimized query path that is invoked only during the instance search with sortby=title should be removed from mod-inventory-strorage.
In addition, the code used to generate the "count query" (query used as parameter to the count parsing function) should be aligned for all cases and the query function should use the bare, WHERE-only version of the query.