apache / apache/datafusion

Improve performance of db-benchmark query 8

Open
#13,586 13 comments 0 reactions 1 assignee Claimed by @alan910127 View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

Query 8 in db-benchmark is slower than other queries
https://github.com/MrPowers/mrpowers-benchmarks

The query is as follows

```sql
select id6, largest2_v3 from
(select id6, v3 as largest2_v3, row_number() over (partition by id6 order by v3 desc) as order_v3
from x
where v3 is not null) sub_query
where order_v3 <= 2
```

### Describe the solution you'd like

* Profile / analyze this query
* Improve performance

It might be the part `row_number() over (partition by id6 order by v3 desc)` or rather the sorting is the most expensive.

`

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.