cockroach: github.com/cockroachdb/cockroach/pkg/workload/workloadsql Index | Files

package workloadsql

import "github.com/cockroachdb/cockroach/pkg/workload/workloadsql"

Index

Package Files

dataload.go workloadsql.go

func Setup Uses

func Setup(
    ctx context.Context, db *gosql.DB, gen workload.Generator, l workload.InitialDataLoader,
) (int64, error)

Setup creates the given tables and fills them with initial data.

The size of the loaded data is returned in bytes, suitable for use with SetBytes of benchmarks. The exact definition of this is deferred to the InitialDataLoader implementation.

func Split Uses

func Split(ctx context.Context, db *gosql.DB, table workload.Table, concurrency int) error

Split creates the range splits defined by the given table.

func StringTuple Uses

func StringTuple(datums []interface{}) []string

StringTuple returns the given datums as strings suitable for use in directly in SQL.

TODO(dan): Remove this once SCATTER supports placeholders.

type InsertsDataLoader Uses

type InsertsDataLoader struct {
    BatchSize   int
    Concurrency int
}

InsertsDataLoader is an InitialDataLoader implementation that loads data with batched INSERTs. The zero-value gets some sane defaults for the tunable settings.

func (InsertsDataLoader) InitialDataLoad Uses

func (l InsertsDataLoader) InitialDataLoad(
    ctx context.Context, db *gosql.DB, gen workload.Generator,
) (int64, error)

InitialDataLoad implements the InitialDataLoader interface.

Package workloadsql imports 17 packages (graph) and is imported by 8 packages. Updated 2019-08-17. Refresh now. Tools for package owners.