Details
Description
This is a follow-up of an external PR, https://github.com/couchbase/couchbase-lite-core/pull/1642.
After commit dcaa54943e6 to fleece, we added a condition to cache Dict::key::_numericKey. This condition accidentally keeps the Query result to cache the keys unnecessarily.
The main idea of the PR is valid, but Jens Alfke suggested better solution:
"I think the solution may be to add a cacheable flag to SharedKeys. It defaults to true, but there's a disableCaching method that forces it to return false. PersistentSharedKeys sets it to false while it's in a transaction.
"DictKey can then check sk->cacheable() instead of !sk->inTransaction().
"And DBAccess would call disableCaching on its tempSharedKeys."