pingcap / pingcap/tiflash

Support automatically enable the consecutive cache of HashMap for HashAgg

Open
#8,939 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Enhancement

Consecutive cache of HashMap: check code: https://github.com/pingcap/tiflash/blob/93d739565b3ed14767e069c7a5453e283d239854/dbms/src/Common/ColumnsHashingImpl.h#L212

It's useful when consecutive same key inserting into HashMap, because the cache avoid search HashMap.

But if NDV is big(a.k.a. all keys are different), the consecutive cache is useless and there will be extra copy of key.

So we should detect the NDV automatically and decide whether to use consecutive cache by the workload.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with dbms/src/Common/ColumnsHashingImpl.h around line 212 and trace how HashAgg uses the consecutive HashMap cache. Compare workloads with repeated keys and high NDV, then define and validate automatic selection so caching helps repeated keys without unnecessary key copies when keys are mostly distinct.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.