Skip to content
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

[no-release-notes] range select perf bump #8241

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0
github.com/creasty/defaults v1.6.0
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.18.2-0.20240808231249-e035ac0ed25a
github.com/dolthub/go-mysql-server v0.18.2-0.20240809165501-0c2c92edc6d6
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63
github.com/dolthub/swiss v0.1.0
github.com/goccy/go-json v0.10.2
Expand Down
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
github.com/dolthub/go-mysql-server v0.18.2-0.20240808231249-e035ac0ed25a h1:t5lkm+LGwj8xnDs+jiONt26fAhtWG/Blk0Ucvr8gN8w=
github.com/dolthub/go-mysql-server v0.18.2-0.20240808231249-e035ac0ed25a/go.mod h1:PwuemL+YK+YiWcUFhknixeqNLjJNfCx7KDsHNajx9fM=
github.com/dolthub/go-mysql-server v0.18.2-0.20240809165501-0c2c92edc6d6 h1:SVETE5WbJ42MplV5uxMGI4Ntf86WCv5llv9X7Qe/vJM=
github.com/dolthub/go-mysql-server v0.18.2-0.20240809165501-0c2c92edc6d6/go.mod h1:PwuemL+YK+YiWcUFhknixeqNLjJNfCx7KDsHNajx9fM=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=
Expand Down
6 changes: 3 additions & 3 deletions go/libraries/doltcore/sqle/database_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1289,12 +1289,12 @@ func (p *DoltDatabaseProvider) SessionDatabase(ctx *sql.Context, name string) (d
}

// Function implements the FunctionProvider interface
func (p *DoltDatabaseProvider) Function(_ *sql.Context, name string) (sql.Function, error) {
func (p *DoltDatabaseProvider) Function(_ *sql.Context, name string) (sql.Function, bool) {
fn, ok := p.functions[strings.ToLower(name)]
if !ok {
return nil, sql.ErrFunctionNotFound.New(name)
return nil, false
}
return fn, nil
return fn, true
}

func (p *DoltDatabaseProvider) Register(d sql.ExternalStoredProcedureDetails) {
Expand Down
16 changes: 16 additions & 0 deletions go/performance/microsysbench/sysbench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ func BenchmarkSelectRandomPoints(b *testing.B) {
})
}

func BenchmarkSelectRandomRanges(b *testing.B) {
benchmarkSysbenchQuery(b, func(int) string {
var sb strings.Builder
sb.Grow(120)
sb.WriteString("SELECT count(k) FROM sbtest1 WHERE ")
sep := ""
for i := 1; i < 10; i++ {
start := rand.Intn(tableSize)
fmt.Fprintf(&sb, "%sk between %s and %s", sep, strconv.Itoa(start), strconv.Itoa(start+5))
sep = " OR "
}
sb.WriteString(";")
return sb.String()
})
}

func benchmarkSysbenchQuery(b *testing.B, getQuery func(int) string) {
ctx, eng := setupBenchmark(b, dEnv)
for i := 0; i < b.N; i++ {
Expand Down
Loading