You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// test the privilege of user with privilege of test.t1 for information_schema.analyze_status
327
327
tk.MustExec("create table t1 (a int, b int, index idx(a))")
328
328
tk.MustExec("insert into t1 values (1,2),(3,4)")
329
-
tk.MustExec("analyze table t1")
329
+
tk.MustExec("analyze table t1 all columns")
330
330
tk.MustQuery("show warnings").Check(testkit.Rows("Note 1105 Analyze use auto adjusted sample rate 1.000000 for table test.t1, reason to use this rate is \"use min(1, 110000/10000) as the sample-rate=1\"")) // 1 note.
result:=tk.MustQuery("show stats_meta where table_name = 't'")
506
509
require.Equal(t, "220000", result.Rows()[0][5])
507
510
tk.MustExec("analyze table t")
508
-
tk.MustQuery("show warnings").Check(testkit.Rows("Note 1105 Analyze use auto adjusted sample rate 0.500000 for table test.t, reason to use this rate is \"use min(1, 110000/220000) as the sample-rate=0.5\""))
511
+
tk.MustQuery("show warnings").Check(testkit.Rows(
512
+
"Warning 1105 No predicate column has been collected yet for table test.t, so only indexes and the columns composing the indexes will be analyzed",
513
+
"Note 1105 Analyze use auto adjusted sample rate 0.500000 for table test.t, reason to use this rate is \"use min(1, 110000/220000) as the sample-rate=0.5\"",
result=tk.MustQuery("show stats_meta where table_name = 't'")
513
519
require.Equal(t, "3", result.Rows()[0][5])
514
520
tk.MustExec("analyze table t")
515
-
tk.MustQuery("show warnings").Check(testkit.Rows("Note 1105 Analyze use auto adjusted sample rate 1.000000 for table test.t, reason to use this rate is \"use min(1, 110000/3) as the sample-rate=1\""))
521
+
tk.MustQuery("show warnings").Check(testkit.Rows(
522
+
"Warning 1105 No predicate column has been collected yet for table test.t, so only indexes and the columns composing the indexes will be analyzed",
523
+
"Note 1105 Analyze use auto adjusted sample rate 1.000000 for table test.t, reason to use this rate is \"use min(1, 110000/3) as the sample-rate=1\"",
tk.MustQuery("show warnings").Check(testkit.Rows("Note 1105 Analyze use auto adjusted sample rate 1.000000 for table test.small_table_inject_pd, reason to use this rate is \"use min(1, 110000/10000) as the sample-rate=1\""))
"Note 1105 Analyze use auto adjusted sample rate 1.000000 for table test.small_table_inject_pd_with_partition's partition p0, reason to use this rate is \"use min(1, 110000/10000) as the sample-rate=1\"",
0 commit comments