We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#50389 introduce pipelined DML, we can enhancement the performance in some situation. See following test:
func TestPipelinedDMLInsertRPC(t *testing.T) { store := realtikvtest.CreateMockStoreAndSetup(t) tk := testkit.NewTestKit(t, store) tk.MustExec("use test") tk.MustExec("drop table if exists t1") tk.MustExec("create table t1 (a int, b int, unique index idx(b))") res := tk.MustQuery("explain analyze insert ignore into t1 values (1,1), (2,2), (3,3), (4,4), (5,5)") explain := getExplainResult(res) require.Regexp(t, "Insert.* check_insert: {total_time: .* rpc:{BatchGet:{num_rpc:1, total_time:.*}}}.*", explain) tk.MustExec("set session tidb_dml_type = bulk") res = tk.MustQuery("explain analyze insert ignore into t1 values (1,1), (2,2), (3,3), (4,4), (5,5)") explain = getExplainResult(res) // TODO: try to optimize the rpc count, when use bulk dml, insert ignore will use 5 BufferBatchGet and 1 BatchGet rpcs. // but without bulk dml, it will only use 1 BatchGet rpcs. require.Regexp(t, "Insert.* check_insert: {total_time: .* rpc:{.*BufferBatchGet:{num_rpc:5, total_time:.*}}}.*", explain) require.Regexp(t, "Insert.* check_insert: {total_time: .* rpc:{.*BatchGet:{num_rpc:1, total_time:.*}}}.*", explain) tk.MustExec("delete from t1") } func getExplainResult(res *testkit.Result) string { resBuff := bytes.NewBufferString("") for _, row := range res.Rows() { _, _ = fmt.Fprintf(resBuff, "%s\t", row) } return resBuff.String() }
The text was updated successfully, but these errors were encountered:
txn: save RPCs for Pipelined-DML (#51652)
b3cb95d
close #51625
Successfully merging a pull request may close this issue.
Enhancement
#50389 introduce pipelined DML, we can enhancement the performance in some situation. See following test:
The text was updated successfully, but these errors were encountered: