"Order by " making the N1QL Query slow

select _id,name,url,tags,status,createdAt from content where _type=“UserAsset” order by createdAt desc limit 10

“UserAsset” has 3lakhs document and I am using “Enterprise Edition 5.5.2 build 3733 ‧ IPv4” couchbase. still the above query is taking 10sec to execute.

Is there any alternate way to order by the query?

CREATE INDEX ix1c ON content(createdAt DESC, status, name,tags,url,_id) WHERE _type="UserAsset";
OR
CREATE INDEX ix1 ON content(createdAt DESC) WHERE _type="UserAsset";

SELECT _id,name,url,tags,status,createdAt
FROM content 
WHERE  _type="UserAsset" AND createdAt IS NOT MISSING
ORDER BY  createdAt DESC
LIMIT 10;
1 Like

Its working for UserAsset now.
Thanks