As we implement filtering and sorting, we might add more entries to
task.Query contains basically just
uids as ints. Recently, we add on
terms which is for exact match. I’m looking to add partial match and sorting. That would require different keys for RocksDB lookups. They might have different prefixes. We can keep adding more fields to
task.Query but that doesn’t seem to be the most elegant design.
I wonder if
task.Query can instead contain one
prefix and one
suffix array. They will replace
terms and will also work for other kinds of keys that I am trying to add. (We no longer keep
task.Query in subgraph, so no worries about getting rid of
attr.) The lookup keys would be prefix + suffix from suffix array, as you expect. There can be multiple variants of
createTaskQuery that will create the right
Another alternative is to keep
attr and one suffix array and lookup keys would be prefix + attr + suffix. This might be a safer change as there might be some code that needs
attr. Let me check.
Wonder what you all think? @core-devs Thanks!
ADD: Ok, I think we do need to keep
task.Query. It is used to get the RAFT group, for each worker. Wonder if we can go for
attr and suffix array in