Do you mean query takes 2 seconds, You also have order by. Modify the index as follows. If still have issue post the EXPLAIN
CREATE INDEX ix1 ON selfiecash( DISTINCT ARRAY userId FOR userId IN usersInChat END) WHERE tbl=“msgs”;
Do you mean query takes 2 seconds, You also have order by. Modify the index as follows. If still have issue post the EXPLAIN
CREATE INDEX ix1 ON selfiecash( DISTINCT ARRAY userId FOR userId IN usersInChat END) WHERE tbl=“msgs”;