We have an index that is updated and read throughout our application, and we are considering adding a functional component as its final key. The current final key, the one that would become penultimate should we add this one, is likely to be unique for each document, so the added functional component shouldn’t affect the actual sort order of the records.
But since this is one of our most write heavy indexes, we are concerned about a potential index write performance degradation. We really don’t know how to reason about what this will cost us in performance.
Here are the two possibilities I can see:
- The only thing the functional component will add is cost ‘C’ of running the function statement on the data field. If this is the case, the added cost per record is simply C. It’s also possible that cost C is significantly higher in the context of index writing than it is when, say, mutating a projection, and if so, we really need to know.
- The very existence of a functional component on the index necessitates a different handling flow/path/parser… This is our largest concern and in this case we’d certainly be in the dark concerning its performance impact.
I’ll note that this index already has an array component, if that makes a difference.
Please help, as is this is super important to us.