There's two approaches to this:
- Use RPCs to fetch results.
- Keep a clone of the database.
The first option is faster to implement, but subject to network latencies. The second approach is more complex, but more performant. Maybe we can go with Option 1 as a stopgap before implementing Option 2.