Skip to content

adding benchmark query with lots of rows #1703

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Apply suggestions from code review
  • Loading branch information
methane authored Apr 22, 2025
commit e22950891d711f23933b7ce8f929a3fda4582163
5 changes: 2 additions & 3 deletions benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ func BenchmarkSelect10000rows(b *testing.B) {
return
}

b.StartTimer()
b.ResetTimer()
stmt, err := db.Prepare("SELECT * FROM seq_1_to_10000")
if err != nil {
b.Fatalf("Failed to prepare statement: %v", err)
}
defer stmt.Close()
for n := 0; n < b.N; n++ {
for range b.N {
rows, err := stmt.Query()
if err != nil {
b.Fatalf("Failed to query 10000rows: %v", err)
Expand All @@ -151,7 +151,6 @@ func BenchmarkSelect10000rows(b *testing.B) {
}
rows.Close()
}
b.StopTimer()
}

func BenchmarkExec(b *testing.B) {
Expand Down