pingcap / pingcap/tidb

Optimize performance for `UnionScanExec` and `MemBuffer`

Open
#43,249 3 comments 0 reactions 1 assignee Claimed by @tiancaiamao View on GitHub
sig/execution sig/sql-infra type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

The UnionScan is not very efficient, for example:

- UnionScanExec will filter all rows/indexes in `Open` instead of `Next`. It will take more time when the SQL has a `LIMIT` because `Open` will not considerate it.
- Maybe we can implement`MemBuffer` more efficient.

The union scan's performance will affect the performance of temporary table, cached table and queries in a txn with a lot of uncommitted rows.

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.