Skip to content

Conversation

@mgartner
Copy link
Collaborator

The optimizer_use_max_frequency_selectivity session setting has been
added. It is enabled by default. Disabling it reverts the selectivity
improvements added in #151409.

Release note: None

The `optimizer_use_max_frequency_selectivity` session setting has been
added. It is enabled by default. Disabling it reverts the selectivity
improvements added in cockroachdb#151409.

Release note: None
@mgartner mgartner requested review from a team and michae2 October 31, 2025 16:26
@mgartner mgartner requested a review from a team as a code owner October 31, 2025 16:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner mgartner added backport-25.2.x Flags PRs that need to be backported to 25.2 backport-25.3.x Flags PRs that need to be backported to 25.3 backport-25.4.x Flags PRs that need to be backported to 25.4 labels Oct 31, 2025
Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

:lgtm: Thanks for adding this!

@michae2 reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)

@mgartner
Copy link
Collaborator Author

TFTR!

bors r+

craig bot pushed a commit that referenced this pull request Oct 31, 2025
156472: kvserver: add destroy replica to TestReplicaLifecycleDataDriven  r=pav-kv a=arulajmani

See individual commits for details.

156546: acceptance: Add COCKROACH_ACCEPTANCE_ALLOW_UNSAFE env var r=alyshanjahani-crl a=alyshanjahani-crl

Adding an environment variable to override the allow_unsafe_internals session variable is this simplest way to get the acceptance tests to pass when the default will turn to false in 26.1.

This was tested in #156398, and we see the CI acceptance job pass.

Fixes: #154663
Release note: None

156573: opt: fix LTREE <@ index constraint spans r=mgartner a=mgartner

Fixes #156478

Release note (bug fix): A bug has been fixed that caused incorrect
results for queries that filter indexed `LTREE` columns with the `<`@``
(contained-by) operator. This bug has been present since v25.4.0.

Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Michael Erickson <michae2@cockroachlabs.com>


156581: roachtest: set allow_unsafe_internals=true for roachtests r=alyshanjahani-crl a=alyshanjahani-crl

This commit instruments the connections used by roachtests with the allow_unsafe_internals session variable set to true.

This is in preparation for when the default value of the session variable gets set to false in 26.1.

Fixes: #154674
Release note: None

156583: opt/props: make MinSelectivity variadic r=mgartner a=mgartner

`MinSelectivity` is now variadic. `MinSelectivity3` is obsolete and has
been removed.

Release note: None


156584: copy: fix vectorized auto commit behavior r=yuzefovich a=yuzefovich

When we implemented the vectorized INSERT which supports COPY in some cases, we missed one condition for auto-committing the txn that is present in the regular `tableWriterBase` path. Namely, we need to check whether the deadline that might be set on the txn hasn't expired yet, and if it has, we shouldn't be auto-committing and should be leaving it up to the connExecutor (which will try to refresh the deadline). The impact of the bug is that often if COPY took longer than 40s (controlled via `server.sqlliveness.ttl`), we'd hit the txn retry error and propagate it to the client.

Fixes: #155300.

Release note (bug fix): Previously, the "atomic" COPY command (controlled via `copy_from_atomic_enabled`, which is `true` by default) could encounter RETRY_COMMIT_DEADLINE_EXCEEDED txn errors if the whole command took 1 minute or more. This was the case only when the vectorized engine was used for COPY and is now fixed.

156620: roachtest: deflake multi-store-remove r=tbg a=tbg

The test was checking on replication by asserting that the number of ranges
times the replication factor is equal to the number of replicas.

Replicas can persist after no longer being part of a range (waiting for
replicaGC), which is why this test was flaky.

I first tried to fix it by lowering the replicaGC queue's interval at
which it checks ranges (defaults to 12h), but looking more closely at
what the test was doing, I decided to change that instead by no longer
caring about what replicas each store reports. What matters is what
the meta ranges report, and now the test checks replication similar
to how many other tests do, by querying ranges_no_leases.

Fixes #146435.
Fixes #147763.
Fixes #156447.

Epic: none


156654: sql: add optimizer_use_max_frequency_selectivity session setting r=mgartner a=mgartner

The `optimizer_use_max_frequency_selectivity` session setting has been
added. It is enabled by default. Disabling it reverts the selectivity
improvements added in #151409.

Release note: None


Co-authored-by: Arul Ajmani <arulajmani@gmail.com>
Co-authored-by: alyshanjahani-crl <alyshan@cockroachlabs.com>
Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Tobias Grieger <tobias.b.grieger@gmail.com>
@craig
Copy link
Contributor

craig bot commented Oct 31, 2025

Build failed (retrying...):

craig bot pushed a commit that referenced this pull request Oct 31, 2025
155133: scbuild: allow multiple column renames r=rafiss a=rafiss

Please review each commit individually.

