pingcap / pingcap/tidb

topn and limit should be fully pushed down to tiflash

Open
#61,961 0 comments 1 reaction 0 assignees View on GitHub
component/tiflash sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
currently topn and limit can not be fully pushed down to tiflash, it still depend on root final partial one to do the collection work. But actually it may work since the similar window operator has already been fully pushed down due to the middle passThrough.
ref:
![Image](https://github.com/user-attachments/assets/d5889ae7-e971-40a2-8dcc-58559bc66d62)

the middle passThrough also works for topn and limit being fully pushed down to tiflash. And then, those check below can be eliminated.

![Image](https://github.com/user-attachments/assets/6cc95d41-f184-46d0-89cf-961d69ffd807)

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing fully pushed-down window operator with TopN and Limit, focusing on the middle passThrough behavior described in the issue. Trace the checks that currently prevent full TiFlash pushdown and confirm the expected behavior with relevant planner or integration tests; done means TopN and Limit no longer rely on the root final partial operator for collection.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.