pingcap / pingcap/tidb

Avoid some obj allocations when table stats only updates its count and modify count

Open
#59,089 1 comment 0 reactions 0 assignees View on GitHub
sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

We'll call `statistics.Table::Copy` even if we only update its count/modify_count. The `Copy` will do deep clone of each object inside the `Table`.

This can be improved to reduce the pressure on golang's memory control.

Contributor guide

Open the contributing guide

Research direction

Start by locating statistics.Table::Copy and the code path that updates only count and modify_count. Trace how Copy deep-clones the table objects, then determine the existing behavior that must remain unchanged while reducing allocations; validate the result with the relevant statistics tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.