Improve performance of secondary instance queries
- Dominant language
- TypeScript
- Stars
- 38
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
### Description
Forms with calculations that query secondary instances take a long time to load, especially when there are many items in the secondary instance.
It is likely that this is due to two factors...
1. The engine doesn't cache the query. It is quite common to have multiple queries retrieving different data for the same row of a secondary instance so this multiplies the time to execute.
2. Secondary instances aren't indexed nor unique, so the lookup always scans through all items in the secondary instance before returning.
These are both complicated somewhat by the fact we don't know how many times the query will be run, so we risk wasting time and memory on caching and indexing which is never used again.
There is also a generic version that could significantly improve performance for all queries (not just secondary instance queries) but this is more complicated because while secondary instances are immutable, other queries may need to have their cache invalidated when they are updated.
This is also a good opportunity to start a performance testing suite at the engine level to prove the chosen approach works.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.