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

Function BenchmarkCreateIndexStatementPool

pkg/sql/ast/pool_ddl_test.go:997–1014  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

995}
996
997func BenchmarkCreateIndexStatementPool(b *testing.B) {
998 b.Run("GetPutCreateIndexStatement", func(b *testing.B) {
999 b.ReportAllocs()
1000 for i := 0; i < b.N; i++ {
1001 stmt := GetCreateIndexStatement()
1002 stmt.Name = "idx_email"
1003 stmt.Table = "users"
1004 stmt.Unique = true
1005 stmt.Columns = append(stmt.Columns, IndexColumn{Column: "email", Direction: "ASC"})
1006 stmt.Where = &BinaryExpression{
1007 Left: &Identifier{Name: "active"},
1008 Operator: "=",
1009 Right: &LiteralValue{Value: "true"},
1010 }
1011 PutCreateIndexStatement(stmt)
1012 }
1013 })
1014}
1015
1016func BenchmarkDropStatementPool(b *testing.B) {
1017 b.Run("GetPutDropStatement", func(b *testing.B) {

Callers

nothing calls this directly

Calls 3

GetCreateIndexStatementFunction · 0.85
PutCreateIndexStatementFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected