Skip to content

Commit

Permalink
Addition of a macro benchmark for values join
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Feb 13, 2025
1 parent f534a4c commit 910796a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion go/test/endtoend/vtgate/queries/misc/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"vitess.io/vitess/go/test/endtoend/utils"
)

func start(t *testing.T) (utils.MySQLCompare, func()) {
func start(t testing.TB) (utils.MySQLCompare, func()) {
mcmp, err := utils.NewMySQLCompare(t, vtParams, mysqlParams)
require.NoError(t, err)

Expand All @@ -53,6 +53,22 @@ func start(t *testing.T) (utils.MySQLCompare, func()) {
}
}

func BenchmarkValuesJoin(b *testing.B) {
mcmp, closer := start(b)
defer closer()

for i := 0; i < 200; i++ {
mcmp.Exec(fmt.Sprintf("insert into t1(id1, id2) values (%d, %d)", i, i))
mcmp.Exec(fmt.Sprintf("insert into tbl(id, unq_col, nonunq_col) values (%d, %d, %d)", i, i, i))
}

b.Run("Simple Joins", func(b *testing.B) {
for range b.N {
mcmp.Exec("select t1.id1, tbl.id from t1, tbl where t1.id2 = tbl.nonunq_col")
}
})
}

func TestBitVals(t *testing.T) {
mcmp, closer := start(t)
defer closer()
Expand Down

0 comments on commit 910796a

Please sign in to comment.