Skip to content

Commit

Permalink
decrease query number
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuo-zhi committed May 13, 2021
1 parent f68207f commit 0449db5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions executor/partition_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (s *partitionTableSuite) TestOrderByandLimit(c *C) {
tk.MustExec("insert into tregular values " + strings.Join(vals, ","))

// test indexLookUp
for i := 0; i < 2000; i++ {
for i := 0; i < 100; i++ {
// explain select * from t where a > {y} use index(idx_a) order by a limit {x}; // check if IndexLookUp is used
// select * from t where a > {y} use index(idx_a) order by a limit {x}; // it can return the correct result
x := rand.Intn(1099)
Expand All @@ -271,7 +271,7 @@ func (s *partitionTableSuite) TestOrderByandLimit(c *C) {
}

// test tableReader
for i := 0; i < 2000; i++ {
for i := 0; i < 100; i++ {
// explain select * from t where a > {y} ignore index(idx_a) order by a limit {x}; // check if IndexLookUp is used
// select * from t where a > {y} ignore index(idx_a) order by a limit {x}; // it can return the correct result
x := rand.Intn(1099)
Expand All @@ -283,7 +283,7 @@ func (s *partitionTableSuite) TestOrderByandLimit(c *C) {
}

// test indexReader
for i := 0; i < 2000; i++ {
for i := 0; i < 100; i++ {
// explain select a from t where a > {y} use index(idx_a) order by a limit {x}; // check if IndexLookUp is used
// select a from t where a > {y} use index(idx_a) order by a limit {x}; // it can return the correct result
x := rand.Intn(1099)
Expand All @@ -295,7 +295,7 @@ func (s *partitionTableSuite) TestOrderByandLimit(c *C) {
}

// test indexMerge
for i := 0; i < 2000; i++ {
for i := 0; i < 100; i++ {
// explain select /*+ use_index_merge(t) */ * from t where a > 2 or b < 5 order by a limit {x}; // check if IndexMerge is used
// select /*+ use_index_merge(t) */ * from t where a > 2 or b < 5 order by a limit {x}; // can return the correct value
y := rand.Intn(2000) + 1
Expand Down

0 comments on commit 0449db5

Please sign in to comment.