Trying to build an index for the following query for the object below.
name: “A Book shop”
The requirement is to fetch the recent seller per book.
Query: SELECT book._id as bookId, MAX([
sold,sell]).seller AS seller FROM
bucker sell WHERE type=’_recent_seller’ GROUP BY book._id
Index I tried is following which is not covered and is taking 5 seconds to return the data.
create index _idx_recent_seller on bucket(type,book._id,sold) where type = ‘_recent_seller’.
Could you guys help me get this performance improved.