Skip to content

Commit

Permalink
Merge pull request #5796 from cockroachdb/20191106-collect-stats-on-t…
Browse files Browse the repository at this point in the history
…able-creation

Note that stats are collected on table creation
  • Loading branch information
rmloveland authored Nov 8, 2019
2 parents c7edc94 + 7a7ecb8 commit 94fa5f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v19.2/cost-based-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The most important factor in determining the quality of a plan is cardinality (i

The cost-based optimizer can often find more performant query plans if it has access to statistical data on the contents of your tables. This data needs to be generated from scratch for new tables, and regenerated periodically for existing tables.

By default, CockroachDB generates table statistics automatically as tables are updated. It does this [using a background job](create-statistics.html#view-statistics-jobs) that automatically determines which columns to get statistics on — specifically, it chooses:
By default, CockroachDB generates table statistics automatically when tables are [created](create-table.html), and as they are [updated](update.html). It does this [using a background job](create-statistics.html#view-statistics-jobs) that automatically determines which columns to get statistics on — specifically, it chooses:

- Columns that are part of the primary key or an index (in other words, all indexed columns).
- Up to 100 non-indexed columns.
Expand Down

0 comments on commit 94fa5f1

Please sign in to comment.