I have the below N1QL Query witch i use in a grid to show user Data
SELECT
meta(f).id as DocId,
f.tract,
f.PropertyAddress.houseNumber,
f.PropertyAddress.streetName,
t.name AS tract_name
FROM Contacts AS f
LEFT JOIN Contacts AS t
ON t._type ="tract_info" AND ANY b IN t.tract_id SATISFIES b = f.tract END
WHERE f._type="farm"
order by f.PropertyAddress.streetName , TONUMBER(f.PropertyAddress.houseNumber)
Limit 100 Offset 0
when i use this query with the order clause it take 3.5 sec to return Data against a 3K document set.
If i go and remove the order by clause it takes 250ms.
I created 2 indexes which i hoped would help
CREATE INDEX ix3
ON Contacts
(PropertyAddress.streetName , PropertyAddress.houseNumber
) WHERE (_type
= “farm”)
CREATE INDEX
ix4ON
Contacts(
PropertyAddress) WHERE (
_type= "farm")
But it looks like it never uses any of these indexes