Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/sql/index_split_scatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/config"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
Expand Down Expand Up @@ -165,6 +166,12 @@ func TestIndexSplitAndScatterWithStats(t *testing.T) {
// Generate statistics for these tables.
if statsExist {
runner.Exec(t, "CREATE STATISTICS st FROM multi_column_split")
// Force a stats cache refresh on all nodes so
// MaybeSplitIndexSpans sees the new stats.
tableID := descpb.ID(sqlutils.QueryTableID(t, cluster.ServerConn(0), "defaultdb", "public", "multi_column_split"))
for i := 0; i < numNodes; i++ {
cluster.Server(i).ExecutorConfig().(sql.ExecutorConfig).TableStatsCache.InvalidateTableStats(ctx, tableID)
}
}
// Next create indexes on both tables.
splitHookEnabled.Store(true)
Expand Down
Loading