informs #148340

### schemaexpr: add isComputed to ColumnLookupFn

### scbuild: move function definitions to helpers.go

### schemaexpr: add iterColsWithLookupFn

This function allows the computed column validation to be used from the
declarative schema changer -- it uses a lookup function to access
columns rather than referring to the table descriptor directly.

### scbuild: use ValidateComputedColumnExpressionWithLookup function

This validates the computed column by referencing the builder state
rather than the table descriptor. The table descriptor would not reflect
the schema changes that are being staged by the declarative schema
changer.

### scplan: relax constraint for cleaning up non-index-backed constraints

This rule was matching all non-index-backed constraints, but it only
needs to apply to UNIQUE WITHOUT INDEX constraints.

### scplan: tighten rule for transient check constraints

This rule was only needed for the ALTER COLUMN TYPE op, so the rule is
updated to only apply in that case.

### scbuild: allow multiple column renames

This includes new dependency rules so that we fully remove the old name
before allowing a new column to take on that name, and another one to
make sure that a name is available before we create a computed column
expression that uses that name.

Release note: None

156472: kvserver: add destroy replica to TestReplicaLifecycleDataDriven  r=pav-kv a=arulajmani

See individual commits for details.

156584: copy: fix vectorized auto commit behavior r=yuzefovich a=yuzefovich

When we implemented the vectorized INSERT which supports COPY in some cases, we missed one condition for auto-committing the txn that is present in the regular `tableWriterBase` path. Namely, we need to check whether the deadline that might be set on the txn hasn't expired yet, and if it has, we shouldn't be auto-committing and should be leaving it up to the connExecutor (which will try to refresh the deadline). The impact of the bug is that often if COPY took longer than 40s (controlled via `server.sqlliveness.ttl`), we'd hit the txn retry error and propagate it to the client.

Fixes: #155300.

Release note (bug fix): Previously, the "atomic" COPY command (controlled via `copy_from_atomic_enabled`, which is `true` by default) could encounter RETRY_COMMIT_DEADLINE_EXCEEDED txn errors if the whole command took 1 minute or more. This was the case only when the vectorized engine was used for COPY and is now fixed.

156620: roachtest: deflake multi-store-remove r=tbg a=tbg

The test was checking on replication by asserting that the number of ranges
times the replication factor is equal to the number of replicas.

Replicas can persist after no longer being part of a range (waiting for
replicaGC), which is why this test was flaky.

I first tried to fix it by lowering the replicaGC queue's interval at
which it checks ranges (defaults to 12h), but looking more closely at
what the test was doing, I decided to change that instead by no longer
caring about what replicas each store reports. What matters is what
the meta ranges report, and now the test checks replication similar
to how many other tests do, by querying ranges_no_leases.

Fixes #146435.
Fixes #147763.
Fixes #156447.

Epic: none


156654: sql: add optimizer_use_max_frequency_selectivity session setting r=mgartner a=mgartner

The `optimizer_use_max_frequency_selectivity` session setting has been
added. It is enabled by default. Disabling it reverts the selectivity
improvements added in #151409.

Release note: None


156673: build: update `MungeTestXML` and `MergeTestXMLs` behavior r=rail a=rickystewart

The `test.xml` produced by `rules_go` changed with the latest upgrade; this change restores the previous behavior.

Epic: DEVINF-1477
Closes #156597
Release note: none

156685: sql: append copies of system column descriptors r=bghal a=bghal

Previously, the shared descriptors common to system columns meant
changes in one could cause side-effects in another. This was of
particular concern for the schema changer removing the `ColumnHidden`
element during a table drop and consequently exposing the column in
other tables. This change appends copies to avoid that side-effect.

Part of: #139605

Release note: None


Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Co-authored-by: Arul Ajmani <arulajmani@gmail.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Tobias Grieger <tobias.b.grieger@gmail.com>
Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
Co-authored-by: Brendan Gerrity <brendan.gerrity@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Oct 31, 2025

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Oct 31, 2025

@craig craig bot merged commit 88240a3 into cockroachdb:master Oct 31, 2025
22 of 23 checks passed
@blathers-crl
Copy link

blathers-crl bot commented Oct 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.


💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details.

error creating merge commit from 418521e to blathers/backport-release-25.2-156654: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 25.2.x failed. See errors above.


💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details.

error creating merge commit from 418521e to blathers/backport-release-25.3-156654: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 25.3.x failed. See errors above.


💡 Consider backporting to the fork repo instead of the main repo. See instructions for more details.

error creating merge commit from 418521e to blathers/backport-release-25.4-156654: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 25.4.x failed. See errors above.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-25.2.x Flags PRs that need to be backported to 25.2 backport-25.3.x Flags PRs that need to be backported to 25.3 backport-25.4.x Flags PRs that need to be backported to 25.4 backport-failed target-release-26.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants