perf: no longer window sort when limit (#7912)

* perf: no longer window sort when limit

Signed-off-by: discord9 <discord9@163.com>

* test: confusing vector sqlness

Signed-off-by: discord9 <discord9@163.com>

* chore: redact sqlness

Signed-off-by: discord9 <discord9@163.com>

* chore: redact every thing

Signed-off-by: discord9 <discord9@163.com>

* REDACTED

Signed-off-by: discord9 <discord9@163.com>

* what

Signed-off-by: discord9 <discord9@163.com>

---------

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2026-04-08 10:54:22 +08:00
committed by GitHub
parent 6e0f5c5042
commit b623cb1aa2
9 changed files with 46 additions and 44 deletions

View File

@@ -94,6 +94,8 @@ impl WindowedSortPhysicalRule {
&& scanner_info
.time_index
.contains(input_schema.field(column_expr.index()).name())
&& sort_exec.fetch().is_none()
// skip if there is a limit, as dyn filter along is good enough in this case
{
} else {
return Ok(Transformed::no(plan));

View File

@@ -237,14 +237,10 @@ impl ExecutionPlan for PartSortExec {
} else {
internal_err!("No children found")?
};
// create a new dynamic filter when with_new_children, as the old filter is bound to the old input and cannot be reused
let new = Self::try_new(
self.expression.clone(),
self.limit,
self.partition_ranges.clone(),
new_input.clone(),
)?;
Ok(Arc::new(new))
let mut new_exec = self.as_ref().clone();
new_exec.input = new_input.clone();
new_exec.properties = new_input.properties().clone();
Ok(Arc::new(new_exec))
}
fn execute(