MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / buildWideSelect

Function buildWideSelect

pkg/sql/parser/wide_select_bench_test.go:25–36  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

23)
24
25func buildWideSelect(n int) string {
26 var sb strings.Builder
27 sb.WriteString("SELECT ")
28 for i := 0; i < n; i++ {
29 if i > 0 {
30 sb.WriteString(", ")
31 }
32 fmt.Fprintf(&sb, "col%d", i)
33 }
34 sb.WriteString(" FROM t")
35 return sb.String()
36}
37
38func benchmarkWideSelect(b *testing.B, numCols int) {
39 sql := buildWideSelect(numCols)

Callers 1

benchmarkWideSelectFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected