Commit abe252e
committed
opt: drop provably-non-null COALESCE operands
When a leading COALESCE argument is known non-null from the input's
NotNullCols, the remaining arguments are unreachable. Trims leading
COALESCE operands in Project projections and Select filters so the
simplified plan no longer carries the dropped arguments.
Example: SELECT COALESCE(i, j) FROM ij with i NOT NULL no longer keeps
the COALESCE in the plan.
Release note: None0 parents commit abe252e
20,422 files changed
Lines changed: 6569373 additions & 0 deletions
File tree
- .claude
- agents
- rules
- skills
- backport-pr-assistant
- bump-cluster-ui
- commit-helper
- drt-analyze
- references
- scripts
- engflow-artifacts
- testdata
- file-crdb-issue
- reduce-unoptimized-query-oracle
- review-crdb
- run-roachtest
- references
- skip-test-with-issue
- system-table-change
- .cursor
- .github
- ISSUE_TEMPLATE
- actions
- microbenchmark-build
- microbenchmark-run
- prompts
- workflows
- .roachdev/hooks
- .trunk
- build
- bazelbuilder
- bazelutil
- cc
- staticcheckanalyzers
- s1000
- s1001
- s1002
- s1003
- s1004
- s1005
- s1006
- s1007
- s1008
- s1009
- s1010
- s1011
- s1012
- s1016
- s1017
- s1018
- s1019
- s1020
- s1021
- s1023
- s1024
- s1025
- s1028
- s1029
- s1030
- s1031
- s1032
- s1033
- s1034
- s1035
- s1036
- s1037
- s1038
- s1039
- s1040
- sa1000
- sa1001
- sa1002
- sa1003
- sa1004
- sa1005
- sa1006
- sa1007
- sa1008
- sa1010
- sa1011
- sa1012
- sa1013
- sa1014
- sa1015
- sa1016
- sa1017
- sa1018
- sa1019
- sa1020
- sa1021
- sa1023
- sa1024
- sa1025
- sa1026
- sa1027
- sa1028
- sa1029
- sa1030
- sa1031
- sa1032
- sa2000
- sa2001
- sa2002
- sa2003
- sa3000
- sa3001
- sa4000
- sa4001
- sa4003
- sa4004
- sa4005
- sa4006
- sa4008
- sa4009
- sa4010
- sa4011
- sa4012
- sa4013
- sa4014
- sa4015
- sa4016
- sa4017
- sa4018
- sa4019
- sa4020
- sa4021
- sa4022
- sa4023
- sa4024
- sa4025
- sa4026
- sa4027
- sa4028
- sa4029
- sa4030
- sa4031
- sa4032
- sa5000
- sa5001
- sa5002
- sa5003
- sa5004
- sa5005
- sa5007
- sa5008
- sa5009
- sa5010
- sa5011
- sa5012
- sa6000
- sa6001
- sa6002
- sa6003
- sa6005
- sa6006
- sa9001
- sa9002
- sa9003
- sa9004
- sa9005
- sa9006
- sa9007
- sa9008
- sa9009
- st1000
- st1001
- st1003
- st1005
- st1006
- st1008
- st1011
- st1012
- st1013
- st1015
- st1016
- st1017
- st1018
- st1019
- st1020
- st1021
- st1022
- st1023
- whereis
- bootstrap
- deploy-redhat
- deploy
- ghactions
- github
- microbenchmarks
- instrumentation
- oss-fuzz
- packer
- filebeat
- patches
- release
- bincheck
- s390x
- scripts
- teamcity
- cockroach
- ci
- builds
- tests-aws-linux-arm64-bigvm
- tests-aws-linux-arm64
- tests-ibm-cloud-linux-s390x
- tests
- coverage
- nightlies
- post-merge
- internal
- cockroach
- build/ci
- nightlies
- pua
- release
- process
- publish
- release
- build-and-publish-patched-go
- process
- util
- toolchains
- crosstool-ng
- darwin
- toolchainbuild
- crosstool-ng
- osxcross
- tools/gen-cockroachdb-metrics
- c-deps
- cloud
- kubernetes
- bring-your-own-certs
- multiregion
- eks
- performance
- prometheus
- img
- v1.20
- docs
- RFCS
- 20191014_savepoints
- 20200421_geospatial
- 20210610_tenant_zone_configs
- 20220602_fine_grained_cpu_attribution
- 20230118_virtual_cluster_orchestration
- images
- codelabs
- generated
- http
- metrics
- settings
- sql
- bnf
- media
- tech-notes
- contexts
- images
- observability
- replication_admission_control
- roachtest-investigation-tips
- sql
- txn_coord_sender
- tla-plus
- ParallelCommits
- ParallelCommits.toolbox
- StoreLiveness
- githooks
- licenses
- monitoring
- demo
- config
- grafana/provisioning
- dashboards
- datasources
- grafana-dashboards
- by-cluster
- by-roachtest
- rules
- splunk-dashboard
- pkg
- acceptance
- cluster
- compose
- flyway
- sql
- gss
- kdc
- psql
- python
- python
- localcluster
- tc
- testdata
- csharp
- c
- java
- src/main/java
- node
- php
- psql
- python
- ruby
- backup
- backupbase
- backupdest
- backupencryption
- backupinfo
- backuppb
- backuprand
- backupresolver
- backupsink
- backuptestutils
- backuputils
- testdata/backup-restore
- alter-schedule
- testgen
- base
- serverident
- testdata
- bench
- benchprof
- cmd/pgbenchsetup
- hashbench
- rttanalysis
- testdata
- tpcc
- blobs
- blobspb
- build
- bazel
- bes
- command_line
- failure_details
- invocation_policy
- option_filters
- util/tinystringer
- engflow
- starlarkutil
- util
- ccl
- changefeedccl
- avro
- cdceval
- cdcevent
- cdcprogresspb
- cdctest
- cdcutils
- changefeedbase
- changefeedpb
- changefeedvalidators
- checkpoint
- kafkaauth
- kcjsonschema
- kvevent
- kvfeed
- mocks
- resolvedspan
- schemafeed
- schematestutils
- testdata
- tableset
- timers
- multiregionccl
- multiregionccltestutils
- testdata
- multitenantccl
- tenantcapabilitiesccl
- testdata
- tenantcostclient
- testdata
- tenantcostserver
- tenanttokenbucket
- testdata
- testdata
- schemachangerccl
- sctestbackupccl
- sctestbackupmrccl
- testdata
- decomp
- end_to_end
- add_column_multiple_regional_by_row
- add_column_regional_by_row
- add_column_subzones
- alter_index_configure_zone_multiple
- alter_index_configure_zone
- alter_partition_configure_zone_discard
- alter_partition_configure_zone_multiple
- alter_partition_configure_zone_subpartitions
- alter_partition_configure_zone
- alter_table_alter_primary_key_rbr
- alter_table_locality_global_to_rbr
- alter_table_locality_global_to_rbt_primary_region
- alter_table_locality_global_to_rbt_secondary_region
- alter_table_locality_rbr_as_to_rbr_default
- alter_table_locality_rbr_default_to_rbr_as
- alter_table_locality_rbr_to_global
- alter_table_locality_rbr_to_rbt_primary_region
- alter_table_locality_rbr_to_rbt_secondary_region
- alter_table_locality_rbt_primary_region_to_global
- alter_table_locality_rbt_primary_region_to_rbr
- alter_table_locality_rbt_primary_region_to_secondary_region
- alter_table_locality_rbt_secondary_region_to_global
- alter_table_locality_rbt_secondary_region_to_primary_region
- alter_table_locality_rbt_secondary_region_to_rbr
- alter_table_locality_rbt_secondary_region_to_secondary_region
- alter_table_set_infer_rbr_using_constraint
- create_index_regional_by_row
- create_index
- create_trigger
- drop_column_regional_by_row
- drop_database_multiregion_primary_region
- drop_table_multiregion_primary_region
- drop_table_multiregion
- drop_table_trigger
- drop_trigger
- serverccl
- adminccl
- diagnosticsccl
- statusccl
- testdata
- sqlproxyccl
- acl
- balancer
- interceptor
- tenantdirsvr
- tenant
- testdata
- throttler
- testccl
- authccl
- testdata
- sqlccl
- sqlstatsccl
- workload/schemachange
- testutilsccl
- changefeed/changefeedpb
- cli
- clicfg
- clientflags
- clienturl
- clierrorplus
- clierror
- cliflagcfg
- cliflags
- clisqlcfg
- clisqlclient
- clisqlexec
- clisqlshell
- testdata
- complete
- democluster
- api
- exit
- files
- interactive_tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
0 commit comments