Представьте, что у меня есть денормализованный набор данных в Firebase, оптимизированный для быстрых неглубоких запросов (объекты не глубоко вложены).
Все это прекрасно работает, пока мне не нужно извлекать данные на основе нескольких критериев.
Вот пример:

If I need to do a pagination on "nike" collection sorted by price, I'd do
ref.child('nike').orderByChild('price').limitToFirst(10)
However if I want to paginate over "nike" AND "adidas" sorted by price - it's usually suggested to create a separate table "nike_adidas" with duplicated items from both collections.
ref.child('nike_adidas').orderByChild('price').limitToFirst(10)
The problem is that there are a lot of such combinations and it's not possible to create "index tables" for all of them.
What do you do in such cases? (considering ONLY Firebase, e.g. you don't get to setup a separate ElasticSearch for such queries)
Additional requirement - I still want clients to receive updates once objects changed/moved/removed.
Note: this is separate from Firestore compound queries (https://firebase.google.com/docs/firestore/query-data/queries#compound_queries),, поскольку Firestore также не делаетподдержка Single queries across multiple collections or subcollections
.