Skip to content

executor: revert mostly changes in #11678 (#12481)#12770

Merged
sre-bot merged 3 commits into
pingcap:release-3.0from
sre-bot:release-3.0-609b52998f13
Oct 17, 2019
Merged

executor: revert mostly changes in #11678 (#12481)#12770
sre-bot merged 3 commits into
pingcap:release-3.0from
sre-bot:release-3.0-609b52998f13

Conversation

@sre-bot
Copy link
Copy Markdown
Contributor

@sre-bot sre-bot commented Oct 16, 2019

cherry-pick #12481 to release-3.0


What problem does this PR solve?

(a following PR for #12480)
After #12480, we do not need to copy row data in window functions.

What is changed and how it works?

Revert mostly changes in #11678, and get the performance loss back.

name                                                           old time/op    new time/op    delta
WindowRows/(func:row_number,_ndv:10,_rows:1000)-12               92.9µs ±13%    86.0µs ± 7%     ~     (p=0.310 n=5+5)
WindowRows/(func:row_number,_ndv:1000,_rows:1000)-12              202µs ± 5%     230µs ± 8%  +13.65%  (p=0.008 n=5+5)
WindowRows/(func:row_number,_ndv:10,_rows:100000)-12             8.24ms ± 1%    8.37ms ± 3%     ~     (p=0.310 n=5+5)
WindowRows/(func:row_number,_ndv:1000,_rows:100000)-12           8.53ms ± 1%    8.60ms ± 0%   +0.92%  (p=0.032 n=5+5)
WindowFunctions/(func:row_number,_ndv:1000,_rows:100000)-12      8.58ms ± 1%    8.59ms ± 2%     ~     (p=1.000 n=5+5)
WindowFunctions/(func:rank,_ndv:1000,_rows:100000)-12            11.8ms ± 2%     9.2ms ± 1%  -22.03%  (p=0.008 n=5+5)
WindowFunctions/(func:dense_rank,_ndv:1000,_rows:100000)-12      11.8ms ± 1%     9.2ms ± 1%  -22.36%  (p=0.008 n=5+5)
WindowFunctions/(func:cume_dist,_ndv:1000,_rows:100000)-12       12.2ms ± 1%     9.4ms ± 1%  -23.20%  (p=0.008 n=5+5)
WindowFunctions/(func:percent_rank,_ndv:1000,_rows:100000)-12    11.9ms ± 1%     9.4ms ± 1%  -21.40%  (p=0.008 n=5+5)
WindowFunctions/(func:ntile,_ndv:1000,_rows:100000)-12           8.70ms ± 0%    8.72ms ± 1%     ~     (p=1.000 n=5+5)
WindowFunctions/(func:lead,_ndv:1000,_rows:100000)-12            13.3ms ± 1%    10.5ms ± 1%  -20.79%  (p=0.008 n=5+5)
WindowFunctions/(func:lag,_ndv:1000,_rows:100000)-12             13.0ms ± 2%    10.4ms ± 1%  -19.48%  (p=0.008 n=5+5)
WindowFunctions/(func:first_value,_ndv:1000,_rows:100000)-12     8.97ms ± 1%    9.00ms ± 5%     ~     (p=1.000 n=5+5)
WindowFunctions/(func:last_value,_ndv:1000,_rows:100000)-12      8.90ms ± 1%    9.04ms ± 2%   +1.59%  (p=0.008 n=5+5)
WindowFunctions/(func:nth_value,_ndv:1000,_rows:100000)-12       8.96ms ± 1%    9.14ms ± 2%     ~     (p=0.056 n=5+5)

name                                                           old alloc/op   new alloc/op   delta
WindowRows/(func:row_number,_ndv:10,_rows:1000)-12               82.5kB ± 0%    82.5kB ± 0%     ~     (all equal)
WindowRows/(func:row_number,_ndv:1000,_rows:1000)-12              105kB ± 1%     106kB ± 0%     ~     (p=0.151 n=5+5)
WindowRows/(func:row_number,_ndv:10,_rows:100000)-12             12.1MB ± 0%    12.1MB ± 0%     ~     (p=0.254 n=4+5)
WindowRows/(func:row_number,_ndv:1000,_rows:100000)-12           7.96MB ± 0%    7.97MB ± 0%     ~     (p=0.230 n=5+5)
WindowFunctions/(func:row_number,_ndv:1000,_rows:100000)-12      7.97MB ± 0%    7.97MB ± 0%     ~     (p=1.000 n=5+5)
WindowFunctions/(func:rank,_ndv:1000,_rows:100000)-12            14.0MB ± 0%     8.0MB ± 0%  -43.08%  (p=0.008 n=5+5)
WindowFunctions/(func:dense_rank,_ndv:1000,_rows:100000)-12      14.0MB ± 0%     8.0MB ± 0%  -43.07%  (p=0.008 n=5+5)
WindowFunctions/(func:cume_dist,_ndv:1000,_rows:100000)-12       14.0MB ± 0%     8.0MB ± 0%  -43.07%  (p=0.008 n=5+5)
WindowFunctions/(func:percent_rank,_ndv:1000,_rows:100000)-12    14.0MB ± 0%     8.0MB ± 0%  -43.10%  (p=0.008 n=5+5)
WindowFunctions/(func:ntile,_ndv:1000,_rows:100000)-12           7.97MB ± 0%    7.97MB ± 0%     ~     (p=0.079 n=4+5)
WindowFunctions/(func:lead,_ndv:1000,_rows:100000)-12            9.57MB ± 0%    7.97MB ± 0%  -16.71%  (p=0.008 n=5+5)
WindowFunctions/(func:lag,_ndv:1000,_rows:100000)-12             9.60MB ± 0%    7.97MB ± 0%  -16.90%  (p=0.008 n=5+5)
WindowFunctions/(func:first_value,_ndv:1000,_rows:100000)-12     7.96MB ± 0%    7.97MB ± 0%     ~     (p=0.262 n=5+5)
WindowFunctions/(func:last_value,_ndv:1000,_rows:100000)-12      7.97MB ± 0%    7.96MB ± 0%     ~     (p=0.294 n=5+5)
WindowFunctions/(func:nth_value,_ndv:1000,_rows:100000)-12       7.97MB ± 0%    7.97MB ± 0%     ~     (p=0.452 n=5+5)

name                                                           old allocs/op  new allocs/op  delta
WindowRows/(func:row_number,_ndv:10,_rows:1000)-12                  162 ± 0%       162 ± 0%     ~     (all equal)
WindowRows/(func:row_number,_ndv:1000,_rows:1000)-12              1.68k ± 1%     1.68k ± 0%     ~     (p=1.000 n=5+5)
WindowRows/(func:row_number,_ndv:10,_rows:100000)-12              5.17k ± 0%     5.17k ± 0%     ~     (p=0.238 n=4+5)
WindowRows/(func:row_number,_ndv:1000,_rows:100000)-12            14.1k ± 0%     14.1k ± 0%     ~     (p=0.175 n=5+5)
WindowFunctions/(func:row_number,_ndv:1000,_rows:100000)-12       14.1k ± 0%     14.1k ± 0%     ~     (p=1.000 n=5+5)
WindowFunctions/(func:rank,_ndv:1000,_rows:100000)-12             33.1k ± 0%     14.1k ± 0%  -57.38%  (p=0.008 n=5+5)
WindowFunctions/(func:dense_rank,_ndv:1000,_rows:100000)-12       33.1k ± 0%     14.1k ± 0%  -57.38%  (p=0.008 n=5+5)
WindowFunctions/(func:cume_dist,_ndv:1000,_rows:100000)-12        33.1k ± 0%     14.1k ± 0%  -57.38%  (p=0.008 n=5+5)
WindowFunctions/(func:percent_rank,_ndv:1000,_rows:100000)-12     33.1k ± 0%     14.1k ± 0%  -57.38%  (p=0.008 n=5+5)
WindowFunctions/(func:ntile,_ndv:1000,_rows:100000)-12            14.1k ± 0%     14.1k ± 0%     ~     (p=0.079 n=4+5)
WindowFunctions/(func:lead,_ndv:1000,_rows:100000)-12              114k ± 0%       14k ± 0%  -87.63%  (p=0.008 n=5+5)
WindowFunctions/(func:lag,_ndv:1000,_rows:100000)-12               115k ± 0%       14k ± 0%  -87.74%  (p=0.008 n=5+5)
WindowFunctions/(func:first_value,_ndv:1000,_rows:100000)-12      14.1k ± 0%     14.1k ± 0%     ~     (p=0.262 n=5+5)
WindowFunctions/(func:last_value,_ndv:1000,_rows:100000)-12       14.1k ± 0%     14.1k ± 0%     ~     (p=0.294 n=5+5)
WindowFunctions/(func:nth_value,_ndv:1000,_rows:100000)-12        14.1k ± 0%     14.1k ± 0%     ~     (p=0.452 n=5+5)

Check List

Tests

  • None

Code changes

  • None

Side effects

  • None

Related changes

  • None

Release note

  • None

@sre-bot
Copy link
Copy Markdown
Contributor Author

sre-bot commented Oct 16, 2019

/run-all-tests

Copy link
Copy Markdown
Contributor

@alivxxx alivxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eurekaka eurekaka added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Oct 17, 2019
@sre-bot
Copy link
Copy Markdown
Contributor Author

sre-bot commented Oct 17, 2019

Your auto merge job has been accepted, waiting for 12771

@sre-bot
Copy link
Copy Markdown
Contributor Author

sre-bot commented Oct 17, 2019

/run-all-tests

@sre-bot sre-bot merged commit 150dd34 into pingcap:release-3.0 Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants