Skip to content

Parallel execution for ORDER BY + LIMIT N in simple table queries #4133

@puzpuzpuz

Description

@puzpuzpuz

Is your feature request related to a problem?

Specifically, this ClickBench query involves a large dataset (>90M rows), so doing top K on a single thread is inefficient:

SELECT SearchPhrase FROM hits WHERE SearchPhrase IS NOT NULL ORDER BY SearchPhrase LIMIT 10;

We should run top K in parallel, and then do a K-way merge on top of the gathered results. Besides that, we should support filter stealing similarly to how it's done by AsyncGroupBy* factories.

Refs: #4085 (that one is specific for sharded GROUP BY)

Describe the solution you'd like.

No response

Describe alternatives you've considered.

No response

Full Name:

Andrei Pechkurov

Affiliation:

QuestDB

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PerformancePerformance improvementsSQLIssues or changes relating to SQL execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions