Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-23.2: sql: do not collect histograms for non-indexed JSON columns #140144

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

mgartner
Copy link
Collaborator

@mgartner mgartner commented Jan 30, 2025

Backport 1/1 commits from #139766.

/cc @cockroachdb/release


Informs #139381

Release note (sql change): Since v23.2 table statistics histograms have
been collected for non-indexed JSON columns. Histograms are no longer
collected for these columns if sql.stats.non_indexed_json_histograms.enabled
is set to false. This reduces memory usage during table
statistics collection, for both automatic and manual collection via
ANALYZE and CREATE STATISTICS.


Release justification: New cluster setting disabled by default.

@mgartner mgartner requested a review from a team January 30, 2025 21:09
@mgartner mgartner requested review from a team as code owners January 30, 2025 21:09
@mgartner mgartner requested review from rytaft and removed request for a team January 30, 2025 21:09
Copy link

blathers-crl bot commented Jan 30, 2025

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Backports should only be created for serious
    issues
    or test-only changes.
  • Backports should not break backwards-compatibility.
  • Backports should change as little code as possible.
  • Backports should not change on-disk formats or node communication protocols.
  • Backports should not add new functionality (except as defined
    here).
  • Backports must not add, edit, or otherwise modify cluster versions; or add version gates.
  • All backports must be reviewed by the owning areas TL. For more information as to how that review should be conducted, please consult the backport
    policy
    .
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters. State changes must be further protected such that nodes running old binaries will not be negatively impacted by the new state (with a mixed version test added).
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.
  • Your backport must be accompanied by a post to the appropriate Slack
    channel (#db-backports-point-releases or #db-backports-XX-X-release) for awareness and discussion.

Also, please add a brief release justification to the body of your PR to justify this
backport.

@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Jan 30, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner mgartner requested a review from yuzefovich January 30, 2025 21:28
@mgartner mgartner force-pushed the backport23.2-139766 branch from 0630714 to abf6f0c Compare January 31, 2025 16:26
Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @mgartner and @rytaft)


pkg/sql/logictest/testdata/logic_test/stats line 96 at r1 (raw file):

{j}  histogram_collected
{v}  histogram_collected
>>>>>>> 6de48460ae8 (sql: do not collect histograms for non-indexed JSON columns)

nit: merge leftover


pkg/sql/opt/exec/execbuilder/testdata/stats line 358 at r1 (raw file):

 │    ├── immutable
 │    ├── stats: [rows=1, distinct(1)=1, null(1)=1]
 │    │   histogram(1)=  0   1

nit: I think these changes need to be reverted.

@mgartner mgartner force-pushed the backport23.2-139766 branch from abf6f0c to b0e778e Compare January 31, 2025 17:10
Copy link
Collaborator Author

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rytaft and @yuzefovich)


pkg/sql/logictest/testdata/logic_test/stats line 96 at r1 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

nit: merge leftover

Done.


pkg/sql/opt/exec/execbuilder/testdata/stats line 358 at r1 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

nit: I think these changes need to be reverted.

Done.

Informs cockroachdb#139381

Release note (sql change): Since v23.2 table statistics histograms have
been collected for non-indexed JSON columns. Histograms are no longer
collected for these columns if `sql.stats.non_indexed_json_histograms.enabled`
is set to false. This reduces memory usage during table
statistics collection, for both automatic and manual collection via
ANALYZE and CREATE STATISTICS.
@mgartner mgartner force-pushed the backport23.2-139766 branch from b0e778e to 9af5ce0 Compare January 31, 2025 18:12
@mgartner mgartner merged commit 31fd69d into cockroachdb:release-23.2 Jan 31, 2025
5 of 6 checks passed
@mgartner mgartner deleted the backport23.2-139766 branch January 31, 2025 20:14
@mgartner
Copy link
Collaborator Author

blathers backport 23.2.20-rc

Copy link

blathers-crl bot commented Jan 31, 2025

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error setting reviewers, but backport branch blathers/backport-release-23.2.20-rc-140144 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/140269/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. []

Backport to branch 23.2.20-rc failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@mgartner mgartner self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Label PR's that are backports to older release branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants