pingcap / pingcap/tidb

Dumpling support export with partation flag

Open
#67,619 0 comments 0 reactions 0 assignees View on GitHub
type/feature-request
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Feature Request

**Is your feature request related to a problem? Please describe:**

One user (TiDB Cloud User) wants to export one partition from a large partition table (10TiB+) by specifying `where dt = xxx` which dt is the partition field. But he got a bad performance and high cpu usage of TiKV.

Reason:

Export previously depended on `TABLESAMPLE REGIONS()` to sample the whole table first and then combine the sampled boundaries with user-specified where conditions to generate chunked export SQLs.

This works acceptably for normal tables, but for partitioned tables, it becomes inefficient when users only want to export one or a few partitions, because sampling still happens on the full table and produces many chunks that do not belong to the target partitions.

As a result, most of the chunk tasks just scan the tikv but return nothing.

**Describe the feature you'd like:**

**Describe alternatives you've considered:**

**Teachability, Documentation, Adoption, Migration Strategy:**

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.