Skip to content

Commit

Permalink
Add benchmark for large query results
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick authored and losipiuk committed Sep 22, 2022
1 parent fc922c0 commit a532a94
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions trino/trino_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1385,3 +1385,29 @@ func TestSlice3TypeConversion(t *testing.T) {
})
}
}

func BenchmarkQuery(b *testing.B) {
c := &Config{
ServerURI: *integrationServerFlag,
SessionProperties: map[string]string{"query_priority": "1"},
}

dsn, err := c.FormatDSN()
require.NoError(b, err)

db, err := sql.Open("trino", dsn)
require.NoError(b, err)

b.Cleanup(func() {
assert.NoError(b, db.Close())
})

q := `SELECT * FROM tpch.sf1.orders LIMIT 10000000`
for n := 0; n < b.N; n++ {
rows, err := db.Query(q)
require.NoError(b, err)
for rows.Next() {
}
rows.Close()
}
}

0 comments on commit a532a94

Please sign in to comment.