Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call For Participation: add memory trace for all the AggFuncs #19369

Closed
17 tasks done
b41sh opened this issue Aug 21, 2020 · 60 comments
Closed
17 tasks done

Call For Participation: add memory trace for all the AggFuncs #19369

b41sh opened this issue Aug 21, 2020 · 60 comments
Labels
challenge-program sig/execution SIG execution type/enhancement The issue or PR belongs to an enhancement.
Milestone

Comments

@b41sh
Copy link
Member

b41sh commented Aug 21, 2020

Description

This issue is used to track the memory usage of AggFunc in HashAggExec as discussed in #14705 and #14103.
We need to implement the method of the AggFunc interface and return memDelta to identify memory usage of each function.

type AggFunc interface {
	AllocPartialResult() (pr PartialResult, memDelta int64)
	UpdatePartialResult(sctx sessionctx.Context, rowsInGroup []chunk.Row, pr PartialResult) (memDelta int64, err error)
	MergePartialResult(sctx sessionctx.Context, src, dst PartialResult) (memDelta int64, err error)
}

All aggregation functions are shown below, you can choose the ones you are interested in.
Feel free to join us in the #sig-exec to discuss.

SIG slack channel

sig-exec

Score

  • 600

Mentor

Recommended Skills

  • SQL Optimization
  • Golang Profiling
  • Code Refactoring
@b41sh b41sh added the type/enhancement The issue or PR belongs to an enhancement. label Aug 21, 2020
@ekexium
Copy link
Member

ekexium commented Aug 22, 2020

/label sig/execution

@ti-srebot ti-srebot added the sig/execution SIG execution label Aug 22, 2020
@mmyj
Copy link
Member

mmyj commented Aug 23, 2020

pick sum agg functions

@mmyj
Copy link
Member

mmyj commented Aug 29, 2020

pick value agg functions

@AntiKnot
Copy link
Contributor

AntiKnot commented Sep 2, 2020

/pick-up count agg functions

@ti-challenge-bot
Copy link

Pick up success.

@ti-challenge-bot
Copy link

This issue os already picked by SailerNote.

4 similar comments
@ti-challenge-bot
Copy link

This issue os already picked by SailerNote.

@ti-challenge-bot
Copy link

This issue os already picked by SailerNote.

@ti-challenge-bot
Copy link

This issue os already picked by SailerNote.

@ti-challenge-bot
Copy link

This issue os already picked by SailerNote.

@xiaodong-ji
Copy link
Contributor

pick max min agg functions

@AntiKnot
Copy link
Contributor

AntiKnot commented Sep 3, 2020

pick count agg functions

@cloudhuang
Copy link

cloudhuang commented Sep 3, 2020

pick group concat agg functions

@ti-challenge-bot
Copy link

This issue os already picked by SailerNote.

@asiafrank
Copy link
Contributor

/pick-up row number agg functions

@AntiKnot
Copy link
Contributor

AntiKnot commented Sep 3, 2020

/give-up

@ti-challenge-bot ti-challenge-bot bot removed the picked label Sep 3, 2020
@ti-challenge-bot
Copy link

Give up success.

@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Sep 3, 2020

@TszKitLo40 @howie66 @asiafrank @xiaodong-ji
Hi, you can pick up the sub-tasks now.

@Hunsmore
Copy link
Contributor

Hunsmore commented Sep 4, 2020

/pick-up value agg functions

@ti-challenge-bot
Copy link

It is not a pickable issue!

@b41sh
Copy link
Member Author

b41sh commented Sep 4, 2020

@Hunsmore value agg functions have picked up success

@Rustin170506
Copy link
Member

/pick-up

@ti-challenge-bot
Copy link

It is not a pickable issue!

More

Tip : If you want this issue to be picked, you need to add a challenge-program label to it.

Warning: None

@qw4990
Copy link
Contributor

qw4990 commented Oct 15, 2020

Can we close this issue since all tasks have been finished? @b41sh

@b41sh
Copy link
Member Author

b41sh commented Oct 15, 2020

Can we close this issue since all tasks have been finished? @b41sh

yes, we can finish it.

@b41sh b41sh closed this as completed Oct 15, 2020
@SunRunAway
Copy link
Contributor

SunRunAway commented Oct 19, 2020

@b41sh Could you provide a test report showing that your job work?

We can set up a test environment and run some testing aggregation queries. And the job can be proven by the following two points

  1. During the execution of a long-running SQL, we can monitor the heap usage in grafana and SQL's memory usage in the show processlist at the same time. Give a comparison chart to show that the memory statistics shown in processlist are close to the memory used by the go language.
  2. By setting an appropriate mem-query-quota, a query that consumes a lot of memory will eventually be killed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program sig/execution SIG execution type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests