The following query is trying to get almost all of the data from the bucket that is why it taking long time. As @geraldss suggested we have done quite performance improvements in 4.5 Beta.
Please try the following in 4.5 Beta.
CREATE INDEX index_user ON user(name,userId,createdAt,avatarId) WHERE meta().id LIKE “user/%”;
SELECT userId, avatarId, name FROM user WHERE name LIKE “%” AND userId <> “” AND createdAt <= 99999999999999999 AND meta().id LIKE “user/%” ORDER BY name ASC LIMIT 100 OFFSET 0;
Above query uses ORDER BY, LIMIT, OFFSET. If query has these it needs to process all the qualified results, order before applying limit, offset. In 4.5 Beta if the query order matches the index leading orders we eliminate sort (explain will show no order operator), In that case query can stop producing the results when the limit and offset satisfied (In 4.5 Beta some cases we pushed limit/offset to indexer).
If the fields are strings, try the following variation. Also check your results are right.
SELECT userId, avatarId, name FROM user WHERE name >= “” AND userId > “” AND createdAt <= 99999999999999999 AND meta().id LIKE “user/%” ORDER BY name ASC LIMIT 100 OFFSET 0;
FYI: name LIKE “%” is not same as name IS NULL. So the timings of tests will change based on predicates.