Skip to content

executor, planner: refactor analyze tableID to analyzeTableID & add CanRuntimePrune#19846

Merged
ti-srebot merged 8 commits intopingcap:masterfrom
lysu:dev-tableids-and-switch-util
Sep 8, 2020
Merged

executor, planner: refactor analyze tableID to analyzeTableID & add CanRuntimePrune#19846
ti-srebot merged 8 commits intopingcap:masterfrom
lysu:dev-tableids-and-switch-util

Conversation

@lysu
Copy link
Contributor

@lysu lysu commented Sep 7, 2020

What problem does this PR solve?

split PR for #18717

Problem Summary:

  1. in new partition stats, we need to collect multiple partitions for a table and save results just as one table.
  2. we need a util method to decide to treat a table as new-version-stats or old-version-stats

What is changed and how it works?

What's Changed, How it Works:

this PRs has two commits

  1. in the first commit, we purely refactor analyze's table as anlayzeTableID{Persist, Collects}

so we can collect multiple partitions p1, p2, p3 and save as one table t1

  1. in the second commit, just add a util method
  • stmtctx.CanRuntimePrune: one DML can use new-partition when all touched partition has new stats(stats under tbl, or both tbl, phyTblID has no stats)
  • CanRuntimePrune*(): one table can be treated as new-partition when all touched partition has new stats(stats under tbl, or both tbl, phyTblID has no stats)

Related changes

  • n/a

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • n/a

Release note

  • No release note

This change is Reviewable

@github-actions github-actions bot added sig/execution SIG execution sig/sql-infra SIG: SQL Infra labels Sep 7, 2020
@lysu lysu marked this pull request as ready for review September 7, 2020 11:19
@lysu lysu requested review from a team as code owners September 7, 2020 11:19
@lysu lysu requested review from SunRunAway and removed request for a team September 7, 2020 11:19
@lysu lysu added status/PTAL and removed sig/sql-infra SIG: SQL Infra labels Sep 7, 2020
@lysu lysu changed the title executor, planner: refactor analyze tableID to analyzeTableID executor, planner: refactor analyze tableID to analyzeTableID & add CanRuntimePrune Sep 7, 2020
@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Sep 7, 2020
Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 8, 2020
@tiancaiamao
Copy link
Contributor

LGTM @lzmhhh123

Copy link
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

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 8, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Sep 8, 2020
@lzmhhh123
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 8, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lysu merge failed.

@lysu
Copy link
Contributor Author

lysu commented Sep 8, 2020

/run-sqllogic-test-1

@lysu
Copy link
Contributor Author

lysu commented Sep 8, 2020

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lysu merge failed.

@lysu
Copy link
Contributor Author

lysu commented Sep 8, 2020

/run-integration-common-test

@SunRunAway SunRunAway removed their request for review September 8, 2020 11:27
@tiancaiamao
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lysu merge failed.

@tiancaiamao
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@lysu merge failed.

@tiancaiamao
Copy link
Contributor

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/execution SIG execution sig/sql-infra SIG: SQL Infra 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