Hello,
On a specific request the ordering by timestamp ascending is not working while the descending ordering works on QDB 9.4.2.
The initial request is:
SELECT * FROM (
SELECT a03.timestamp as timestamp, a03.n_pap_03, a03.s_pap_03, t03.n_03, t03.s_03 FROM
((SELECT timestamp, sum(number) as n_pap_03, sum(surface) as s_pap_03
FROM summary_object_stat WHERE class_name like 'CEL%' and timestamp > '2026-01' group by timestamp) timestamp(timestamp)) as a03
JOIN
((SELECT timestamp, sum(number) as n_03, sum(surface) as s_03
FROM aisee_summary_object_stat WHERE timestamp > '2026-01'group by timestamp) timestamp(timestamp)) as t03 on a03.timestamp = t03.timestamp
) order by timestamp asc;
The corresponding EXPLAIN:
```
SelectedRecord
Hash Join Light
condition: t03.timestamp=a03.timestamp
SelectedRecord
Async Group By workers: 4
keys: [timestamp]
values: [sum(number),sum(surface)]
filter: class_name like CEL% [state-shared]
PageFrame
Row forward scan
Interval forward scan on: summary_object_stat
intervals: [("2026-01-01T00:00:00.000001Z","MAX")]
Hash
SelectedRecord
Async Group By workers: 4
keys: [timestamp]
values: [sum(number),sum(surface)]
filter: null
PageFrame
Row forward scan
Interval forward scan on: summary_object_stat
intervals: [("2026-01-01T00:00:00.000001Z","MAX")]
```
And data are not returned ordered.
Changing the asc by desc in the request returns the data properly ordered in reverse orde. The corresponding EXPLAIN is:
```
Encode sort
keys: [timestamp desc]
SelectedRecord
Hash Join Light
condition: t03.timestamp=a03.timestamp
SelectedRecord
Async Group By workers: 4
keys: [timestamp]
values: [sum(number),sum(surface)]
filter: class_name like CEL% [state-shared]
PageFrame
Row forward scan
Interval forward scan on: summary_object_stat
intervals: [("2026-01-01T00:00:00.000001Z","MAX")]
Hash
SelectedRecord
Async Group By workers: 4
keys: [timestamp]
values: [sum(number),sum(surface)]
filter: null
PageFrame
Row forward scan
Interval forward scan on: summary_object_stat
intervals: [("2026-01-01T00:00:00.000001Z","MAX")]
```
The difference is clear.