cockroach: Index | Files

package workloadsql

import ""


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 18 packages (graph) and is imported by 16 packages. Updated 2020-08-13. Refresh now. Tools for package owners.