pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).Build at line 259
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRoot at line 280
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmtAtRootWithScope at line 299
pkg/sql/opt/optbuilder/builder.go in pkg/sql/opt/optbuilder.(*Builder).buildStmt at line 360
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect at line 1127
pkg/sql/opt/optbuilder/with.go in pkg/sql/opt/optbuilder.(*Builder).processWiths at line 116
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelect.func1 at line 1128
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectStmtWithoutParens at line 1176
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildSelectClause at line 1244
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFrom at line 1328
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTables at line 1398
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildFromTablesRightDeep at line 1421
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 106
pkg/sql/opt/optbuilder/join.go in pkg/sql/opt/optbuilder.(*Builder).buildJoin at line 42
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 94
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildDataSource at line 173
pkg/sql/opt/optbuilder/select.go in pkg/sql/opt/optbuilder.(*Builder).buildScan at line 789
pkg/sql/opt/optbuilder/partial_index.go in pkg/sql/opt/optbuilder.(*Builder).addPartialIndexPredicatesForTable at line 104
pkg/sql/opt/optbuilder/partial_index.go in pkg/sql/opt/optbuilder.(*Builder).buildPartialIndexPredicate at line 176
bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go in pkg/sql/opt/norm.(*Factory).ConstructSelect at line 725
bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go in pkg/sql/opt/norm.(*Factory).ConstructSelect at line 1560
bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go in pkg/sql/opt/memo.(*Memo).MemoizeSelect at line 21007
pkg/sql/opt/memo/logical_props_builder.go in pkg/sql/opt/memo.(*logicalPropsBuilder).buildSelectProps at line 307
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).buildSelect at line 1088
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).filterRelExpr at line 3286
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).applyFilters at line 3337
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).applyFiltersItem at line 3377
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols at line 5124
pkg/sql/opt/colset.go in pkg/sql/opt.ColSet.ForEach at line 83
pkg/util/intsets/fast.go in pkg/util/intsets.Fast.ForEach at line 154
pkg/sql/opt/colset.go in pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols.ColSet.ForEach.func3 at line 83
pkg/sql/opt/memo/statistics_builder.go in pkg/sql/opt/memo.(*statisticsBuilder).factorOutVirtualCols.func1 at line 5132
This issue was auto filed by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.
Sentry Link: https://cockroach-labs.sentry.io/issues/5739070701/?referrer=webhooks_plugin
Panic Message:
Stacktrace (expand for inline code snippets):
[https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L258-L260](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L258-L260) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L279-L281](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L279-L281) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L298-L300](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L298-L300) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L359-L361](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/builder.go#L359-L361) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1126-L1128](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1126-L1128) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/with.go#L115-L117](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/with.go#L115-L117) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1127-L1129](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1127-L1129) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1175-L1177](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1175-L1177) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1243-L1245](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1243-L1245) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1327-L1329](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1327-L1329) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1397-L1399](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1397-L1399) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1420-L1422](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L1420-L1422) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L105-L107](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L105-L107) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/join.go#L41-L43](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/join.go#L41-L43) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L93-L95](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L93-L95) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L172-L174](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L172-L174) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L788-L790](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/select.go#L788-L790) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/partial_index.go#L103-L105](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/partial_index.go#L103-L105) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/partial_index.go#L175-L177](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/optbuilder/partial_index.go#L175-L177) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L724-L726](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L724-L726) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L1559-L1561](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/bazel-out/k8-opt/bin/pkg/sql/opt/norm/factory.og.go#L1559-L1561) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go#L21006-L21008](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/bazel-out/k8-opt/bin/pkg/sql/opt/memo/expr.og.go#L21006-L21008) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/logical_props_builder.go#L306-L308](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/logical_props_builder.go#L306-L308) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L1087-L1089](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L1087-L1089) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L3285-L3287](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L3285-L3287) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L3336-L3338](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L3336-L3338) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L3376-L3378](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L3376-L3378) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L5123-L5125](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L5123-L5125) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/colset.go#L82-L84](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/colset.go#L82-L84) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/util/intsets/fast.go#L153-L155](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/util/intsets/fast.go#L153-L155) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/colset.go#L82-L84](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/colset.go#L82-L84) [https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L5131-L5133](https://github.com/cockroachdb/cockroach/blob/5a68aaa15d7044e394b93b7ca78c8ddb7fcee150/pkg/sql/opt/memo/statistics_builder.go#L5131-L5133)Tags
Jira issue: CRDB-41526