I am running the following query
SELECT META(d).id AS KeyId,
d.Record.ListingKeyNumeric
FROM rets AS d
WHERE ARRAY_LENGTH(d.Images) = 0
AND d._type ="Residential"
AND d._type IS NOT MISSING
ORDER BY d.Record.Dates.ModificationTimestamp DESC
LIMIT 1000
which i use to get 1000 records a time from my db which has no images in the array. (By images i mean
links to images not actual binary data) When i run this against 1 million records it takes about 10 sec
which seems long.
here is the index used
Index Currently Used
CREATE INDEX adv_array_length_Images_type_Record_ListingKeyNumeric_Record_Dates_ModificationTimestamp ON rets
(array_length(Images
),(Record
.ListingKeyNumeric
),((Record
.Dates
).ModificationTimestamp
)) WHERE (_type
= ‘Residential’)
As there anything i can do to improve this query ? As close to 10 sec is long on a million and after i load more data not sure how it will be on 25 Million records