A continuable query might be ordered by a different property from the one that the range search conditions reference. To remedy slow query execution, change the ORDER BY clause of the query to reference the same property.
Content Platform Engine SQL | Corresponding database SQL (continuable query) |
---|---|
|
|
If the query returns many rows, query execution might be slow regardless of any database indexes. Because an index look-up on uxy_Property1 returns rows in Property1 order and not Property2 order, the query might have to perform a sort. The query execution plan might not use any index or might scan the entire index on Property2 if one is present.
SELECT Id From Document
WHERE Property1 > 'aValue'
AND Property1 < 'zValue'
ORDER BY Property1