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

executor: little improvement for multi-delete. #4742

Merged
merged 9 commits into from Oct 11, 2017

Conversation

Projects
None yet
4 participants
@winoros
Copy link
Member

winoros commented Oct 10, 2017

Some calculation can be moved outside the for loop.
PTAL @hanfei1991 @coocood @lamxTyler

@@ -193,6 +200,18 @@ func (e *DeleteExec) deleteMultiTables() error {
for _, t := range e.Tables {
tblMap[t.TableInfo.ID] = append(tblMap[t.TableInfo.ID], t)
}
var colPosInfos []tblColPosInfo
for id, cols := range e.SelectExec.Schema().TblID2Handle {

This comment has been minimized.

@shenli

shenli Oct 11, 2017

Member

Could you add comment for the loop?

@shenli
Copy link
Member

shenli left a comment

Rest LGTM

@shenli

This comment has been minimized.

Copy link
Member

shenli commented Oct 11, 2017

/run-all-tests

for id, cols := range e.SelectExec.Schema().TblID2Handle {
tbl := e.tblID2Table[id]
for _, col := range cols {
if names, ok := tblMap[id]; !ok || !isMatchTableName(names, col) {

This comment has been minimized.

@coocood

coocood Oct 11, 2017

Member

isMatchTableName is only used in this function, so this name is too general.
I think make it a method of DeleteExec and move rename to isDeletingTable is better.

if !e.isDeletingTable(tbleMap, col) {
    continue
}

Would be more clear.

@winoros

This comment has been minimized.

Copy link
Member

winoros commented Oct 11, 2017

@shenli

This comment has been minimized.

Copy link
Member

shenli commented Oct 11, 2017

LGTM

zz-jason and others added some commits Oct 11, 2017

@coocood
Copy link
Member

coocood left a comment

LGTM

@coocood coocood merged commit f2f473d into master Oct 11, 2017

3 of 4 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@coocood coocood deleted the yiding/multi-delete branch Oct 11, 2017

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