TCache icon indicating copy to clipboard operation
TCache copied to clipboard

Allow for query optimization

Open bbarker opened this issue 6 years ago • 1 comments

I'm not suggesting this is necessarily easy to do, but wanted to open up the topic. It seems for the query API to be useful for most non-trivial cases, it may be necessary to allow for query optimizations to be defined in the native datastore being used (e.g., for SQL, this would be like using SQL itself (or some generator of SQL) to specify the exact query).

bbarker avatar Feb 11 '19 14:02 bbarker

Thanks for raising this topic. I had some ideas about how to do it but it is a bit tricky since doing direct queries to SQL would bypass the cache of STM registers. FIrst it would need a write from the cache to the database to make sure that every row is updated. It would require to add a new set of instances of RelationOps at indexQuery.hs which may return rows instead of DBRefs.

agocorona avatar Feb 14 '19 21:02 agocorona