On behalf of Celanese
Hi.
I would like to report a potential issue with cursor-based pagination when sorting in descending order and request clarification on the undocumented forceCursorsDespitePerformanceHazard flag.
We are executing a query against the view OEEEvent, which is defined with a cursorable BTREE index on the startDateTime property, as shown in the simplified schema below:
type OEEEvent
@container(
indexes: [
{
fields: ["startDateTime"]
identifier: "idx_oeev_startDateTime"
indexType: BTREE
cursorable: true
}
]
) {
startDateTime: Timestamp
endDateTime: Timestamp
totalDuration: Float
}
We are querying with the following time range filter:
"startDateTime": {
"gte": "2024-12-31T00:00:00.000-03:00",
"lt": "2025-05-01T00:00:00.000-03:00"
}
The result set includes 840 records.
When applying a page size of 500 and using the following ascending sort configuration:
{
"property": [
"INO-COR-ALL-DML",
"OEEEvent/472bdbcb9cd6f1",
"startDateTime"
],
"direction": "ascending"
}
The query returns two pages, as expected.
However, when changing the sort direction to descending:
{
"property": [
"INO-COR-ALL-DML",
"OEEEvent/472bdbcb9cd6f1",
"startDateTime"
],
"direction": "descending"
}
Only one page is returned, which appears to be incorrect and suggests a bug in how pagination is handled when sorting in descending order on a cursorable index.
To further investigate, I reproduced the query in the Fusion UI GraphQL playground. Interestingly, the issue did not occur there. Upon examining the DMS output, I noticed the presence of a flag named forceCursorsDespitePerformanceHazard, which seems to resolve the issue.
However, this flag does not appear to be documented. Since this query is critical in Celanese’s production environment, we would appreciate clarification on the following:
-
What is the purpose of the
forceCursorsDespitePerformanceHazardflag? -
Under what conditions should it be used?
-
Is the inconsistent behavior between ascending and descending sorts expected?
-
Is there a recommended or permanent fix planned for this issue?
Thank you in advance for your support.
Best regards,
Lucas Alves
Check the
documentation
Ask the
Community
Take a look
at
Academy
Cognite
Status
Page
Contact
Cognite Support