docs: def _query_attr_sort_fn(self, attr_val):
          """Used to order where keys by most selective key first"""
          attr, v = attr_val
          if attr in self._indexes:
              idx = self._indexes[attr]
              if v in idx:
                  return len(idx[v])
              else:
                  return 0
          else:
              return 1e9