Skip to content

Conversation

@taroface
Copy link
Contributor

@taroface taroface commented Jan 8, 2026

DOC-14809
DOC-11635
DOC-10969
DOC-10915
DOC-12760

Improve our partial statistics docs as follows:

  • Document partial statistics on the optimizer page
  • Add partial stats examples to CREATE STATISTICS page
  • Document missing session settings and table storage parameters
  • Reorganize how table stats (full, partial, forecasted) are presented on the optimizer page

These updates apply to 23.2-26.1, according to the following feature timeline (please call out if incorrect):

Version Feature / Milestone Default Behavior Updated Settings
≤ v24.2 Manual partial statistics available but disabled by default Partial stats must be explicitly enabled; optimizer has no merged partial stats support enable_create_stats_using_extremes = off (session)
v24.3 Manual partial statistics via USING EXTREMES enabled by default Optimizer can use partial stats (off by default) enable_create_stats_using_extremes = on (session); optimizer_use_merged_partial_statistics = off (session)
v25.1 Automatic partial statistics collection introduced Automatic partial stats collection on by default sql.stats.automatic_partial_collection.enabled = true; sql.stats.automatic_partial_collection.min_stale_rows = 100; sql.stats.automatic_partial_collection.fraction_stale_rows = 0.05; table-level equivalents
v25.2 Optimizer uses merged partial statistics by default; independent full/partial control Optimizer merges partial stats by default; full and partial auto-collection independently configurable optimizer_use_merged_partial_statistics = on; sql.stats.automatic_partial_collection.enabled = true; sql.stats.automatic_full_collection.enabled = true; table-level equivalents
v25.4 Predicate-based partial statistics (WHERE) Partial statistics can be manually collected using WHERE

Docs to review (v26.1; please use the version dropdown menu to change versions):

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 6ece21c
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/6980dbbbadde820008e8cbb8

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 6ece21c
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/6980dbbbb6778b0008d6ac6e

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Files changed:

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 38dbdab
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/695fd90114fc6100089138af

@netlify
Copy link

netlify bot commented Jan 8, 2026

Netlify Preview

Name Link
🔨 Latest commit 6ece21c
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6980dbbbfb0afe00086a2e82
😎 Deploy Preview https://deploy-preview-22087--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@taroface taroface force-pushed the partial-stats branch 2 times, most recently from 8cf6c99 to c477e0e Compare January 8, 2026 17:57
@taroface taroface requested a review from rytaft January 9, 2026 19:01
Copy link
Contributor

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for all this work! Just a few comments.

CREATE INDEX ON rides (start_time);
~~~

Partial statistics are particularly valuable for timestamp columns where workloads commonly access the most recent data:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the WHERE clause, you can specify arbitrary predicates, so the "recency" argument isn't needed here (unlike for USING EXTREMES). Any range of values that was recently updated (even in the middle of the index) can have partial stats collected here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated example!

@taroface
Copy link
Contributor Author

taroface commented Feb 2, 2026

@rytaft TFTR and sorry I took a while to get back to this! I revised per your feedback; could you please have another look?

@taroface taroface requested a review from rytaft February 2, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants