Skip to content

Conversation

@michae2
Copy link
Collaborator

@michae2 michae2 commented Dec 6, 2025

As part of the stable SQL API effort, expose the following builtin functions in information_schema to complement the existing crdb_internal versions:

  • crdb_internal.reset_index_usage_stats → information_schema.crdb_reset_index_usage_stats
  • crdb_internal.reset_sql_stats → information_schema.crdb_reset_sql_stats
  • crdb_internal.clear_query_plan_cache → information_schema.crdb_clear_query_plan_cache
  • crdb_internal.clear_table_stats_cache → information_schema.crdb_clear_table_stats_cache
  • crdb_internal.clear_statement_hints_cache → information_schema.crdb_clear_statement_hints_cache

The implementations are shared between both schemas to ensure identical behavior. All existing test usages throughout the codebase have been updated to use the information_schema versions to demonstrate the new functions work correctly.

This follows the pattern established in PR #156963 which ported index_usage_statistics and datums_to_bytes to information_schema.

Epic: None

Release note (sql change): Added information_schema versions of 5 builtin functions: crdb_reset_index_usage_stats, crdb_reset_sql_stats, crdb_clear_query_plan_cache, crdb_clear_table_stats_cache, and
crdb_clear_statement_hints_cache. These complement the existing crdb_internal versions as part of the stable SQL API effort.

As part of the stable SQL API effort, expose the following builtin
functions in information_schema to complement the existing
crdb_internal versions:

- crdb_internal.reset_index_usage_stats →
  information_schema.crdb_reset_index_usage_stats
- crdb_internal.reset_sql_stats →
  information_schema.crdb_reset_sql_stats
- crdb_internal.clear_query_plan_cache →
  information_schema.crdb_clear_query_plan_cache
- crdb_internal.clear_table_stats_cache →
  information_schema.crdb_clear_table_stats_cache
- crdb_internal.clear_statement_hints_cache →
  information_schema.crdb_clear_statement_hints_cache

The implementations are shared between both schemas to ensure
identical behavior. All existing test usages throughout the
codebase have been updated to use the information_schema versions
to demonstrate the new functions work correctly.

This follows the pattern established in PR cockroachdb#156963 which ported
index_usage_statistics and datums_to_bytes to information_schema.

Epic: None

Release note (sql change): Added information_schema versions of
5 builtin functions: crdb_reset_index_usage_stats,
crdb_reset_sql_stats, crdb_clear_query_plan_cache,
crdb_clear_table_stats_cache, and
crdb_clear_statement_hints_cache. These complement the existing
crdb_internal versions as part of the stable SQL API effort.

Co-Authored-By: Claude <noreply@anthropic.com>
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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