diff --git a/pkg/sql/exec_util.go b/pkg/sql/exec_util.go index 719aeef78563..5696ea29405f 100644 --- a/pkg/sql/exec_util.go +++ b/pkg/sql/exec_util.go @@ -3522,6 +3522,10 @@ func (m *sessionDataMutator) SetOptimizerHoistUncorrelatedEqualitySubqueries(val m.data.OptimizerHoistUncorrelatedEqualitySubqueries = val } +func (m *sessionDataMutator) SetOptimizerUseImprovedComputedColumnFiltersDerivation(val bool) { + m.data.OptimizerUseImprovedComputedColumnFiltersDerivation = val +} + func (m *sessionDataMutator) SetEnableCreateStatsUsingExtremes(val bool) { m.data.EnableCreateStatsUsingExtremes = val } diff --git a/pkg/sql/logictest/testdata/logic_test/information_schema b/pkg/sql/logictest/testdata/logic_test/information_schema index b3a8b693c4ed..a9c0811c0e9e 100644 --- a/pkg/sql/logictest/testdata/logic_test/information_schema +++ b/pkg/sql/logictest/testdata/logic_test/information_schema @@ -5198,159 +5198,160 @@ WHERE 'multiple_active_portals_enabled' ); ---- -variable value -allow_ordinal_column_references off -allow_prepare_as_opt_plan off -allow_role_memberships_to_change_during_transaction off -alter_primary_region_super_region_override off -application_name · -avoid_buffering off -backslash_quote safe_encoding -bytea_output hex -check_function_bodies on -client_encoding UTF8 -client_min_messages notice -copy_from_atomic_enabled on -copy_from_retries_enabled on -cost_scans_with_default_col_size off -database test -datestyle ISO, MDY -datestyle_enabled on -declare_cursor_statement_timeout_enabled on -default_int_size 8 -default_table_access_method heap -default_tablespace · -default_text_search_config pg_catalog.english -default_transaction_isolation serializable -default_transaction_priority normal -default_transaction_quality_of_service regular -default_transaction_read_only off -default_transaction_use_follower_reads off -default_with_oids off -descriptor_validation on -disable_drop_tenant off -disable_hoist_projection_in_join_limitation off -disable_partially_distributed_plans off -disable_plan_gists off -disallow_full_table_scans off -enable_auto_rehoming off -enable_create_stats_using_extremes off -enable_drop_enum_value on -enable_experimental_alter_column_type_general off -enable_implicit_select_for_update on -enable_implicit_transaction_for_batch_statements on -enable_insert_fast_path on -enable_multiple_modifications_of_table off -enable_multiregion_placement_policy off -enable_seqscan on -enable_super_regions off -enable_zigzag_join on -enforce_home_region off -enforce_home_region_follower_reads_enabled off -escape_string_warning on -expect_and_ignore_not_visible_columns_in_copy off -experimental_computed_column_rewrites · -experimental_enable_auto_rehoming off -experimental_enable_hash_sharded_indexes on -experimental_enable_implicit_column_partitioning off -experimental_enable_temp_tables off -experimental_enable_unique_without_index_constraints on -experimental_hash_group_join_enabled off -extra_float_digits 1 -force_savepoint_restart off -foreign_key_cascades_limit 10000 -idle_in_session_timeout 0 -idle_in_transaction_session_timeout 0 -idle_session_timeout 0 -index_join_streamer_batch_size 8.0 MiB -index_recommendations_enabled off -inject_retry_errors_enabled off -inject_retry_errors_on_commit_enabled off -integer_datetimes on -intervalstyle postgres -intervalstyle_enabled on -is_superuser on -join_reader_index_join_strategy_batch_size 4.0 MiB -join_reader_no_ordering_strategy_batch_size 2.0 MiB -join_reader_ordering_strategy_batch_size 100 KiB -large_full_scan_rows 1000 -lc_collate C.UTF-8 -lc_ctype C.UTF-8 -lc_messages C.UTF-8 -lc_monetary C.UTF-8 -lc_numeric C.UTF-8 -lc_time C.UTF-8 -locality region=test,dc=dc1 -locality_optimized_partitioned_index_scan on -lock_timeout 0 -log_timezone UTC -max_identifier_length 128 -max_index_keys 32 -node_id 1 -null_ordered_last off -on_update_rehome_row_enabled on -opt_split_scan_limit 2048 -optimizer on -optimizer_always_use_histograms on -optimizer_hoist_uncorrelated_equality_subqueries off -optimizer_use_forecasts on -optimizer_use_histograms on -optimizer_use_improved_disjunction_stats on -optimizer_use_improved_split_disjunction_for_joins on -optimizer_use_limit_ordering_for_streaming_group_by on -optimizer_use_multicol_stats on -optimizer_use_not_visible_indexes off -override_multi_region_zone_config off -parallelize_multi_key_lookup_joins_enabled off -password_encryption scram-sha-256 -pg_trgm.similarity_threshold 0.3 -prefer_lookup_joins_for_fks off -prepared_statements_cache_size 0 B -propagate_input_ordering off -reorder_joins_limit 8 -require_explicit_primary_keys off -results_buffer_size 16384 -role none -row_security off -save_tables_prefix · -search_path "$user", public -serial_normalization rowid -server_encoding UTF8 -server_version 13.0.0 -server_version_num 130000 -session_authorization root -session_user root -show_primary_key_constraint_on_not_visible_columns on -sql_safe_updates off -ssl on -ssl_renegotiation_limit 0 -standard_conforming_strings on -statement_timeout 0 -streamer_enabled on -stub_catalog_tables on -synchronize_seqscans on -synchronous_commit on -system_identity root -testing_optimizer_cost_perturbation 0 -testing_optimizer_disable_rule_probability 0 -testing_optimizer_random_seed 0 -testing_vectorize_inject_panics off -timezone UTC -tracing off -transaction_isolation serializable -transaction_priority normal -transaction_read_only off -transaction_rows_read_err 0 -transaction_rows_read_log 0 -transaction_rows_written_err 0 -transaction_rows_written_log 0 -transaction_status NoTxn -transaction_timeout 0 -troubleshooting_mode off -unbounded_parallel_scans off -unconstrained_non_covering_index_scan_enabled off -variable_inequality_lookup_join_enabled on -xmloption content +variable value +allow_ordinal_column_references off +allow_prepare_as_opt_plan off +allow_role_memberships_to_change_during_transaction off +alter_primary_region_super_region_override off +application_name · +avoid_buffering off +backslash_quote safe_encoding +bytea_output hex +check_function_bodies on +client_encoding UTF8 +client_min_messages notice +copy_from_atomic_enabled on +copy_from_retries_enabled on +cost_scans_with_default_col_size off +database test +datestyle ISO, MDY +datestyle_enabled on +declare_cursor_statement_timeout_enabled on +default_int_size 8 +default_table_access_method heap +default_tablespace · +default_text_search_config pg_catalog.english +default_transaction_isolation serializable +default_transaction_priority normal +default_transaction_quality_of_service regular +default_transaction_read_only off +default_transaction_use_follower_reads off +default_with_oids off +descriptor_validation on +disable_drop_tenant off +disable_hoist_projection_in_join_limitation off +disable_partially_distributed_plans off +disable_plan_gists off +disallow_full_table_scans off +enable_auto_rehoming off +enable_create_stats_using_extremes off +enable_drop_enum_value on +enable_experimental_alter_column_type_general off +enable_implicit_select_for_update on +enable_implicit_transaction_for_batch_statements on +enable_insert_fast_path on +enable_multiple_modifications_of_table off +enable_multiregion_placement_policy off +enable_seqscan on +enable_super_regions off +enable_zigzag_join on +enforce_home_region off +enforce_home_region_follower_reads_enabled off +escape_string_warning on +expect_and_ignore_not_visible_columns_in_copy off +experimental_computed_column_rewrites · +experimental_enable_auto_rehoming off +experimental_enable_hash_sharded_indexes on +experimental_enable_implicit_column_partitioning off +experimental_enable_temp_tables off +experimental_enable_unique_without_index_constraints on +experimental_hash_group_join_enabled off +extra_float_digits 1 +force_savepoint_restart off +foreign_key_cascades_limit 10000 +idle_in_session_timeout 0 +idle_in_transaction_session_timeout 0 +idle_session_timeout 0 +index_join_streamer_batch_size 8.0 MiB +index_recommendations_enabled off +inject_retry_errors_enabled off +inject_retry_errors_on_commit_enabled off +integer_datetimes on +intervalstyle postgres +intervalstyle_enabled on +is_superuser on +join_reader_index_join_strategy_batch_size 4.0 MiB +join_reader_no_ordering_strategy_batch_size 2.0 MiB +join_reader_ordering_strategy_batch_size 100 KiB +large_full_scan_rows 1000 +lc_collate C.UTF-8 +lc_ctype C.UTF-8 +lc_messages C.UTF-8 +lc_monetary C.UTF-8 +lc_numeric C.UTF-8 +lc_time C.UTF-8 +locality region=test,dc=dc1 +locality_optimized_partitioned_index_scan on +lock_timeout 0 +log_timezone UTC +max_identifier_length 128 +max_index_keys 32 +node_id 1 +null_ordered_last off +on_update_rehome_row_enabled on +opt_split_scan_limit 2048 +optimizer on +optimizer_always_use_histograms on +optimizer_hoist_uncorrelated_equality_subqueries off +optimizer_use_forecasts on +optimizer_use_histograms on +optimizer_use_improved_computed_column_filters_derivation off +optimizer_use_improved_disjunction_stats on +optimizer_use_improved_split_disjunction_for_joins on +optimizer_use_limit_ordering_for_streaming_group_by on +optimizer_use_multicol_stats on +optimizer_use_not_visible_indexes off +override_multi_region_zone_config off +parallelize_multi_key_lookup_joins_enabled off +password_encryption scram-sha-256 +pg_trgm.similarity_threshold 0.3 +prefer_lookup_joins_for_fks off +prepared_statements_cache_size 0 B +propagate_input_ordering off +reorder_joins_limit 8 +require_explicit_primary_keys off +results_buffer_size 16384 +role none +row_security off +save_tables_prefix · +search_path "$user", public +serial_normalization rowid +server_encoding UTF8 +server_version 13.0.0 +server_version_num 130000 +session_authorization root +session_user root +show_primary_key_constraint_on_not_visible_columns on +sql_safe_updates off +ssl on +ssl_renegotiation_limit 0 +standard_conforming_strings on +statement_timeout 0 +streamer_enabled on +stub_catalog_tables on +synchronize_seqscans on +synchronous_commit on +system_identity root +testing_optimizer_cost_perturbation 0 +testing_optimizer_disable_rule_probability 0 +testing_optimizer_random_seed 0 +testing_vectorize_inject_panics off +timezone UTC +tracing off +transaction_isolation serializable +transaction_priority normal +transaction_read_only off +transaction_rows_read_err 0 +transaction_rows_read_log 0 +transaction_rows_written_err 0 +transaction_rows_written_log 0 +transaction_status NoTxn +transaction_timeout 0 +troubleshooting_mode off +unbounded_parallel_scans off +unconstrained_non_covering_index_scan_enabled off +variable_inequality_lookup_join_enabled on +xmloption content # information_schema can be used with the anonymous database. # It should show information across all databases. diff --git a/pkg/sql/logictest/testdata/logic_test/pg_catalog b/pkg/sql/logictest/testdata/logic_test/pg_catalog index e7aa5b499f9d..098b2d8de8b5 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_catalog +++ b/pkg/sql/logictest/testdata/logic_test/pg_catalog @@ -2676,151 +2676,152 @@ FROM WHERE name NOT IN ('optimizer', 'crdb_version', 'session_id', 'distsql_workmem', 'copy_fast_path_enabled', 'direct_columnar_scans_enabled', 'multiple_active_portals_enabled') ---- -name setting category short_desc extra_desc vartype -allow_ordinal_column_references off NULL NULL NULL string -allow_role_memberships_to_change_during_transaction off NULL NULL NULL string -alter_primary_region_super_region_override off NULL NULL NULL string -application_name · NULL NULL NULL string -avoid_buffering off NULL NULL NULL string -backslash_quote safe_encoding NULL NULL NULL string -bytea_output hex NULL NULL NULL string -check_function_bodies on NULL NULL NULL string -client_encoding UTF8 NULL NULL NULL string -client_min_messages notice NULL NULL NULL string -copy_from_atomic_enabled on NULL NULL NULL string -copy_from_retries_enabled on NULL NULL NULL string -cost_scans_with_default_col_size off NULL NULL NULL string -database test NULL NULL NULL string -datestyle ISO, MDY NULL NULL NULL string -declare_cursor_statement_timeout_enabled on NULL NULL NULL string -default_int_size 8 NULL NULL NULL string -default_table_access_method heap NULL NULL NULL string -default_tablespace · NULL NULL NULL string -default_text_search_config pg_catalog.english NULL NULL NULL string -default_transaction_isolation serializable NULL NULL NULL string -default_transaction_priority normal NULL NULL NULL string -default_transaction_quality_of_service regular NULL NULL NULL string -default_transaction_read_only off NULL NULL NULL string -default_transaction_use_follower_reads off NULL NULL NULL string -default_with_oids off NULL NULL NULL string -descriptor_validation on NULL NULL NULL string -disable_hoist_projection_in_join_limitation off NULL NULL NULL string -disable_partially_distributed_plans off NULL NULL NULL string -disable_plan_gists off NULL NULL NULL string -disallow_full_table_scans off NULL NULL NULL string -distsql off NULL NULL NULL string -enable_auto_rehoming off NULL NULL NULL string -enable_create_stats_using_extremes off NULL NULL NULL string -enable_experimental_alter_column_type_general off NULL NULL NULL string -enable_implicit_select_for_update on NULL NULL NULL string -enable_implicit_transaction_for_batch_statements on NULL NULL NULL string -enable_insert_fast_path on NULL NULL NULL string -enable_multiple_modifications_of_table off NULL NULL NULL string -enable_multiregion_placement_policy off NULL NULL NULL string -enable_seqscan on NULL NULL NULL string -enable_super_regions off NULL NULL NULL string -enable_zigzag_join on NULL NULL NULL string -enforce_home_region off NULL NULL NULL string -enforce_home_region_follower_reads_enabled off NULL NULL NULL string -escape_string_warning on NULL NULL NULL string -expect_and_ignore_not_visible_columns_in_copy off NULL NULL NULL string -experimental_distsql_planning off NULL NULL NULL string -experimental_enable_auto_rehoming off NULL NULL NULL string -experimental_enable_implicit_column_partitioning off NULL NULL NULL string -experimental_enable_temp_tables off NULL NULL NULL string -experimental_enable_unique_without_index_constraints on NULL NULL NULL string -experimental_hash_group_join_enabled off NULL NULL NULL string -extra_float_digits 1 NULL NULL NULL string -force_savepoint_restart off NULL NULL NULL string -foreign_key_cascades_limit 10000 NULL NULL NULL string -idle_in_session_timeout 0 NULL NULL NULL string -idle_in_transaction_session_timeout 0 NULL NULL NULL string -idle_session_timeout 0 NULL NULL NULL string -index_join_streamer_batch_size 8.0 MiB NULL NULL NULL string -index_recommendations_enabled off NULL NULL NULL string -inject_retry_errors_enabled off NULL NULL NULL string -inject_retry_errors_on_commit_enabled off NULL NULL NULL string -integer_datetimes on NULL NULL NULL string -intervalstyle postgres NULL NULL NULL string -is_superuser on NULL NULL NULL string -join_reader_index_join_strategy_batch_size 4.0 MiB NULL NULL NULL string -join_reader_no_ordering_strategy_batch_size 2.0 MiB NULL NULL NULL string -join_reader_ordering_strategy_batch_size 100 KiB NULL NULL NULL string -large_full_scan_rows 1000 NULL NULL NULL string -lc_collate C.UTF-8 NULL NULL NULL string -lc_ctype C.UTF-8 NULL NULL NULL string -lc_messages C.UTF-8 NULL NULL NULL string -lc_monetary C.UTF-8 NULL NULL NULL string -lc_numeric C.UTF-8 NULL NULL NULL string -lc_time C.UTF-8 NULL NULL NULL string -locality region=test,dc=dc1 NULL NULL NULL string -locality_optimized_partitioned_index_scan on NULL NULL NULL string -lock_timeout 0 NULL NULL NULL string -log_timezone UTC NULL NULL NULL string -max_identifier_length 128 NULL NULL NULL string -max_index_keys 32 NULL NULL NULL string -node_id 1 NULL NULL NULL string -null_ordered_last off NULL NULL NULL string -on_update_rehome_row_enabled on NULL NULL NULL string -opt_split_scan_limit 2048 NULL NULL NULL string -optimizer_always_use_histograms on NULL NULL NULL string -optimizer_hoist_uncorrelated_equality_subqueries off NULL NULL NULL string -optimizer_use_forecasts on NULL NULL NULL string -optimizer_use_histograms on NULL NULL NULL string -optimizer_use_improved_disjunction_stats on NULL NULL NULL string -optimizer_use_improved_split_disjunction_for_joins on NULL NULL NULL string -optimizer_use_limit_ordering_for_streaming_group_by on NULL NULL NULL string -optimizer_use_multicol_stats on NULL NULL NULL string -optimizer_use_not_visible_indexes off NULL NULL NULL string -override_multi_region_zone_config off NULL NULL NULL string -parallelize_multi_key_lookup_joins_enabled off NULL NULL NULL string -password_encryption scram-sha-256 NULL NULL NULL string -pg_trgm.similarity_threshold 0.3 NULL NULL NULL string -prefer_lookup_joins_for_fks off NULL NULL NULL string -prepared_statements_cache_size 0 B NULL NULL NULL string -propagate_input_ordering off NULL NULL NULL string -reorder_joins_limit 8 NULL NULL NULL string -require_explicit_primary_keys off NULL NULL NULL string -results_buffer_size 16384 NULL NULL NULL string -role none NULL NULL NULL string -row_security off NULL NULL NULL string -search_path "$user", public NULL NULL NULL string -serial_normalization rowid NULL NULL NULL string -server_encoding UTF8 NULL NULL NULL string -server_version 13.0.0 NULL NULL NULL string -server_version_num 130000 NULL NULL NULL string -session_user root NULL NULL NULL string -show_primary_key_constraint_on_not_visible_columns on NULL NULL NULL string -sql_safe_updates off NULL NULL NULL string -standard_conforming_strings on NULL NULL NULL string -statement_timeout 0 NULL NULL NULL string -streamer_enabled on NULL NULL NULL string -stub_catalog_tables on NULL NULL NULL string -synchronize_seqscans on NULL NULL NULL string -synchronous_commit on NULL NULL NULL string -system_identity root NULL NULL NULL string -testing_optimizer_cost_perturbation 0 NULL NULL NULL string -testing_optimizer_disable_rule_probability 0 NULL NULL NULL string -testing_optimizer_random_seed 0 NULL NULL NULL string -testing_vectorize_inject_panics off NULL NULL NULL string -timezone UTC NULL NULL NULL string -tracing off NULL NULL NULL string -transaction_isolation serializable NULL NULL NULL string -transaction_priority normal NULL NULL NULL string -transaction_read_only off NULL NULL NULL string -transaction_rows_read_err 0 NULL NULL NULL string -transaction_rows_read_log 0 NULL NULL NULL string -transaction_rows_written_err 0 NULL NULL NULL string -transaction_rows_written_log 0 NULL NULL NULL string -transaction_status NoTxn NULL NULL NULL string -transaction_timeout 0 NULL NULL NULL string -troubleshooting_mode off NULL NULL NULL string -unbounded_parallel_scans off NULL NULL NULL string -unconstrained_non_covering_index_scan_enabled off NULL NULL NULL string -use_declarative_schema_changer on NULL NULL NULL string -variable_inequality_lookup_join_enabled on NULL NULL NULL string -vectorize on NULL NULL NULL string -xmloption content NULL NULL NULL string +name setting category short_desc extra_desc vartype +allow_ordinal_column_references off NULL NULL NULL string +allow_role_memberships_to_change_during_transaction off NULL NULL NULL string +alter_primary_region_super_region_override off NULL NULL NULL string +application_name · NULL NULL NULL string +avoid_buffering off NULL NULL NULL string +backslash_quote safe_encoding NULL NULL NULL string +bytea_output hex NULL NULL NULL string +check_function_bodies on NULL NULL NULL string +client_encoding UTF8 NULL NULL NULL string +client_min_messages notice NULL NULL NULL string +copy_from_atomic_enabled on NULL NULL NULL string +copy_from_retries_enabled on NULL NULL NULL string +cost_scans_with_default_col_size off NULL NULL NULL string +database test NULL NULL NULL string +datestyle ISO, MDY NULL NULL NULL string +declare_cursor_statement_timeout_enabled on NULL NULL NULL string +default_int_size 8 NULL NULL NULL string +default_table_access_method heap NULL NULL NULL string +default_tablespace · NULL NULL NULL string +default_text_search_config pg_catalog.english NULL NULL NULL string +default_transaction_isolation serializable NULL NULL NULL string +default_transaction_priority normal NULL NULL NULL string +default_transaction_quality_of_service regular NULL NULL NULL string +default_transaction_read_only off NULL NULL NULL string +default_transaction_use_follower_reads off NULL NULL NULL string +default_with_oids off NULL NULL NULL string +descriptor_validation on NULL NULL NULL string +disable_hoist_projection_in_join_limitation off NULL NULL NULL string +disable_partially_distributed_plans off NULL NULL NULL string +disable_plan_gists off NULL NULL NULL string +disallow_full_table_scans off NULL NULL NULL string +distsql off NULL NULL NULL string +enable_auto_rehoming off NULL NULL NULL string +enable_create_stats_using_extremes off NULL NULL NULL string +enable_experimental_alter_column_type_general off NULL NULL NULL string +enable_implicit_select_for_update on NULL NULL NULL string +enable_implicit_transaction_for_batch_statements on NULL NULL NULL string +enable_insert_fast_path on NULL NULL NULL string +enable_multiple_modifications_of_table off NULL NULL NULL string +enable_multiregion_placement_policy off NULL NULL NULL string +enable_seqscan on NULL NULL NULL string +enable_super_regions off NULL NULL NULL string +enable_zigzag_join on NULL NULL NULL string +enforce_home_region off NULL NULL NULL string +enforce_home_region_follower_reads_enabled off NULL NULL NULL string +escape_string_warning on NULL NULL NULL string +expect_and_ignore_not_visible_columns_in_copy off NULL NULL NULL string +experimental_distsql_planning off NULL NULL NULL string +experimental_enable_auto_rehoming off NULL NULL NULL string +experimental_enable_implicit_column_partitioning off NULL NULL NULL string +experimental_enable_temp_tables off NULL NULL NULL string +experimental_enable_unique_without_index_constraints on NULL NULL NULL string +experimental_hash_group_join_enabled off NULL NULL NULL string +extra_float_digits 1 NULL NULL NULL string +force_savepoint_restart off NULL NULL NULL string +foreign_key_cascades_limit 10000 NULL NULL NULL string +idle_in_session_timeout 0 NULL NULL NULL string +idle_in_transaction_session_timeout 0 NULL NULL NULL string +idle_session_timeout 0 NULL NULL NULL string +index_join_streamer_batch_size 8.0 MiB NULL NULL NULL string +index_recommendations_enabled off NULL NULL NULL string +inject_retry_errors_enabled off NULL NULL NULL string +inject_retry_errors_on_commit_enabled off NULL NULL NULL string +integer_datetimes on NULL NULL NULL string +intervalstyle postgres NULL NULL NULL string +is_superuser on NULL NULL NULL string +join_reader_index_join_strategy_batch_size 4.0 MiB NULL NULL NULL string +join_reader_no_ordering_strategy_batch_size 2.0 MiB NULL NULL NULL string +join_reader_ordering_strategy_batch_size 100 KiB NULL NULL NULL string +large_full_scan_rows 1000 NULL NULL NULL string +lc_collate C.UTF-8 NULL NULL NULL string +lc_ctype C.UTF-8 NULL NULL NULL string +lc_messages C.UTF-8 NULL NULL NULL string +lc_monetary C.UTF-8 NULL NULL NULL string +lc_numeric C.UTF-8 NULL NULL NULL string +lc_time C.UTF-8 NULL NULL NULL string +locality region=test,dc=dc1 NULL NULL NULL string +locality_optimized_partitioned_index_scan on NULL NULL NULL string +lock_timeout 0 NULL NULL NULL string +log_timezone UTC NULL NULL NULL string +max_identifier_length 128 NULL NULL NULL string +max_index_keys 32 NULL NULL NULL string +node_id 1 NULL NULL NULL string +null_ordered_last off NULL NULL NULL string +on_update_rehome_row_enabled on NULL NULL NULL string +opt_split_scan_limit 2048 NULL NULL NULL string +optimizer_always_use_histograms on NULL NULL NULL string +optimizer_hoist_uncorrelated_equality_subqueries off NULL NULL NULL string +optimizer_use_forecasts on NULL NULL NULL string +optimizer_use_histograms on NULL NULL NULL string +optimizer_use_improved_computed_column_filters_derivation off NULL NULL NULL string +optimizer_use_improved_disjunction_stats on NULL NULL NULL string +optimizer_use_improved_split_disjunction_for_joins on NULL NULL NULL string +optimizer_use_limit_ordering_for_streaming_group_by on NULL NULL NULL string +optimizer_use_multicol_stats on NULL NULL NULL string +optimizer_use_not_visible_indexes off NULL NULL NULL string +override_multi_region_zone_config off NULL NULL NULL string +parallelize_multi_key_lookup_joins_enabled off NULL NULL NULL string +password_encryption scram-sha-256 NULL NULL NULL string +pg_trgm.similarity_threshold 0.3 NULL NULL NULL string +prefer_lookup_joins_for_fks off NULL NULL NULL string +prepared_statements_cache_size 0 B NULL NULL NULL string +propagate_input_ordering off NULL NULL NULL string +reorder_joins_limit 8 NULL NULL NULL string +require_explicit_primary_keys off NULL NULL NULL string +results_buffer_size 16384 NULL NULL NULL string +role none NULL NULL NULL string +row_security off NULL NULL NULL string +search_path "$user", public NULL NULL NULL string +serial_normalization rowid NULL NULL NULL string +server_encoding UTF8 NULL NULL NULL string +server_version 13.0.0 NULL NULL NULL string +server_version_num 130000 NULL NULL NULL string +session_user root NULL NULL NULL string +show_primary_key_constraint_on_not_visible_columns on NULL NULL NULL string +sql_safe_updates off NULL NULL NULL string +standard_conforming_strings on NULL NULL NULL string +statement_timeout 0 NULL NULL NULL string +streamer_enabled on NULL NULL NULL string +stub_catalog_tables on NULL NULL NULL string +synchronize_seqscans on NULL NULL NULL string +synchronous_commit on NULL NULL NULL string +system_identity root NULL NULL NULL string +testing_optimizer_cost_perturbation 0 NULL NULL NULL string +testing_optimizer_disable_rule_probability 0 NULL NULL NULL string +testing_optimizer_random_seed 0 NULL NULL NULL string +testing_vectorize_inject_panics off NULL NULL NULL string +timezone UTC NULL NULL NULL string +tracing off NULL NULL NULL string +transaction_isolation serializable NULL NULL NULL string +transaction_priority normal NULL NULL NULL string +transaction_read_only off NULL NULL NULL string +transaction_rows_read_err 0 NULL NULL NULL string +transaction_rows_read_log 0 NULL NULL NULL string +transaction_rows_written_err 0 NULL NULL NULL string +transaction_rows_written_log 0 NULL NULL NULL string +transaction_status NoTxn NULL NULL NULL string +transaction_timeout 0 NULL NULL NULL string +troubleshooting_mode off NULL NULL NULL string +unbounded_parallel_scans off NULL NULL NULL string +unconstrained_non_covering_index_scan_enabled off NULL NULL NULL string +use_declarative_schema_changer on NULL NULL NULL string +variable_inequality_lookup_join_enabled on NULL NULL NULL string +vectorize on NULL NULL NULL string +xmloption content NULL NULL NULL string skipif config 3node-tenant-default-configs query TTTTTTT colnames @@ -2831,307 +2832,309 @@ FROM WHERE name NOT IN ('optimizer', 'crdb_version', 'session_id', 'distsql_workmem', 'copy_fast_path_enabled', 'direct_columnar_scans_enabled', 'multiple_active_portals_enabled') ---- -name setting unit context enumvals boot_val reset_val -allow_ordinal_column_references off NULL user NULL off off -allow_role_memberships_to_change_during_transaction off NULL user NULL off off -alter_primary_region_super_region_override off NULL user NULL off off -application_name · NULL user NULL · · -avoid_buffering off NULL user NULL false false -backslash_quote safe_encoding NULL user NULL safe_encoding safe_encoding -bytea_output hex NULL user NULL hex hex -check_function_bodies on NULL user NULL on on -client_encoding UTF8 NULL user NULL UTF8 UTF8 -client_min_messages notice NULL user NULL notice notice -copy_from_atomic_enabled on NULL user NULL on on -copy_from_retries_enabled on NULL user NULL on on -cost_scans_with_default_col_size off NULL user NULL off off -database test NULL user NULL · test -datestyle ISO, MDY NULL user NULL ISO, MDY ISO, MDY -declare_cursor_statement_timeout_enabled on NULL user NULL on on -default_int_size 8 NULL user NULL 8 8 -default_table_access_method heap NULL user NULL heap heap -default_tablespace · NULL user NULL · · -default_text_search_config pg_catalog.english NULL user NULL pg_catalog.english pg_catalog.english -default_transaction_isolation serializable NULL user NULL default default -default_transaction_priority normal NULL user NULL normal normal -default_transaction_quality_of_service regular NULL user NULL regular regular -default_transaction_read_only off NULL user NULL off off -default_transaction_use_follower_reads off NULL user NULL off off -default_with_oids off NULL user NULL off off -descriptor_validation on NULL user NULL on on -disable_hoist_projection_in_join_limitation off NULL user NULL off off -disable_partially_distributed_plans off NULL user NULL off off -disable_plan_gists off NULL user NULL off off -disallow_full_table_scans off NULL user NULL off off -distsql off NULL user NULL off off -enable_auto_rehoming off NULL user NULL off off -enable_create_stats_using_extremes off NULL user NULL off off -enable_experimental_alter_column_type_general off NULL user NULL off off -enable_implicit_select_for_update on NULL user NULL on on -enable_implicit_transaction_for_batch_statements on NULL user NULL on on -enable_insert_fast_path on NULL user NULL on on -enable_multiple_modifications_of_table off NULL user NULL off off -enable_multiregion_placement_policy off NULL user NULL off off -enable_seqscan on NULL user NULL on on -enable_super_regions off NULL user NULL off off -enable_zigzag_join on NULL user NULL on on -enforce_home_region off NULL user NULL off off -enforce_home_region_follower_reads_enabled off NULL user NULL off off -escape_string_warning on NULL user NULL on on -expect_and_ignore_not_visible_columns_in_copy off NULL user NULL off off -experimental_distsql_planning off NULL user NULL off off -experimental_enable_auto_rehoming off NULL user NULL off off -experimental_enable_implicit_column_partitioning off NULL user NULL off off -experimental_enable_temp_tables off NULL user NULL off off -experimental_enable_unique_without_index_constraints on NULL user NULL off off -experimental_hash_group_join_enabled off NULL user NULL off off -extra_float_digits 1 NULL user NULL 1 2 -force_savepoint_restart off NULL user NULL off off -foreign_key_cascades_limit 10000 NULL user NULL 10000 10000 -idle_in_session_timeout 0 NULL user NULL 0s 0s -idle_in_transaction_session_timeout 0 NULL user NULL 0s 0s -idle_session_timeout 0 NULL user NULL 0s 0s -index_join_streamer_batch_size 8.0 MiB NULL user NULL 8.0 MiB 8.0 MiB -index_recommendations_enabled off NULL user NULL on on -inject_retry_errors_enabled off NULL user NULL off off -inject_retry_errors_on_commit_enabled off NULL user NULL off off -integer_datetimes on NULL user NULL on on -intervalstyle postgres NULL user NULL postgres postgres -is_superuser on NULL user NULL on on -join_reader_index_join_strategy_batch_size 4.0 MiB NULL user NULL 4.0 MiB 4.0 MiB -join_reader_no_ordering_strategy_batch_size 2.0 MiB NULL user NULL 2.0 MiB 2.0 MiB -join_reader_ordering_strategy_batch_size 100 KiB NULL user NULL 100 KiB 100 KiB -large_full_scan_rows 1000 NULL user NULL 1000 1000 -lc_collate C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 -lc_ctype C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 -lc_messages C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 -lc_monetary C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 -lc_numeric C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 -lc_time C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 -locality region=test,dc=dc1 NULL user NULL region=test,dc=dc1 region=test,dc=dc1 -locality_optimized_partitioned_index_scan on NULL user NULL on on -lock_timeout 0 NULL user NULL 0s 0s -log_timezone UTC NULL user NULL UTC UTC -max_identifier_length 128 NULL user NULL 128 128 -max_index_keys 32 NULL user NULL 32 32 -node_id 1 NULL user NULL 1 1 -null_ordered_last off NULL user NULL off off -on_update_rehome_row_enabled on NULL user NULL on on -opt_split_scan_limit 2048 NULL user NULL 2048 2048 -optimizer_always_use_histograms on NULL user NULL on on -optimizer_hoist_uncorrelated_equality_subqueries off NULL user NULL off off -optimizer_use_forecasts on NULL user NULL on on -optimizer_use_histograms on NULL user NULL on on -optimizer_use_improved_disjunction_stats on NULL user NULL on on -optimizer_use_improved_split_disjunction_for_joins on NULL user NULL on on -optimizer_use_limit_ordering_for_streaming_group_by on NULL user NULL on on -optimizer_use_multicol_stats on NULL user NULL on on -optimizer_use_not_visible_indexes off NULL user NULL off off -override_multi_region_zone_config off NULL user NULL off off -parallelize_multi_key_lookup_joins_enabled off NULL user NULL false false -password_encryption scram-sha-256 NULL user NULL scram-sha-256 scram-sha-256 -pg_trgm.similarity_threshold 0.3 NULL user NULL 0.3 0.3 -prefer_lookup_joins_for_fks off NULL user NULL off off -prepared_statements_cache_size 0 B NULL user NULL 0 B 0 B -propagate_input_ordering off NULL user NULL off off -reorder_joins_limit 8 NULL user NULL 8 8 -require_explicit_primary_keys off NULL user NULL off off -results_buffer_size 16384 NULL user NULL 16384 16384 -role none NULL user NULL none none -row_security off NULL user NULL off off -search_path "$user", public NULL user NULL "$user", public "$user", public -serial_normalization rowid NULL user NULL rowid rowid -server_encoding UTF8 NULL user NULL UTF8 UTF8 -server_version 13.0.0 NULL user NULL 13.0.0 13.0.0 -server_version_num 130000 NULL user NULL 130000 130000 -session_user root NULL user NULL root root -show_primary_key_constraint_on_not_visible_columns on NULL user NULL on on -sql_safe_updates off NULL user NULL off off -standard_conforming_strings on NULL user NULL on on -statement_timeout 0 NULL user NULL 0s 0s -streamer_enabled on NULL user NULL on on -stub_catalog_tables on NULL user NULL on on -synchronize_seqscans on NULL user NULL on on -synchronous_commit on NULL user NULL on on -system_identity root NULL user NULL root root -testing_optimizer_cost_perturbation 0 NULL user NULL 0 0 -testing_optimizer_disable_rule_probability 0 NULL user NULL 0 0 -testing_optimizer_random_seed 0 NULL user NULL 0 0 -testing_vectorize_inject_panics off NULL user NULL off off -timezone UTC NULL user NULL UTC UTC -tracing off NULL user NULL off off -transaction_isolation serializable NULL user NULL serializable serializable -transaction_priority normal NULL user NULL normal normal -transaction_read_only off NULL user NULL off off -transaction_rows_read_err 0 NULL user NULL 0 0 -transaction_rows_read_log 0 NULL user NULL 0 0 -transaction_rows_written_err 0 NULL user NULL 0 0 -transaction_rows_written_log 0 NULL user NULL 0 0 -transaction_status NoTxn NULL user NULL NoTxn NoTxn -transaction_timeout 0 NULL user NULL 0 0 -troubleshooting_mode off NULL user NULL off off -unbounded_parallel_scans off NULL user NULL off off -unconstrained_non_covering_index_scan_enabled off NULL user NULL off off -use_declarative_schema_changer on NULL user NULL on on -variable_inequality_lookup_join_enabled on NULL user NULL on on -vectorize on NULL user NULL on on -xmloption content NULL user NULL content content +name setting unit context enumvals boot_val reset_val +allow_ordinal_column_references off NULL user NULL off off +allow_role_memberships_to_change_during_transaction off NULL user NULL off off +alter_primary_region_super_region_override off NULL user NULL off off +application_name · NULL user NULL · · +avoid_buffering off NULL user NULL false false +backslash_quote safe_encoding NULL user NULL safe_encoding safe_encoding +bytea_output hex NULL user NULL hex hex +check_function_bodies on NULL user NULL on on +client_encoding UTF8 NULL user NULL UTF8 UTF8 +client_min_messages notice NULL user NULL notice notice +copy_from_atomic_enabled on NULL user NULL on on +copy_from_retries_enabled on NULL user NULL on on +cost_scans_with_default_col_size off NULL user NULL off off +database test NULL user NULL · test +datestyle ISO, MDY NULL user NULL ISO, MDY ISO, MDY +declare_cursor_statement_timeout_enabled on NULL user NULL on on +default_int_size 8 NULL user NULL 8 8 +default_table_access_method heap NULL user NULL heap heap +default_tablespace · NULL user NULL · · +default_text_search_config pg_catalog.english NULL user NULL pg_catalog.english pg_catalog.english +default_transaction_isolation serializable NULL user NULL default default +default_transaction_priority normal NULL user NULL normal normal +default_transaction_quality_of_service regular NULL user NULL regular regular +default_transaction_read_only off NULL user NULL off off +default_transaction_use_follower_reads off NULL user NULL off off +default_with_oids off NULL user NULL off off +descriptor_validation on NULL user NULL on on +disable_hoist_projection_in_join_limitation off NULL user NULL off off +disable_partially_distributed_plans off NULL user NULL off off +disable_plan_gists off NULL user NULL off off +disallow_full_table_scans off NULL user NULL off off +distsql off NULL user NULL off off +enable_auto_rehoming off NULL user NULL off off +enable_create_stats_using_extremes off NULL user NULL off off +enable_experimental_alter_column_type_general off NULL user NULL off off +enable_implicit_select_for_update on NULL user NULL on on +enable_implicit_transaction_for_batch_statements on NULL user NULL on on +enable_insert_fast_path on NULL user NULL on on +enable_multiple_modifications_of_table off NULL user NULL off off +enable_multiregion_placement_policy off NULL user NULL off off +enable_seqscan on NULL user NULL on on +enable_super_regions off NULL user NULL off off +enable_zigzag_join on NULL user NULL on on +enforce_home_region off NULL user NULL off off +enforce_home_region_follower_reads_enabled off NULL user NULL off off +escape_string_warning on NULL user NULL on on +expect_and_ignore_not_visible_columns_in_copy off NULL user NULL off off +experimental_distsql_planning off NULL user NULL off off +experimental_enable_auto_rehoming off NULL user NULL off off +experimental_enable_implicit_column_partitioning off NULL user NULL off off +experimental_enable_temp_tables off NULL user NULL off off +experimental_enable_unique_without_index_constraints on NULL user NULL off off +experimental_hash_group_join_enabled off NULL user NULL off off +extra_float_digits 1 NULL user NULL 1 2 +force_savepoint_restart off NULL user NULL off off +foreign_key_cascades_limit 10000 NULL user NULL 10000 10000 +idle_in_session_timeout 0 NULL user NULL 0s 0s +idle_in_transaction_session_timeout 0 NULL user NULL 0s 0s +idle_session_timeout 0 NULL user NULL 0s 0s +index_join_streamer_batch_size 8.0 MiB NULL user NULL 8.0 MiB 8.0 MiB +index_recommendations_enabled off NULL user NULL on on +inject_retry_errors_enabled off NULL user NULL off off +inject_retry_errors_on_commit_enabled off NULL user NULL off off +integer_datetimes on NULL user NULL on on +intervalstyle postgres NULL user NULL postgres postgres +is_superuser on NULL user NULL on on +join_reader_index_join_strategy_batch_size 4.0 MiB NULL user NULL 4.0 MiB 4.0 MiB +join_reader_no_ordering_strategy_batch_size 2.0 MiB NULL user NULL 2.0 MiB 2.0 MiB +join_reader_ordering_strategy_batch_size 100 KiB NULL user NULL 100 KiB 100 KiB +large_full_scan_rows 1000 NULL user NULL 1000 1000 +lc_collate C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 +lc_ctype C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 +lc_messages C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 +lc_monetary C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 +lc_numeric C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 +lc_time C.UTF-8 NULL user NULL C.UTF-8 C.UTF-8 +locality region=test,dc=dc1 NULL user NULL region=test,dc=dc1 region=test,dc=dc1 +locality_optimized_partitioned_index_scan on NULL user NULL on on +lock_timeout 0 NULL user NULL 0s 0s +log_timezone UTC NULL user NULL UTC UTC +max_identifier_length 128 NULL user NULL 128 128 +max_index_keys 32 NULL user NULL 32 32 +node_id 1 NULL user NULL 1 1 +null_ordered_last off NULL user NULL off off +on_update_rehome_row_enabled on NULL user NULL on on +opt_split_scan_limit 2048 NULL user NULL 2048 2048 +optimizer_always_use_histograms on NULL user NULL on on +optimizer_hoist_uncorrelated_equality_subqueries off NULL user NULL off off +optimizer_use_forecasts on NULL user NULL on on +optimizer_use_histograms on NULL user NULL on on +optimizer_use_improved_computed_column_filters_derivation off NULL user NULL off off +optimizer_use_improved_disjunction_stats on NULL user NULL on on +optimizer_use_improved_split_disjunction_for_joins on NULL user NULL on on +optimizer_use_limit_ordering_for_streaming_group_by on NULL user NULL on on +optimizer_use_multicol_stats on NULL user NULL on on +optimizer_use_not_visible_indexes off NULL user NULL off off +override_multi_region_zone_config off NULL user NULL off off +parallelize_multi_key_lookup_joins_enabled off NULL user NULL false false +password_encryption scram-sha-256 NULL user NULL scram-sha-256 scram-sha-256 +pg_trgm.similarity_threshold 0.3 NULL user NULL 0.3 0.3 +prefer_lookup_joins_for_fks off NULL user NULL off off +prepared_statements_cache_size 0 B NULL user NULL 0 B 0 B +propagate_input_ordering off NULL user NULL off off +reorder_joins_limit 8 NULL user NULL 8 8 +require_explicit_primary_keys off NULL user NULL off off +results_buffer_size 16384 NULL user NULL 16384 16384 +role none NULL user NULL none none +row_security off NULL user NULL off off +search_path "$user", public NULL user NULL "$user", public "$user", public +serial_normalization rowid NULL user NULL rowid rowid +server_encoding UTF8 NULL user NULL UTF8 UTF8 +server_version 13.0.0 NULL user NULL 13.0.0 13.0.0 +server_version_num 130000 NULL user NULL 130000 130000 +session_user root NULL user NULL root root +show_primary_key_constraint_on_not_visible_columns on NULL user NULL on on +sql_safe_updates off NULL user NULL off off +standard_conforming_strings on NULL user NULL on on +statement_timeout 0 NULL user NULL 0s 0s +streamer_enabled on NULL user NULL on on +stub_catalog_tables on NULL user NULL on on +synchronize_seqscans on NULL user NULL on on +synchronous_commit on NULL user NULL on on +system_identity root NULL user NULL root root +testing_optimizer_cost_perturbation 0 NULL user NULL 0 0 +testing_optimizer_disable_rule_probability 0 NULL user NULL 0 0 +testing_optimizer_random_seed 0 NULL user NULL 0 0 +testing_vectorize_inject_panics off NULL user NULL off off +timezone UTC NULL user NULL UTC UTC +tracing off NULL user NULL off off +transaction_isolation serializable NULL user NULL serializable serializable +transaction_priority normal NULL user NULL normal normal +transaction_read_only off NULL user NULL off off +transaction_rows_read_err 0 NULL user NULL 0 0 +transaction_rows_read_log 0 NULL user NULL 0 0 +transaction_rows_written_err 0 NULL user NULL 0 0 +transaction_rows_written_log 0 NULL user NULL 0 0 +transaction_status NoTxn NULL user NULL NoTxn NoTxn +transaction_timeout 0 NULL user NULL 0 0 +troubleshooting_mode off NULL user NULL off off +unbounded_parallel_scans off NULL user NULL off off +unconstrained_non_covering_index_scan_enabled off NULL user NULL off off +use_declarative_schema_changer on NULL user NULL on on +variable_inequality_lookup_join_enabled on NULL user NULL on on +vectorize on NULL user NULL on on +xmloption content NULL user NULL content content query TTTTTT colnames SELECT name, source, min_val, max_val, sourcefile, sourceline FROM pg_catalog.pg_settings ---- -name source min_val max_val sourcefile sourceline -allow_ordinal_column_references NULL NULL NULL NULL NULL -allow_role_memberships_to_change_during_transaction NULL NULL NULL NULL NULL -alter_primary_region_super_region_override NULL NULL NULL NULL NULL -application_name NULL NULL NULL NULL NULL -avoid_buffering NULL NULL NULL NULL NULL -backslash_quote NULL NULL NULL NULL NULL -bytea_output NULL NULL NULL NULL NULL -check_function_bodies NULL NULL NULL NULL NULL -client_encoding NULL NULL NULL NULL NULL -client_min_messages NULL NULL NULL NULL NULL -copy_fast_path_enabled NULL NULL NULL NULL NULL -copy_from_atomic_enabled NULL NULL NULL NULL NULL -copy_from_retries_enabled NULL NULL NULL NULL NULL -cost_scans_with_default_col_size NULL NULL NULL NULL NULL -crdb_version NULL NULL NULL NULL NULL -database NULL NULL NULL NULL NULL -datestyle NULL NULL NULL NULL NULL -declare_cursor_statement_timeout_enabled NULL NULL NULL NULL NULL -default_int_size NULL NULL NULL NULL NULL -default_table_access_method NULL NULL NULL NULL NULL -default_tablespace NULL NULL NULL NULL NULL -default_text_search_config NULL NULL NULL NULL NULL -default_transaction_isolation NULL NULL NULL NULL NULL -default_transaction_priority NULL NULL NULL NULL NULL -default_transaction_quality_of_service NULL NULL NULL NULL NULL -default_transaction_read_only NULL NULL NULL NULL NULL -default_transaction_use_follower_reads NULL NULL NULL NULL NULL -default_with_oids NULL NULL NULL NULL NULL -descriptor_validation NULL NULL NULL NULL NULL -direct_columnar_scans_enabled NULL NULL NULL NULL NULL -disable_hoist_projection_in_join_limitation NULL NULL NULL NULL NULL -disable_partially_distributed_plans NULL NULL NULL NULL NULL -disable_plan_gists NULL NULL NULL NULL NULL -disallow_full_table_scans NULL NULL NULL NULL NULL -distsql NULL NULL NULL NULL NULL -distsql_workmem NULL NULL NULL NULL NULL -enable_auto_rehoming NULL NULL NULL NULL NULL -enable_create_stats_using_extremes NULL NULL NULL NULL NULL -enable_experimental_alter_column_type_general NULL NULL NULL NULL NULL -enable_implicit_select_for_update NULL NULL NULL NULL NULL -enable_implicit_transaction_for_batch_statements NULL NULL NULL NULL NULL -enable_insert_fast_path NULL NULL NULL NULL NULL -enable_multiple_modifications_of_table NULL NULL NULL NULL NULL -enable_multiregion_placement_policy NULL NULL NULL NULL NULL -enable_seqscan NULL NULL NULL NULL NULL -enable_super_regions NULL NULL NULL NULL NULL -enable_zigzag_join NULL NULL NULL NULL NULL -enforce_home_region NULL NULL NULL NULL NULL -enforce_home_region_follower_reads_enabled NULL NULL NULL NULL NULL -escape_string_warning NULL NULL NULL NULL NULL -expect_and_ignore_not_visible_columns_in_copy NULL NULL NULL NULL NULL -experimental_distsql_planning NULL NULL NULL NULL NULL -experimental_enable_auto_rehoming NULL NULL NULL NULL NULL -experimental_enable_implicit_column_partitioning NULL NULL NULL NULL NULL -experimental_enable_temp_tables NULL NULL NULL NULL NULL -experimental_enable_unique_without_index_constraints NULL NULL NULL NULL NULL -experimental_hash_group_join_enabled NULL NULL NULL NULL NULL -extra_float_digits NULL NULL NULL NULL NULL -force_savepoint_restart NULL NULL NULL NULL NULL -foreign_key_cascades_limit NULL NULL NULL NULL NULL -idle_in_session_timeout NULL NULL NULL NULL NULL -idle_in_transaction_session_timeout NULL NULL NULL NULL NULL -idle_session_timeout NULL NULL NULL NULL NULL -index_join_streamer_batch_size NULL NULL NULL NULL NULL -index_recommendations_enabled NULL NULL NULL NULL NULL -inject_retry_errors_enabled NULL NULL NULL NULL NULL -inject_retry_errors_on_commit_enabled NULL NULL NULL NULL NULL -integer_datetimes NULL NULL NULL NULL NULL -intervalstyle NULL NULL NULL NULL NULL -is_superuser NULL NULL NULL NULL NULL -join_reader_index_join_strategy_batch_size NULL NULL NULL NULL NULL -join_reader_no_ordering_strategy_batch_size NULL NULL NULL NULL NULL -join_reader_ordering_strategy_batch_size NULL NULL NULL NULL NULL -large_full_scan_rows NULL NULL NULL NULL NULL -lc_collate NULL NULL NULL NULL NULL -lc_ctype NULL NULL NULL NULL NULL -lc_messages NULL NULL NULL NULL NULL -lc_monetary NULL NULL NULL NULL NULL -lc_numeric NULL NULL NULL NULL NULL -lc_time NULL NULL NULL NULL NULL -locality NULL NULL NULL NULL NULL -locality_optimized_partitioned_index_scan NULL NULL NULL NULL NULL -lock_timeout NULL NULL NULL NULL NULL -log_timezone NULL NULL NULL NULL NULL -max_identifier_length NULL NULL NULL NULL NULL -max_index_keys NULL NULL NULL NULL NULL -multiple_active_portals_enabled NULL NULL NULL NULL NULL -node_id NULL NULL NULL NULL NULL -null_ordered_last NULL NULL NULL NULL NULL -on_update_rehome_row_enabled NULL NULL NULL NULL NULL -opt_split_scan_limit NULL NULL NULL NULL NULL -optimizer NULL NULL NULL NULL NULL -optimizer_always_use_histograms NULL NULL NULL NULL NULL -optimizer_hoist_uncorrelated_equality_subqueries NULL NULL NULL NULL NULL -optimizer_use_forecasts NULL NULL NULL NULL NULL -optimizer_use_histograms NULL NULL NULL NULL NULL -optimizer_use_improved_disjunction_stats NULL NULL NULL NULL NULL -optimizer_use_improved_split_disjunction_for_joins NULL NULL NULL NULL NULL -optimizer_use_limit_ordering_for_streaming_group_by NULL NULL NULL NULL NULL -optimizer_use_multicol_stats NULL NULL NULL NULL NULL -optimizer_use_not_visible_indexes NULL NULL NULL NULL NULL -override_multi_region_zone_config NULL NULL NULL NULL NULL -parallelize_multi_key_lookup_joins_enabled NULL NULL NULL NULL NULL -password_encryption NULL NULL NULL NULL NULL -pg_trgm.similarity_threshold NULL NULL NULL NULL NULL -prefer_lookup_joins_for_fks NULL NULL NULL NULL NULL -prepared_statements_cache_size NULL NULL NULL NULL NULL -propagate_input_ordering NULL NULL NULL NULL NULL -reorder_joins_limit NULL NULL NULL NULL NULL -require_explicit_primary_keys NULL NULL NULL NULL NULL -results_buffer_size NULL NULL NULL NULL NULL -role NULL NULL NULL NULL NULL -row_security NULL NULL NULL NULL NULL -search_path NULL NULL NULL NULL NULL -serial_normalization NULL NULL NULL NULL NULL -server_encoding NULL NULL NULL NULL NULL -server_version NULL NULL NULL NULL NULL -server_version_num NULL NULL NULL NULL NULL -session_id NULL NULL NULL NULL NULL -session_user NULL NULL NULL NULL NULL -show_primary_key_constraint_on_not_visible_columns NULL NULL NULL NULL NULL -sql_safe_updates NULL NULL NULL NULL NULL -standard_conforming_strings NULL NULL NULL NULL NULL -statement_timeout NULL NULL NULL NULL NULL -streamer_enabled NULL NULL NULL NULL NULL -stub_catalog_tables NULL NULL NULL NULL NULL -synchronize_seqscans NULL NULL NULL NULL NULL -synchronous_commit NULL NULL NULL NULL NULL -system_identity NULL NULL NULL NULL NULL -testing_optimizer_cost_perturbation NULL NULL NULL NULL NULL -testing_optimizer_disable_rule_probability NULL NULL NULL NULL NULL -testing_optimizer_random_seed NULL NULL NULL NULL NULL -testing_vectorize_inject_panics NULL NULL NULL NULL NULL -timezone NULL NULL NULL NULL NULL -tracing NULL NULL NULL NULL NULL -transaction_isolation NULL NULL NULL NULL NULL -transaction_priority NULL NULL NULL NULL NULL -transaction_read_only NULL NULL NULL NULL NULL -transaction_rows_read_err NULL NULL NULL NULL NULL -transaction_rows_read_log NULL NULL NULL NULL NULL -transaction_rows_written_err NULL NULL NULL NULL NULL -transaction_rows_written_log NULL NULL NULL NULL NULL -transaction_status NULL NULL NULL NULL NULL -transaction_timeout NULL NULL NULL NULL NULL -troubleshooting_mode NULL NULL NULL NULL NULL -unbounded_parallel_scans NULL NULL NULL NULL NULL -unconstrained_non_covering_index_scan_enabled NULL NULL NULL NULL NULL -use_declarative_schema_changer NULL NULL NULL NULL NULL -variable_inequality_lookup_join_enabled NULL NULL NULL NULL NULL -vectorize NULL NULL NULL NULL NULL -xmloption NULL NULL NULL NULL NULL +name source min_val max_val sourcefile sourceline +allow_ordinal_column_references NULL NULL NULL NULL NULL +allow_role_memberships_to_change_during_transaction NULL NULL NULL NULL NULL +alter_primary_region_super_region_override NULL NULL NULL NULL NULL +application_name NULL NULL NULL NULL NULL +avoid_buffering NULL NULL NULL NULL NULL +backslash_quote NULL NULL NULL NULL NULL +bytea_output NULL NULL NULL NULL NULL +check_function_bodies NULL NULL NULL NULL NULL +client_encoding NULL NULL NULL NULL NULL +client_min_messages NULL NULL NULL NULL NULL +copy_fast_path_enabled NULL NULL NULL NULL NULL +copy_from_atomic_enabled NULL NULL NULL NULL NULL +copy_from_retries_enabled NULL NULL NULL NULL NULL +cost_scans_with_default_col_size NULL NULL NULL NULL NULL +crdb_version NULL NULL NULL NULL NULL +database NULL NULL NULL NULL NULL +datestyle NULL NULL NULL NULL NULL +declare_cursor_statement_timeout_enabled NULL NULL NULL NULL NULL +default_int_size NULL NULL NULL NULL NULL +default_table_access_method NULL NULL NULL NULL NULL +default_tablespace NULL NULL NULL NULL NULL +default_text_search_config NULL NULL NULL NULL NULL +default_transaction_isolation NULL NULL NULL NULL NULL +default_transaction_priority NULL NULL NULL NULL NULL +default_transaction_quality_of_service NULL NULL NULL NULL NULL +default_transaction_read_only NULL NULL NULL NULL NULL +default_transaction_use_follower_reads NULL NULL NULL NULL NULL +default_with_oids NULL NULL NULL NULL NULL +descriptor_validation NULL NULL NULL NULL NULL +direct_columnar_scans_enabled NULL NULL NULL NULL NULL +disable_hoist_projection_in_join_limitation NULL NULL NULL NULL NULL +disable_partially_distributed_plans NULL NULL NULL NULL NULL +disable_plan_gists NULL NULL NULL NULL NULL +disallow_full_table_scans NULL NULL NULL NULL NULL +distsql NULL NULL NULL NULL NULL +distsql_workmem NULL NULL NULL NULL NULL +enable_auto_rehoming NULL NULL NULL NULL NULL +enable_create_stats_using_extremes NULL NULL NULL NULL NULL +enable_experimental_alter_column_type_general NULL NULL NULL NULL NULL +enable_implicit_select_for_update NULL NULL NULL NULL NULL +enable_implicit_transaction_for_batch_statements NULL NULL NULL NULL NULL +enable_insert_fast_path NULL NULL NULL NULL NULL +enable_multiple_modifications_of_table NULL NULL NULL NULL NULL +enable_multiregion_placement_policy NULL NULL NULL NULL NULL +enable_seqscan NULL NULL NULL NULL NULL +enable_super_regions NULL NULL NULL NULL NULL +enable_zigzag_join NULL NULL NULL NULL NULL +enforce_home_region NULL NULL NULL NULL NULL +enforce_home_region_follower_reads_enabled NULL NULL NULL NULL NULL +escape_string_warning NULL NULL NULL NULL NULL +expect_and_ignore_not_visible_columns_in_copy NULL NULL NULL NULL NULL +experimental_distsql_planning NULL NULL NULL NULL NULL +experimental_enable_auto_rehoming NULL NULL NULL NULL NULL +experimental_enable_implicit_column_partitioning NULL NULL NULL NULL NULL +experimental_enable_temp_tables NULL NULL NULL NULL NULL +experimental_enable_unique_without_index_constraints NULL NULL NULL NULL NULL +experimental_hash_group_join_enabled NULL NULL NULL NULL NULL +extra_float_digits NULL NULL NULL NULL NULL +force_savepoint_restart NULL NULL NULL NULL NULL +foreign_key_cascades_limit NULL NULL NULL NULL NULL +idle_in_session_timeout NULL NULL NULL NULL NULL +idle_in_transaction_session_timeout NULL NULL NULL NULL NULL +idle_session_timeout NULL NULL NULL NULL NULL +index_join_streamer_batch_size NULL NULL NULL NULL NULL +index_recommendations_enabled NULL NULL NULL NULL NULL +inject_retry_errors_enabled NULL NULL NULL NULL NULL +inject_retry_errors_on_commit_enabled NULL NULL NULL NULL NULL +integer_datetimes NULL NULL NULL NULL NULL +intervalstyle NULL NULL NULL NULL NULL +is_superuser NULL NULL NULL NULL NULL +join_reader_index_join_strategy_batch_size NULL NULL NULL NULL NULL +join_reader_no_ordering_strategy_batch_size NULL NULL NULL NULL NULL +join_reader_ordering_strategy_batch_size NULL NULL NULL NULL NULL +large_full_scan_rows NULL NULL NULL NULL NULL +lc_collate NULL NULL NULL NULL NULL +lc_ctype NULL NULL NULL NULL NULL +lc_messages NULL NULL NULL NULL NULL +lc_monetary NULL NULL NULL NULL NULL +lc_numeric NULL NULL NULL NULL NULL +lc_time NULL NULL NULL NULL NULL +locality NULL NULL NULL NULL NULL +locality_optimized_partitioned_index_scan NULL NULL NULL NULL NULL +lock_timeout NULL NULL NULL NULL NULL +log_timezone NULL NULL NULL NULL NULL +max_identifier_length NULL NULL NULL NULL NULL +max_index_keys NULL NULL NULL NULL NULL +multiple_active_portals_enabled NULL NULL NULL NULL NULL +node_id NULL NULL NULL NULL NULL +null_ordered_last NULL NULL NULL NULL NULL +on_update_rehome_row_enabled NULL NULL NULL NULL NULL +opt_split_scan_limit NULL NULL NULL NULL NULL +optimizer NULL NULL NULL NULL NULL +optimizer_always_use_histograms NULL NULL NULL NULL NULL +optimizer_hoist_uncorrelated_equality_subqueries NULL NULL NULL NULL NULL +optimizer_use_forecasts NULL NULL NULL NULL NULL +optimizer_use_histograms NULL NULL NULL NULL NULL +optimizer_use_improved_computed_column_filters_derivation NULL NULL NULL NULL NULL +optimizer_use_improved_disjunction_stats NULL NULL NULL NULL NULL +optimizer_use_improved_split_disjunction_for_joins NULL NULL NULL NULL NULL +optimizer_use_limit_ordering_for_streaming_group_by NULL NULL NULL NULL NULL +optimizer_use_multicol_stats NULL NULL NULL NULL NULL +optimizer_use_not_visible_indexes NULL NULL NULL NULL NULL +override_multi_region_zone_config NULL NULL NULL NULL NULL +parallelize_multi_key_lookup_joins_enabled NULL NULL NULL NULL NULL +password_encryption NULL NULL NULL NULL NULL +pg_trgm.similarity_threshold NULL NULL NULL NULL NULL +prefer_lookup_joins_for_fks NULL NULL NULL NULL NULL +prepared_statements_cache_size NULL NULL NULL NULL NULL +propagate_input_ordering NULL NULL NULL NULL NULL +reorder_joins_limit NULL NULL NULL NULL NULL +require_explicit_primary_keys NULL NULL NULL NULL NULL +results_buffer_size NULL NULL NULL NULL NULL +role NULL NULL NULL NULL NULL +row_security NULL NULL NULL NULL NULL +search_path NULL NULL NULL NULL NULL +serial_normalization NULL NULL NULL NULL NULL +server_encoding NULL NULL NULL NULL NULL +server_version NULL NULL NULL NULL NULL +server_version_num NULL NULL NULL NULL NULL +session_id NULL NULL NULL NULL NULL +session_user NULL NULL NULL NULL NULL +show_primary_key_constraint_on_not_visible_columns NULL NULL NULL NULL NULL +sql_safe_updates NULL NULL NULL NULL NULL +standard_conforming_strings NULL NULL NULL NULL NULL +statement_timeout NULL NULL NULL NULL NULL +streamer_enabled NULL NULL NULL NULL NULL +stub_catalog_tables NULL NULL NULL NULL NULL +synchronize_seqscans NULL NULL NULL NULL NULL +synchronous_commit NULL NULL NULL NULL NULL +system_identity NULL NULL NULL NULL NULL +testing_optimizer_cost_perturbation NULL NULL NULL NULL NULL +testing_optimizer_disable_rule_probability NULL NULL NULL NULL NULL +testing_optimizer_random_seed NULL NULL NULL NULL NULL +testing_vectorize_inject_panics NULL NULL NULL NULL NULL +timezone NULL NULL NULL NULL NULL +tracing NULL NULL NULL NULL NULL +transaction_isolation NULL NULL NULL NULL NULL +transaction_priority NULL NULL NULL NULL NULL +transaction_read_only NULL NULL NULL NULL NULL +transaction_rows_read_err NULL NULL NULL NULL NULL +transaction_rows_read_log NULL NULL NULL NULL NULL +transaction_rows_written_err NULL NULL NULL NULL NULL +transaction_rows_written_log NULL NULL NULL NULL NULL +transaction_status NULL NULL NULL NULL NULL +transaction_timeout NULL NULL NULL NULL NULL +troubleshooting_mode NULL NULL NULL NULL NULL +unbounded_parallel_scans NULL NULL NULL NULL NULL +unconstrained_non_covering_index_scan_enabled NULL NULL NULL NULL NULL +use_declarative_schema_changer NULL NULL NULL NULL NULL +variable_inequality_lookup_join_enabled NULL NULL NULL NULL NULL +vectorize NULL NULL NULL NULL NULL +xmloption NULL NULL NULL NULL NULL # pg_catalog.pg_sequence diff --git a/pkg/sql/logictest/testdata/logic_test/show_source b/pkg/sql/logictest/testdata/logic_test/show_source index 19aeaced5bac..c695dd83155b 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_source +++ b/pkg/sql/logictest/testdata/logic_test/show_source @@ -25,151 +25,152 @@ SELECT * FROM [SHOW ALL] WHERE variable NOT IN ('optimizer', 'crdb_version', 'session_id', 'distsql_workmem', 'copy_fast_path_enabled', 'direct_columnar_scans_enabled', 'multiple_active_portals_enabled') ---- -variable value -allow_ordinal_column_references off -allow_role_memberships_to_change_during_transaction off -alter_primary_region_super_region_override off -application_name · -avoid_buffering off -backslash_quote safe_encoding -bytea_output hex -check_function_bodies on -client_encoding UTF8 -client_min_messages notice -copy_from_atomic_enabled on -copy_from_retries_enabled on -cost_scans_with_default_col_size off -database test -datestyle ISO, MDY -declare_cursor_statement_timeout_enabled on -default_int_size 8 -default_table_access_method heap -default_tablespace · -default_text_search_config pg_catalog.english -default_transaction_isolation serializable -default_transaction_priority normal -default_transaction_quality_of_service regular -default_transaction_read_only off -default_transaction_use_follower_reads off -default_with_oids off -descriptor_validation on -disable_hoist_projection_in_join_limitation off -disable_partially_distributed_plans off -disable_plan_gists off -disallow_full_table_scans off -distsql off -enable_auto_rehoming off -enable_create_stats_using_extremes off -enable_experimental_alter_column_type_general off -enable_implicit_select_for_update on -enable_implicit_transaction_for_batch_statements on -enable_insert_fast_path on -enable_multiple_modifications_of_table off -enable_multiregion_placement_policy off -enable_seqscan on -enable_super_regions off -enable_zigzag_join on -enforce_home_region off -enforce_home_region_follower_reads_enabled off -escape_string_warning on -expect_and_ignore_not_visible_columns_in_copy off -experimental_distsql_planning off -experimental_enable_auto_rehoming off -experimental_enable_implicit_column_partitioning off -experimental_enable_temp_tables off -experimental_enable_unique_without_index_constraints off -experimental_hash_group_join_enabled off -extra_float_digits 1 -force_savepoint_restart off -foreign_key_cascades_limit 10000 -idle_in_session_timeout 0 -idle_in_transaction_session_timeout 0 -idle_session_timeout 0 -index_join_streamer_batch_size 8.0 MiB -index_recommendations_enabled off -inject_retry_errors_enabled off -inject_retry_errors_on_commit_enabled off -integer_datetimes on -intervalstyle postgres -is_superuser on -join_reader_index_join_strategy_batch_size 4.0 MiB -join_reader_no_ordering_strategy_batch_size 2.0 MiB -join_reader_ordering_strategy_batch_size 100 KiB -large_full_scan_rows 1000 -lc_collate C.UTF-8 -lc_ctype C.UTF-8 -lc_messages C.UTF-8 -lc_monetary C.UTF-8 -lc_numeric C.UTF-8 -lc_time C.UTF-8 -locality region=test,dc=dc1 -locality_optimized_partitioned_index_scan on -lock_timeout 0 -log_timezone UTC -max_identifier_length 128 -max_index_keys 32 -node_id 1 -null_ordered_last off -on_update_rehome_row_enabled on -opt_split_scan_limit 2048 -optimizer_always_use_histograms on -optimizer_hoist_uncorrelated_equality_subqueries off -optimizer_use_forecasts on -optimizer_use_histograms on -optimizer_use_improved_disjunction_stats on -optimizer_use_improved_split_disjunction_for_joins on -optimizer_use_limit_ordering_for_streaming_group_by on -optimizer_use_multicol_stats on -optimizer_use_not_visible_indexes off -override_multi_region_zone_config off -parallelize_multi_key_lookup_joins_enabled off -password_encryption scram-sha-256 -pg_trgm.similarity_threshold 0.3 -prefer_lookup_joins_for_fks off -prepared_statements_cache_size 0 B -propagate_input_ordering off -reorder_joins_limit 8 -require_explicit_primary_keys off -results_buffer_size 16384 -role none -row_security off -search_path "$user", public -serial_normalization rowid -server_encoding UTF8 -server_version 13.0.0 -server_version_num 130000 -session_user root -show_primary_key_constraint_on_not_visible_columns on -sql_safe_updates off -standard_conforming_strings on -statement_timeout 0 -streamer_enabled on -stub_catalog_tables on -synchronize_seqscans on -synchronous_commit on -system_identity root -testing_optimizer_cost_perturbation 0 -testing_optimizer_disable_rule_probability 0 -testing_optimizer_random_seed 0 -testing_vectorize_inject_panics off -timezone UTC -tracing off -transaction_isolation serializable -transaction_priority normal -transaction_read_only off -transaction_rows_read_err 0 -transaction_rows_read_log 0 -transaction_rows_written_err 0 -transaction_rows_written_log 0 -transaction_status NoTxn -transaction_timeout 0 -troubleshooting_mode off -unbounded_parallel_scans off -unconstrained_non_covering_index_scan_enabled off -use_declarative_schema_changer on -variable_inequality_lookup_join_enabled on -vectorize on -xmloption content +variable value +allow_ordinal_column_references off +allow_role_memberships_to_change_during_transaction off +alter_primary_region_super_region_override off +application_name · +avoid_buffering off +backslash_quote safe_encoding +bytea_output hex +check_function_bodies on +client_encoding UTF8 +client_min_messages notice +copy_from_atomic_enabled on +copy_from_retries_enabled on +cost_scans_with_default_col_size off +database test +datestyle ISO, MDY +declare_cursor_statement_timeout_enabled on +default_int_size 8 +default_table_access_method heap +default_tablespace · +default_text_search_config pg_catalog.english +default_transaction_isolation serializable +default_transaction_priority normal +default_transaction_quality_of_service regular +default_transaction_read_only off +default_transaction_use_follower_reads off +default_with_oids off +descriptor_validation on +disable_hoist_projection_in_join_limitation off +disable_partially_distributed_plans off +disable_plan_gists off +disallow_full_table_scans off +distsql off +enable_auto_rehoming off +enable_create_stats_using_extremes off +enable_experimental_alter_column_type_general off +enable_implicit_select_for_update on +enable_implicit_transaction_for_batch_statements on +enable_insert_fast_path on +enable_multiple_modifications_of_table off +enable_multiregion_placement_policy off +enable_seqscan on +enable_super_regions off +enable_zigzag_join on +enforce_home_region off +enforce_home_region_follower_reads_enabled off +escape_string_warning on +expect_and_ignore_not_visible_columns_in_copy off +experimental_distsql_planning off +experimental_enable_auto_rehoming off +experimental_enable_implicit_column_partitioning off +experimental_enable_temp_tables off +experimental_enable_unique_without_index_constraints off +experimental_hash_group_join_enabled off +extra_float_digits 1 +force_savepoint_restart off +foreign_key_cascades_limit 10000 +idle_in_session_timeout 0 +idle_in_transaction_session_timeout 0 +idle_session_timeout 0 +index_join_streamer_batch_size 8.0 MiB +index_recommendations_enabled off +inject_retry_errors_enabled off +inject_retry_errors_on_commit_enabled off +integer_datetimes on +intervalstyle postgres +is_superuser on +join_reader_index_join_strategy_batch_size 4.0 MiB +join_reader_no_ordering_strategy_batch_size 2.0 MiB +join_reader_ordering_strategy_batch_size 100 KiB +large_full_scan_rows 1000 +lc_collate C.UTF-8 +lc_ctype C.UTF-8 +lc_messages C.UTF-8 +lc_monetary C.UTF-8 +lc_numeric C.UTF-8 +lc_time C.UTF-8 +locality region=test,dc=dc1 +locality_optimized_partitioned_index_scan on +lock_timeout 0 +log_timezone UTC +max_identifier_length 128 +max_index_keys 32 +node_id 1 +null_ordered_last off +on_update_rehome_row_enabled on +opt_split_scan_limit 2048 +optimizer_always_use_histograms on +optimizer_hoist_uncorrelated_equality_subqueries off +optimizer_use_forecasts on +optimizer_use_histograms on +optimizer_use_improved_computed_column_filters_derivation off +optimizer_use_improved_disjunction_stats on +optimizer_use_improved_split_disjunction_for_joins on +optimizer_use_limit_ordering_for_streaming_group_by on +optimizer_use_multicol_stats on +optimizer_use_not_visible_indexes off +override_multi_region_zone_config off +parallelize_multi_key_lookup_joins_enabled off +password_encryption scram-sha-256 +pg_trgm.similarity_threshold 0.3 +prefer_lookup_joins_for_fks off +prepared_statements_cache_size 0 B +propagate_input_ordering off +reorder_joins_limit 8 +require_explicit_primary_keys off +results_buffer_size 16384 +role none +row_security off +search_path "$user", public +serial_normalization rowid +server_encoding UTF8 +server_version 13.0.0 +server_version_num 130000 +session_user root +show_primary_key_constraint_on_not_visible_columns on +sql_safe_updates off +standard_conforming_strings on +statement_timeout 0 +streamer_enabled on +stub_catalog_tables on +synchronize_seqscans on +synchronous_commit on +system_identity root +testing_optimizer_cost_perturbation 0 +testing_optimizer_disable_rule_probability 0 +testing_optimizer_random_seed 0 +testing_vectorize_inject_panics off +timezone UTC +tracing off +transaction_isolation serializable +transaction_priority normal +transaction_read_only off +transaction_rows_read_err 0 +transaction_rows_read_log 0 +transaction_rows_written_err 0 +transaction_rows_written_log 0 +transaction_status NoTxn +transaction_timeout 0 +troubleshooting_mode off +unbounded_parallel_scans off +unconstrained_non_covering_index_scan_enabled off +use_declarative_schema_changer on +variable_inequality_lookup_join_enabled on +vectorize on +xmloption content query T colnames SELECT * FROM [SHOW CLUSTER SETTING sql.defaults.distsql] diff --git a/pkg/sql/opt/BUILD.bazel b/pkg/sql/opt/BUILD.bazel index 83def9f377e3..7fddd5428083 100644 --- a/pkg/sql/opt/BUILD.bazel +++ b/pkg/sql/opt/BUILD.bazel @@ -69,6 +69,7 @@ go_test( "//pkg/sql/opt/cat", "//pkg/sql/opt/memo", "//pkg/sql/opt/norm", + "//pkg/sql/opt/props", "//pkg/sql/opt/testutils/testcat", "//pkg/sql/privilege", "//pkg/sql/sem/catid", diff --git a/pkg/sql/opt/lookupjoin/constraint_builder_test.go b/pkg/sql/opt/lookupjoin/constraint_builder_test.go index 31f627ff062e..612481b773d3 100644 --- a/pkg/sql/opt/lookupjoin/constraint_builder_test.go +++ b/pkg/sql/opt/lookupjoin/constraint_builder_test.go @@ -106,7 +106,9 @@ func TestLookupConstraints(t *testing.T) { return 0, opt.ColSet{}, err } compExpr := f.Memo().RootExpr().(opt.ScalarExpr) - md.TableMeta(tableID).AddComputedCol(colID, compExpr) + var sharedProps props.Shared + memo.BuildSharedProps(compExpr, &sharedProps, &evalCtx) + md.TableMeta(tableID).AddComputedCol(colID, compExpr, sharedProps.OuterCols) } } return tableID, cols, nil diff --git a/pkg/sql/opt/memo/memo.go b/pkg/sql/opt/memo/memo.go index 427fb5f6bc6e..779cc5ede244 100644 --- a/pkg/sql/opt/memo/memo.go +++ b/pkg/sql/opt/memo/memo.go @@ -135,35 +135,36 @@ type Memo struct { // planning. We need to cross-check these before reusing a cached memo. // NOTE: If you add new fields here, be sure to add them to the relevant // fields in explain_bundle.go. - reorderJoinsLimit int - zigzagJoinEnabled bool - useForecasts bool - useHistograms bool - useMultiColStats bool - useNotVisibleIndex bool - localityOptimizedSearch bool - safeUpdates bool - preferLookupJoinsForFKs bool - saveTablesPrefix string - dateStyle pgdate.DateStyle - intervalStyle duration.IntervalStyle - propagateInputOrdering bool - disallowFullTableScans bool - largeFullScanRows float64 - nullOrderedLast bool - costScansWithDefaultColSize bool - allowUnconstrainedNonCoveringIndexScan bool - testingOptimizerRandomSeed int64 - testingOptimizerCostPerturbation float64 - testingOptimizerDisableRuleProbability float64 - enforceHomeRegion bool - variableInequalityLookupJoinEnabled bool - allowOrdinalColumnReferences bool - useImprovedDisjunctionStats bool - useLimitOrderingForStreamingGroupBy bool - useImprovedSplitDisjunctionForJoins bool - alwaysUseHistograms bool - hoistUncorrelatedEqualitySubqueries bool + reorderJoinsLimit int + zigzagJoinEnabled bool + useForecasts bool + useHistograms bool + useMultiColStats bool + useNotVisibleIndex bool + localityOptimizedSearch bool + safeUpdates bool + preferLookupJoinsForFKs bool + saveTablesPrefix string + dateStyle pgdate.DateStyle + intervalStyle duration.IntervalStyle + propagateInputOrdering bool + disallowFullTableScans bool + largeFullScanRows float64 + nullOrderedLast bool + costScansWithDefaultColSize bool + allowUnconstrainedNonCoveringIndexScan bool + testingOptimizerRandomSeed int64 + testingOptimizerCostPerturbation float64 + testingOptimizerDisableRuleProbability float64 + enforceHomeRegion bool + variableInequalityLookupJoinEnabled bool + allowOrdinalColumnReferences bool + useImprovedDisjunctionStats bool + useLimitOrderingForStreamingGroupBy bool + useImprovedSplitDisjunctionForJoins bool + alwaysUseHistograms bool + hoistUncorrelatedEqualitySubqueries bool + useImprovedComputedColumnFiltersDerivation bool // curRank is the highest currently in-use scalar expression rank. curRank opt.ScalarRank @@ -193,36 +194,37 @@ func (m *Memo) Init(ctx context.Context, evalCtx *eval.Context) { // This initialization pattern ensures that fields are not unwittingly // reused. Field reuse must be explicit. *m = Memo{ - metadata: m.metadata, - reorderJoinsLimit: int(evalCtx.SessionData().ReorderJoinsLimit), - zigzagJoinEnabled: evalCtx.SessionData().ZigzagJoinEnabled, - useForecasts: evalCtx.SessionData().OptimizerUseForecasts, - useHistograms: evalCtx.SessionData().OptimizerUseHistograms, - useMultiColStats: evalCtx.SessionData().OptimizerUseMultiColStats, - useNotVisibleIndex: evalCtx.SessionData().OptimizerUseNotVisibleIndexes, - localityOptimizedSearch: evalCtx.SessionData().LocalityOptimizedSearch, - safeUpdates: evalCtx.SessionData().SafeUpdates, - preferLookupJoinsForFKs: evalCtx.SessionData().PreferLookupJoinsForFKs, - saveTablesPrefix: evalCtx.SessionData().SaveTablesPrefix, - dateStyle: evalCtx.SessionData().GetDateStyle(), - intervalStyle: evalCtx.SessionData().GetIntervalStyle(), - propagateInputOrdering: evalCtx.SessionData().PropagateInputOrdering, - disallowFullTableScans: evalCtx.SessionData().DisallowFullTableScans, - largeFullScanRows: evalCtx.SessionData().LargeFullScanRows, - nullOrderedLast: evalCtx.SessionData().NullOrderedLast, - costScansWithDefaultColSize: evalCtx.SessionData().CostScansWithDefaultColSize, - allowUnconstrainedNonCoveringIndexScan: evalCtx.SessionData().UnconstrainedNonCoveringIndexScanEnabled, - testingOptimizerRandomSeed: evalCtx.SessionData().TestingOptimizerRandomSeed, - testingOptimizerCostPerturbation: evalCtx.SessionData().TestingOptimizerCostPerturbation, - testingOptimizerDisableRuleProbability: evalCtx.SessionData().TestingOptimizerDisableRuleProbability, - enforceHomeRegion: evalCtx.SessionData().EnforceHomeRegion, - variableInequalityLookupJoinEnabled: evalCtx.SessionData().VariableInequalityLookupJoinEnabled, - allowOrdinalColumnReferences: evalCtx.SessionData().AllowOrdinalColumnReferences, - useImprovedDisjunctionStats: evalCtx.SessionData().OptimizerUseImprovedDisjunctionStats, - useLimitOrderingForStreamingGroupBy: evalCtx.SessionData().OptimizerUseLimitOrderingForStreamingGroupBy, - useImprovedSplitDisjunctionForJoins: evalCtx.SessionData().OptimizerUseImprovedSplitDisjunctionForJoins, - alwaysUseHistograms: evalCtx.SessionData().OptimizerAlwaysUseHistograms, - hoistUncorrelatedEqualitySubqueries: evalCtx.SessionData().OptimizerHoistUncorrelatedEqualitySubqueries, + metadata: m.metadata, + reorderJoinsLimit: int(evalCtx.SessionData().ReorderJoinsLimit), + zigzagJoinEnabled: evalCtx.SessionData().ZigzagJoinEnabled, + useForecasts: evalCtx.SessionData().OptimizerUseForecasts, + useHistograms: evalCtx.SessionData().OptimizerUseHistograms, + useMultiColStats: evalCtx.SessionData().OptimizerUseMultiColStats, + useNotVisibleIndex: evalCtx.SessionData().OptimizerUseNotVisibleIndexes, + localityOptimizedSearch: evalCtx.SessionData().LocalityOptimizedSearch, + safeUpdates: evalCtx.SessionData().SafeUpdates, + preferLookupJoinsForFKs: evalCtx.SessionData().PreferLookupJoinsForFKs, + saveTablesPrefix: evalCtx.SessionData().SaveTablesPrefix, + dateStyle: evalCtx.SessionData().GetDateStyle(), + intervalStyle: evalCtx.SessionData().GetIntervalStyle(), + propagateInputOrdering: evalCtx.SessionData().PropagateInputOrdering, + disallowFullTableScans: evalCtx.SessionData().DisallowFullTableScans, + largeFullScanRows: evalCtx.SessionData().LargeFullScanRows, + nullOrderedLast: evalCtx.SessionData().NullOrderedLast, + costScansWithDefaultColSize: evalCtx.SessionData().CostScansWithDefaultColSize, + allowUnconstrainedNonCoveringIndexScan: evalCtx.SessionData().UnconstrainedNonCoveringIndexScanEnabled, + testingOptimizerRandomSeed: evalCtx.SessionData().TestingOptimizerRandomSeed, + testingOptimizerCostPerturbation: evalCtx.SessionData().TestingOptimizerCostPerturbation, + testingOptimizerDisableRuleProbability: evalCtx.SessionData().TestingOptimizerDisableRuleProbability, + enforceHomeRegion: evalCtx.SessionData().EnforceHomeRegion, + variableInequalityLookupJoinEnabled: evalCtx.SessionData().VariableInequalityLookupJoinEnabled, + allowOrdinalColumnReferences: evalCtx.SessionData().AllowOrdinalColumnReferences, + useImprovedDisjunctionStats: evalCtx.SessionData().OptimizerUseImprovedDisjunctionStats, + useLimitOrderingForStreamingGroupBy: evalCtx.SessionData().OptimizerUseLimitOrderingForStreamingGroupBy, + useImprovedSplitDisjunctionForJoins: evalCtx.SessionData().OptimizerUseImprovedSplitDisjunctionForJoins, + alwaysUseHistograms: evalCtx.SessionData().OptimizerAlwaysUseHistograms, + hoistUncorrelatedEqualitySubqueries: evalCtx.SessionData().OptimizerHoistUncorrelatedEqualitySubqueries, + useImprovedComputedColumnFiltersDerivation: evalCtx.SessionData().OptimizerUseImprovedComputedColumnFiltersDerivation, } m.metadata.Init() m.logPropsBuilder.init(ctx, evalCtx, m) @@ -365,7 +367,8 @@ func (m *Memo) IsStale( m.useLimitOrderingForStreamingGroupBy != evalCtx.SessionData().OptimizerUseLimitOrderingForStreamingGroupBy || m.useImprovedSplitDisjunctionForJoins != evalCtx.SessionData().OptimizerUseImprovedSplitDisjunctionForJoins || m.alwaysUseHistograms != evalCtx.SessionData().OptimizerAlwaysUseHistograms || - m.hoistUncorrelatedEqualitySubqueries != evalCtx.SessionData().OptimizerHoistUncorrelatedEqualitySubqueries { + m.hoistUncorrelatedEqualitySubqueries != evalCtx.SessionData().OptimizerHoistUncorrelatedEqualitySubqueries || + m.useImprovedComputedColumnFiltersDerivation != evalCtx.SessionData().OptimizerUseImprovedComputedColumnFiltersDerivation { return true, nil } diff --git a/pkg/sql/opt/memo/memo_test.go b/pkg/sql/opt/memo/memo_test.go index e7d8569d21de..d804a3d5719f 100644 --- a/pkg/sql/opt/memo/memo_test.go +++ b/pkg/sql/opt/memo/memo_test.go @@ -360,6 +360,12 @@ func TestMemoIsStale(t *testing.T) { evalCtx.SessionData().OptimizerHoistUncorrelatedEqualitySubqueries = false notStale() + // Stale optimizer_use_improved_computed_column_filters_derivation. + evalCtx.SessionData().OptimizerUseImprovedComputedColumnFiltersDerivation = true + stale() + evalCtx.SessionData().OptimizerUseImprovedComputedColumnFiltersDerivation = false + notStale() + // User no longer has access to view. catalog.View(tree.NewTableNameWithSchema("t", tree.PublicSchemaName, "abcview")).Revoked = true _, err = o.Memo().IsStale(ctx, &evalCtx, catalog) diff --git a/pkg/sql/opt/metadata.go b/pkg/sql/opt/metadata.go index 40974ed7cdfa..8b550d680f75 100644 --- a/pkg/sql/opt/metadata.go +++ b/pkg/sql/opt/metadata.go @@ -652,6 +652,7 @@ func (md *Metadata) DuplicateTable( // Create new computed column expressions by remapping the column IDs in // each ScalarExpr. var computedCols map[ColumnID]ScalarExpr + var referencedColsInComputedExpressions ColSet if len(tabMeta.ComputedCols) > 0 { computedCols = make(map[ColumnID]ScalarExpr, len(tabMeta.ComputedCols)) for colID, e := range tabMeta.ComputedCols { @@ -661,6 +662,9 @@ func (md *Metadata) DuplicateTable( } computedCols[ColumnID(newColID)] = remapColumnIDs(e, colMap) } + // Add columns present in newScalarExpr to referencedColsInComputedExpressions. + referencedColsInComputedExpressions = + tabMeta.ColsInComputedColsExpressions.CopyAndMaybeRemap(colMap) } // Create new partial index predicate expressions by remapping the column @@ -693,15 +697,16 @@ func (md *Metadata) DuplicateTable( } newTabMeta := TableMeta{ - MetaID: newTabID, - Table: tabMeta.Table, - Alias: tabMeta.Alias, - IgnoreForeignKeys: tabMeta.IgnoreForeignKeys, - Constraints: constraints, - ComputedCols: computedCols, - partialIndexPredicates: partialIndexPredicates, - indexPartitionLocalities: tabMeta.indexPartitionLocalities, - checkConstraintsStats: checkConstraintsStats, + MetaID: newTabID, + Table: tabMeta.Table, + Alias: tabMeta.Alias, + IgnoreForeignKeys: tabMeta.IgnoreForeignKeys, + Constraints: constraints, + ComputedCols: computedCols, + ColsInComputedColsExpressions: referencedColsInComputedExpressions, + partialIndexPredicates: partialIndexPredicates, + indexPartitionLocalities: tabMeta.indexPartitionLocalities, + checkConstraintsStats: checkConstraintsStats, } md.tables = append(md.tables, newTabMeta) regionConfig, ok := md.TableAnnotation(tabID, regionConfigAnnID).(*multiregion.RegionConfig) diff --git a/pkg/sql/opt/metadata_test.go b/pkg/sql/opt/metadata_test.go index fd5ec4bc643e..e6ae59e878da 100644 --- a/pkg/sql/opt/metadata_test.go +++ b/pkg/sql/opt/metadata_test.go @@ -23,6 +23,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/opt/cat" "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/opt/norm" + "github.com/cockroachdb/cockroach/pkg/sql/opt/props" "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/testcat" "github.com/cockroachdb/cockroach/pkg/sql/privilege" "github.com/cockroachdb/cockroach/pkg/sql/sem/catid" @@ -82,7 +83,9 @@ func TestMetadata(t *testing.T) { } tabMeta := md.TableMeta(tabID) tabMeta.SetConstraints(scalar) - tabMeta.AddComputedCol(cmpID, scalar) + var sharedProps props.Shared + memo.BuildSharedProps(scalar, &sharedProps, &evalCtx) + tabMeta.AddComputedCol(cmpID, scalar, sharedProps.OuterCols) tabMeta.AddPartialIndexPredicate(0, scalar) if md.AddSequence(&testcat.Sequence{SeqID: 100}) != seqID { t.Fatalf("unexpected sequence id") @@ -143,6 +146,10 @@ func TestMetadata(t *testing.T) { t.Fatalf("expected computed column expression to be copied") } + if !tabMeta.ColsInComputedColsExpressions.Equals(tabMetaNew.ColsInComputedColsExpressions) { + t.Fatalf("expected computed column expression referenced columns to be copied") + } + partialIdxPredPtr := reflect.ValueOf(tabMeta.PartialIndexPredicatesUnsafe()).Pointer() newPartialIdxPredPtr := reflect.ValueOf(tabMetaNew.PartialIndexPredicatesUnsafe()).Pointer() if newPartialIdxPredPtr == partialIdxPredPtr { @@ -382,13 +389,16 @@ func TestIndexColumns(t *testing.T) { // TestDuplicateTable tests that we can extract a set of columns from an index ordinal. func TestDuplicateTable(t *testing.T) { + evalCtx := eval.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) + var f norm.Factory + f.Init(context.Background(), &evalCtx, nil /* catalog */) + md := f.Metadata() cat := testcat.New() _, err := cat.ExecuteDDL("CREATE TABLE a (b BOOL, b2 BOOL, INDEX (b2) WHERE b)") if err != nil { t.Fatal(err) } - var md opt.Metadata tn := tree.NewUnqualifiedTableName("a") a := md.AddTable(cat.Table(tn), tn) b := a.ColumnID(0) @@ -396,7 +406,10 @@ func TestDuplicateTable(t *testing.T) { tabMeta := md.TableMeta(a) tabMeta.SetConstraints(&memo.VariableExpr{Col: b}) - tabMeta.AddComputedCol(b2, &memo.VariableExpr{Col: b}) + scalar := &memo.VariableExpr{Col: b} + var sharedProps props.Shared + memo.BuildSharedProps(scalar, &sharedProps, &evalCtx) + tabMeta.AddComputedCol(b2, scalar, sharedProps.OuterCols) tabMeta.AddPartialIndexPredicate(1, &memo.VariableExpr{Col: b}) // remap is a simple function that can only remap column IDs in a @@ -434,6 +447,18 @@ func TestDuplicateTable(t *testing.T) { t.Errorf("expected computed column to reference new column ID %d, got %d", dupB, col) } + if tabMeta.ColsInComputedColsExpressions.Equals(dupTabMeta.ColsInComputedColsExpressions) { + t.Fatalf("expected computed column expression referenced columns to hold new column ids") + } + + if dupTabMeta.ColsInComputedColsExpressions.Empty() { + t.Fatalf("expected computed column expression referenced columns to not be empty") + } + + if tabMeta.ColsInComputedColsExpressions.Len() != dupTabMeta.ColsInComputedColsExpressions.Len() { + t.Fatalf("expected same number of computed column expression referenced columns") + } + pred, isPartialIndex := dupTabMeta.PartialIndexPredicate(1) if !isPartialIndex { t.Fatalf("expected partial index predicates to be duplicated") diff --git a/pkg/sql/opt/optbuilder/select.go b/pkg/sql/opt/optbuilder/select.go index 124454b34396..092c25dabe5b 100644 --- a/pkg/sql/opt/optbuilder/select.go +++ b/pkg/sql/opt/optbuilder/select.go @@ -876,7 +876,7 @@ func (b *Builder) addComputedColsForTable(tabMeta *opt.TableMeta) { var sharedProps props.Shared memo.BuildSharedProps(scalar, &sharedProps, b.evalCtx) if !sharedProps.VolatilitySet.HasStable() && !sharedProps.VolatilitySet.HasVolatile() { - tabMeta.AddComputedCol(colID, scalar) + tabMeta.AddComputedCol(colID, scalar, sharedProps.OuterCols) } } } diff --git a/pkg/sql/opt/table_meta.go b/pkg/sql/opt/table_meta.go index 9421e5d522c8..ec11213da292 100644 --- a/pkg/sql/opt/table_meta.go +++ b/pkg/sql/opt/table_meta.go @@ -174,6 +174,10 @@ type TableMeta struct { // Computed columns with non-immutable operators are omitted. ComputedCols map[ColumnID]ScalarExpr + // ColsInComputedColsExpressions is the set of all columns referenced in the + // expressions used to build the column data of computed columns. + ColsInComputedColsExpressions ColSet + // partialIndexPredicates is a map from index ordinals on the table to // *FiltersExprs representing the predicate on the corresponding partial // index. If an index is not a partial index, it will not have an entry in @@ -249,6 +253,7 @@ func (tm *TableMeta) copyFrom(from *TableMeta, copyScalarFn func(Expr) Expr) { for col, e := range from.ComputedCols { tm.ComputedCols[col] = copyScalarFn(e).(ScalarExpr) } + tm.ColsInComputedColsExpressions = from.ColsInComputedColsExpressions } if from.partialIndexPredicates != nil { @@ -335,12 +340,15 @@ func (tm *TableMeta) SetConstraints(constraints ScalarExpr) { tm.Constraints = constraints } -// AddComputedCol adds a computed column expression to the table's metadata. -func (tm *TableMeta) AddComputedCol(colID ColumnID, computedCol ScalarExpr) { +// AddComputedCol adds a computed column expression to the table's metadata and +// also adds any referenced columns in the `computedCol` expression to the +// table's metadata. +func (tm *TableMeta) AddComputedCol(colID ColumnID, computedCol ScalarExpr, outerCols ColSet) { if tm.ComputedCols == nil { tm.ComputedCols = make(map[ColumnID]ScalarExpr) } tm.ComputedCols[colID] = computedCol + tm.ColsInComputedColsExpressions.UnionWith(outerCols) } // ComputedColExpr returns the computed expression for the given column, if it diff --git a/pkg/sql/opt/xform/general_funcs.go b/pkg/sql/opt/xform/general_funcs.go index bc33618ecd97..b624cdc02ea5 100644 --- a/pkg/sql/opt/xform/general_funcs.go +++ b/pkg/sql/opt/xform/general_funcs.go @@ -15,6 +15,7 @@ import ( "math" "github.com/cockroachdb/cockroach/pkg/sql/opt" + "github.com/cockroachdb/cockroach/pkg/sql/opt/cat" "github.com/cockroachdb/cockroach/pkg/sql/opt/constraint" "github.com/cockroachdb/cockroach/pkg/sql/opt/idxconstraint" "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" @@ -308,6 +309,226 @@ func (c *CustomFuncs) computedColFilters( return computedColFilters } +// combineComputedColFilters is a generalized version of computedColFilters, +// which seeks to combine single-key filters with derived single-key filters on +// computed columns by ANDing spans in a given FiltersItem with any other spans +// which could be computed from the span key values. +// Keys cannot be saved for the filters as a whole, for later processing, +// because a given combination of keys is only applicable with the scope of that +// predicate. For example: +// +// CREATE TABLE t1 ( +// a INT, +// b INT, +// c INT AS (a+b) VIRTUAL, +// INDEX idx1 (c ASC, b ASC, a ASC)); +// +// SELECT * FROM t1 WHERE (a,b) IN ((3,4), (5,6)); +// +// Here we derive: +// +// (a IS 3 AND b IS 4 AND c IS 7) OR +// (a IS 5 AND b IS 6 AND c IS 11) +// +// The `c IS 7` term is only applicable when a is 3 and b is 4, so those two +// terms must be combined with the `c IS 7` term in the same conjunction for the +// result to be semantically equivalent to the original query. +// Here is the plan built in this case: +// +// scan t1@idx1 +// ├── columns: a:1!null b:2!null c:3!null +// ├── constraint: /3/2/1 +// │ ├── [/7/4/3 - /7/4/3] +// │ └── [/11/6/5 - /11/6/5] +// ├── cardinality: [0 - 2] +// ├── key: (1,2) +// └── fd: (1,2)-->(3) +// +// Note that new predicates are derived from constraint spans, not predicates, +// so a predicate such as (a,b) IN ((null,4), (5,6)) will not derive anything +// because the null is not placed in a span, and also IN predicates with nulls +// are not marked as tight, and this function does not process non-tight +// constraints. +// +// Note that `computedColFilters` can't be replaced because it can handle cases +// which `combineComputedColFilters` doesn't, for example a computed column +// which is built from constants found in separate `FiltersItem`s. +// +// Also note, this function handles IN list predicates but could be extended to +// handle ORed predicates too (see TODO below). +func (c *CustomFuncs) combineComputedColFilters( + scanPrivate *memo.ScanPrivate, requiredFilters memo.FiltersExpr, optionalFilters memo.FiltersExpr, +) memo.FiltersExpr { + tabMeta := c.e.mem.Metadata().TableMeta(scanPrivate.Table) + if len(tabMeta.ComputedCols) == 0 { + return nil + } + if !c.e.evalCtx.SessionData().OptimizerUseImprovedComputedColumnFiltersDerivation { + return nil + } + tab := c.e.mem.Metadata().Table(scanPrivate.Table) + numFilters := len(requiredFilters) + len(optionalFilters) + filters := make(memo.FiltersExpr, 0, numFilters) + filters = append(filters, requiredFilters...) + filters = append(filters, optionalFilters...) + + var combinedComputedColFilters memo.FiltersExpr + for i := range filters { + props := filters[i].ScalarProps() + if !props.TightConstraints { + continue + } + // Handle only tight constraint sets for now, which is the IN list case. + // TODO(msirek): Handle OR'ed terms. These may be split across multiple + // Constraints instead of combined into multiple spans within a + // constraint, e.g. (a = 3 AND b = 4) OR (a = 5 AND b = 6) + // is represented with 2 constraints, each having 2 spans: + // /1: [/3 - /3] [/5 - /5] + // /2: [/4 - /4] [/6 - /6] + // Span 1 of Constraint 1 should be combined with Span 1 of Constraint 2, + // etc... + for j, n := 0, props.Constraints.Length(); j < n; j++ { + var orOp opt.ScalarExpr + cons := props.Constraints.Constraint(j) + if !cons.Columns.ColSet().Intersects(tabMeta.ColsInComputedColsExpressions) { + // If this constraint doesn't involve any columns used to construct a + // computed column value, skip it. + continue + } + + for k := 0; k < cons.Spans.Count(); k++ { + filterAdded := false + span := cons.Spans.Get(k) + if !span.HasSingleKey(c.e.evalCtx) { + // If we don't have a single value, or combination of single values + // to use in folding the computed column expression, don't use this + // constraint. + continue + } + // Build the initial conjunction from the constraint. + initialConjunction, constFilterCols, ok := + c.buildConjunctionFromConstraint(cons, span, tab, scanPrivate) + if !ok { + continue + } + var newOp opt.ScalarExpr + newOp, filterAdded = + c.buildConjunctionOfEqualityPredsOnComputedAndNonComputedCols( + initialConjunction, tabMeta, constFilterCols, cons, scanPrivate, + ) + // Only build a new disjunct if terms were derived for this span. + if filterAdded { + if orOp == nil { + // The case of the first span or only one span. + orOp = newOp + } else { + // The spans in a constraint represent a disjunction, so OR them + // together. + orOp = c.e.f.ConstructOr(orOp, newOp) + } + } else { + // If we failed to build any of the disjuncts, give up on this + // Constraint. + orOp = nil + break + } + } + if orOp != nil { + // Multiple independent tight constraints represent a conjunction, so + // AND them together. + combinedComputedColFilters = + append(combinedComputedColFilters, c.e.f.ConstructFiltersItem(orOp)) + } + } + } + return combinedComputedColFilters +} + +// buildConjunctionFromConstraint converts a constraint on one or more columns +// into a scalar expression predicate in the form: +// (constraint_col1 IS span1) AND (constraint_col2 IS span2) AND ... +func (c *CustomFuncs) buildConjunctionFromConstraint( + cons *constraint.Constraint, span *constraint.Span, tab cat.Table, scanPrivate *memo.ScanPrivate, +) (conjunction opt.ScalarExpr, constFilterCols constColsMap, ok bool) { + for m := 0; m < cons.Columns.Count(); m++ { + // Skip columns that aren't referenced in the scan. + colID := cons.Columns.Get(m).ID() + if !scanPrivate.Cols.Contains(colID) { + continue + } + colTyp := tab.Column(scanPrivate.Table.ColumnOrdinal(colID)).DatumType() + datum := span.StartKey().Value(m) + originalConstVal := c.e.f.ConstructConstVal(datum, colTyp) + // Mark the value in the map for use by `tryFoldComputedCol`. + if constFilterCols == nil { + constFilterCols = make(constColsMap) + } + constFilterCols[colID] = originalConstVal + // Note: Nulls could be handled here, but there is currently no supported + // test case for this situation, so it is explicitly disallowed for now. + if _, isNullExpr := originalConstVal.(*memo.NullExpr); isNullExpr { + return nil, nil, false + } + // Use IS NOT DISTINCT FROM to handle nulls. + originalEqOp := c.e.f.ConstructIs(c.e.f.ConstructVariable(colID), originalConstVal) + if conjunction == nil { + conjunction = originalEqOp + } else { + // Build a conjunction representing this span. + conjunction = c.e.f.ConstructAnd(conjunction, originalEqOp) + } + } + ok = conjunction != nil + if !ok { + if len(constFilterCols) != 0 { + // Help the garbage collector. + for k := range constFilterCols { + delete(constFilterCols, k) + } + } + return nil, nil, false + } + return conjunction, constFilterCols, true +} + +// buildConjunctionOfEqualityPredsOnComputedAndNonComputedCols takes an +// initialConjunction of IS equality predicates on non-computed columns and attempts +// to build a new conjunction of IS equality predicates on computed columns by +// folding the computed column expressions using the constant values stored in +// the constFilterCols map. If successful, ok=true is returned along with +// initialConjunction ANDed with the predicates on computed columns. +func (c *CustomFuncs) buildConjunctionOfEqualityPredsOnComputedAndNonComputedCols( + initialConjunction opt.ScalarExpr, + tabMeta *opt.TableMeta, + constFilterCols constColsMap, + cons *constraint.Constraint, + scanPrivate *memo.ScanPrivate, +) (computedColPlusOriginalColEqualityConjunction opt.ScalarExpr, ok bool) { + computedColPlusOriginalColEqualityConjunction = initialConjunction + for computedColID := range tabMeta.ComputedCols { + if c.tryFoldComputedCol(tabMeta, computedColID, constFilterCols) { + constVal := constFilterCols[computedColID] + // Use IS NOT DISTINCT FROM to handle nulls. + eqOp := c.e.f.ConstructIs(c.e.f.ConstructVariable(computedColID), constVal) + computedColPlusOriginalColEqualityConjunction = + c.e.f.ConstructAnd(computedColPlusOriginalColEqualityConjunction, eqOp) + ok = true + } + } + for m := 0; m < cons.Columns.Count(); m++ { + colID := cons.Columns.Get(m).ID() + if !scanPrivate.Cols.Contains(colID) { + // This column wasn't added to the map, so no need to delete it + // from the map. + continue + } + } + if !ok { + return nil, false + } + return computedColPlusOriginalColEqualityConjunction, true +} + // constColsMap maps columns to constant values that we can infer from query // filters. // diff --git a/pkg/sql/opt/xform/select_funcs.go b/pkg/sql/opt/xform/select_funcs.go index b53d9a7acbe8..f6d14dcad16f 100644 --- a/pkg/sql/opt/xform/select_funcs.go +++ b/pkg/sql/opt/xform/select_funcs.go @@ -346,6 +346,8 @@ func (c *CustomFuncs) GetOptionalFiltersAndFilterColumns( optionalFilters = c.checkConstraintFilters(scanPrivate.Table) computedColFilters := c.computedColFilters(scanPrivate, explicitFilters, optionalFilters) optionalFilters = append(optionalFilters, computedColFilters...) + combinedFilters := c.combineComputedColFilters(scanPrivate, explicitFilters, optionalFilters) + optionalFilters = append(optionalFilters, combinedFilters...) filterColumns = c.FilterOuterCols(explicitFilters) filterColumns.UnionWith(c.FilterOuterCols(optionalFilters)) diff --git a/pkg/sql/opt/xform/testdata/rules/select b/pkg/sql/opt/xform/testdata/rules/select index c69c8760c26c..340eadd92c9d 100644 --- a/pkg/sql/opt/xform/testdata/rules/select +++ b/pkg/sql/opt/xform/testdata/rules/select @@ -2023,6 +2023,321 @@ project ├── key: (1) └── fd: (1)-->(2) +exec-ddl +CREATE TABLE t100206 ( + a INT NOT NULL, + b INT NOT NULL, + c INT NOT NULL AS (a+b) VIRTUAL, + d INT, + CONSTRAINT pkey PRIMARY KEY (c ASC, b ASC, a ASC)); +---- + +# This should derive the value of c from a and b. +opt expect=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206 WHERE (a,b) IN ((3,4), (5,6)) +---- +scan t100206 + ├── columns: a:1!null b:2!null c:3!null + ├── constraint: /3/2/1 + │ ├── [/7/4/3 - /7/4/3] + │ └── [/11/6/5 - /11/6/5] + ├── cardinality: [0 - 2] + ├── key: (1,2) + └── fd: (1,2)-->(3) + +# This should not derive the value of c when improved filter derivation is +# disabled. +opt expect-not=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=false +SELECT a,b,c FROM t100206 WHERE (a,b) IN ((3,4), (5,6)) +---- +select + ├── columns: a:1!null b:2!null c:3!null + ├── cardinality: [0 - 2] + ├── key: (1,2) + ├── fd: (1,2)-->(3) + ├── scan t100206 + │ ├── columns: a:1!null b:2!null c:3!null + │ ├── computed column expressions + │ │ └── c:3 + │ │ └── a:1 + b:2 + │ ├── key: (1,2) + │ └── fd: (1,2)-->(3) + └── filters + └── (a:1, b:2) IN ((3, 4), (5, 6)) [outer=(1,2), constraints=(/1/2: [/3/4 - /3/4] [/5/6 - /5/6]; /2: [/4 - /4] [/6 - /6]; tight)] + +# The presence of a non-single-key constraint should not prevent derivation +# of filters on computed columns. +opt expect=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT * FROM t100206 WHERE (a,b) IN ((3,4), (5,6)) AND a > 4 +---- +select + ├── columns: a:1!null b:2!null c:3!null d:4 + ├── cardinality: [0 - 2] + ├── key: (1,2) + ├── fd: (1-3)-->(4), (1,2)-->(3) + ├── scan t100206 + │ ├── columns: a:1!null b:2!null c:3!null d:4 + │ ├── constraint: /3/2/1 + │ │ ├── [/7/4/3 - /7/4/3] + │ │ └── [/11/6/5 - /11/6/5] + │ ├── cardinality: [0 - 2] + │ ├── key: (1,2) + │ └── fd: (1-3)-->(4), (1,2)-->(3) + └── filters + └── a:1 > 4 [outer=(1), constraints=(/1: [/5 - ]; tight)] + +# This should derive the value of c from a and b. +opt expect=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT * FROM t100206 WHERE (a,b) IN ((3,4), (5,6)) AND d > 4 +---- +select + ├── columns: a:1!null b:2!null c:3!null d:4!null + ├── cardinality: [0 - 2] + ├── key: (1,2) + ├── fd: (1-3)-->(4), (1,2)-->(3) + ├── scan t100206 + │ ├── columns: a:1!null b:2!null c:3!null d:4 + │ ├── constraint: /3/2/1 + │ │ ├── [/7/4/3 - /7/4/3] + │ │ └── [/11/6/5 - /11/6/5] + │ ├── cardinality: [0 - 2] + │ ├── key: (1,2) + │ └── fd: (1-3)-->(4), (1,2)-->(3) + └── filters + └── d:4 > 4 [outer=(4), constraints=(/4: [/5 - ]; tight)] + +# Prepared statements should be able to derive constraints. +assign-placeholders-opt query-args=(1, 2, 3, 4) set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206 WHERE (a,b) IN (($1,$2), ($3,$4)) +---- +scan t100206 + ├── columns: a:1!null b:2!null c:3!null + ├── constraint: /3/2/1 + │ ├── [/3/2/1 - /3/2/1] + │ └── [/7/4/3 - /7/4/3] + ├── cardinality: [0 - 2] + ├── key: (1,2) + └── fd: (1,2)-->(3) + +# This should not generate a constrained scan due to the presence of a null. +opt expect-not=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206 WHERE (a,b) IN ((null,4), (5,6)) +---- +select + ├── columns: a:1!null b:2!null c:3!null + ├── cardinality: [0 - 1] + ├── key: () + ├── fd: ()-->(1-3) + ├── scan t100206 + │ ├── columns: a:1!null b:2!null c:3!null + │ ├── computed column expressions + │ │ └── c:3 + │ │ └── a:1 + b:2 + │ ├── key: (1,2) + │ └── fd: (1,2)-->(3) + └── filters + └── (a:1, b:2) IN ((NULL, 4), (5, 6)) [outer=(1,2), constraints=(/1/2: [/5/6 - /5/6]; /2: [/4 - /4] [/6 - /6]), fd=()-->(1,2)] + +exec-ddl +CREATE TABLE t100206n ( + a INT NOT NULL, + b INT NOT NULL, + c INT AS (CASE WHEN a = 5 THEN NULL ELSE b END) VIRTUAL, + d INT, + INDEX idx1 (c ASC, b ASC, a ASC)); +---- + +# This should derive the value of c from a and b, including the null in c. +opt set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206n@idx1 WHERE (a,b) IN ((3,4), (5,6)) +---- +project + ├── columns: a:1!null b:2!null c:3 + ├── fd: (1,2)-->(3) + ├── scan t100206n@idx1 + │ ├── columns: a:1!null b:2!null + │ ├── constraint: /3/2/1/5 + │ │ ├── [/NULL/6/5 - /NULL/6/5] + │ │ └── [/4/4/3 - /4/4/3] + │ └── flags: force-index=idx1 + └── projections + └── CASE WHEN a:1 = 5 THEN CAST(NULL AS INT8) ELSE b:2 END [as=c:3, outer=(1,2)] + +exec-ddl +CREATE TABLE t100206nc ( + a INT NOT NULL, + b INT NOT NULL, + c INT AS (CASE WHEN a = 5 THEN CASE WHEN b = 6 THEN 1 ELSE d END ELSE b END) VIRTUAL, + d INT, + INDEX idx1 (c ASC, b ASC, a ASC)); +---- + +# A nested CASE expression should derive the value of c from a and b. +opt expect=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206nc@idx1 WHERE (a,b) IN ((3,4), (5,6)) +---- +project + ├── columns: a:1!null b:2!null c:3 + ├── index-join t100206nc + │ ├── columns: a:1!null b:2!null d:4 + │ └── scan t100206nc@idx1 + │ ├── columns: a:1!null b:2!null rowid:5!null + │ ├── constraint: /3/2/1/5 + │ │ ├── [/1/6/5 - /1/6/5] + │ │ └── [/4/4/3 - /4/4/3] + │ ├── flags: force-index=idx1 + │ ├── key: (5) + │ └── fd: (5)-->(1,2) + └── projections + └── CASE WHEN a:1 = 5 THEN CASE WHEN b:2 = 6 THEN 1 ELSE d:4 END ELSE b:2 END [as=c:3, outer=(1,2,4)] + +# When `c` relies on the value of `d`, we should not derive filters. +opt expect-not=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206nc@idx1 WHERE (a,b) IN ((5,7), (5,6)) +---- +project + ├── columns: a:1!null b:2!null c:3 + ├── fd: ()-->(1) + ├── select + │ ├── columns: a:1!null b:2!null d:4 + │ ├── fd: ()-->(1) + │ ├── index-join t100206nc + │ │ ├── columns: a:1!null b:2!null d:4 + │ │ └── scan t100206nc@idx1 + │ │ ├── columns: a:1!null b:2!null rowid:5!null + │ │ ├── flags: force-index=idx1 + │ │ ├── key: (5) + │ │ └── fd: (5)-->(1,2) + │ └── filters + │ └── (a:1, b:2) IN ((5, 7), (5, 6)) [outer=(1,2), constraints=(/1/2: [/5/6 - /5/6] [/5/7 - /5/7]; /2: [/6 - /6] [/7 - /7]; tight), fd=()-->(1)] + └── projections + └── CASE WHEN a:1 = 5 THEN CASE WHEN b:2 = 6 THEN 1 ELSE d:4 END ELSE b:2 END [as=c:3, outer=(1,2,4)] + +# When `d` is specified in a separate conjunct, we can't derive filters. +opt expect-not=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206nc@idx1 WHERE (a,b) IN ((5,7), (5,6)) AND d IN (9,10) +---- +project + ├── columns: a:1!null b:2!null c:3!null + ├── fd: ()-->(1) + ├── select + │ ├── columns: a:1!null b:2!null d:4!null + │ ├── fd: ()-->(1) + │ ├── index-join t100206nc + │ │ ├── columns: a:1!null b:2!null d:4 + │ │ └── scan t100206nc@idx1 + │ │ ├── columns: a:1!null b:2!null rowid:5!null + │ │ ├── flags: force-index=idx1 + │ │ ├── key: (5) + │ │ └── fd: (5)-->(1,2) + │ └── filters + │ ├── (a:1, b:2) IN ((5, 7), (5, 6)) [outer=(1,2), constraints=(/1/2: [/5/6 - /5/6] [/5/7 - /5/7]; /2: [/6 - /6] [/7 - /7]; tight), fd=()-->(1)] + │ └── d:4 IN (9, 10) [outer=(4), constraints=(/4: [/9 - /9] [/10 - /10]; tight)] + └── projections + └── CASE WHEN a:1 = 5 THEN CASE WHEN b:2 = 6 THEN 1 ELSE d:4 END ELSE b:2 END [as=c:3, outer=(1,2,4)] + +# An IN clause which could derive terms will not work if OR'ed with another +# term. +opt expect-not=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT a,b,c FROM t100206nc@idx1 WHERE (a,b) IN ((3,4), (5,6)) OR d IN (9,10) +---- +project + ├── columns: a:1!null b:2!null c:3 + ├── select + │ ├── columns: a:1!null b:2!null d:4 + │ ├── index-join t100206nc + │ │ ├── columns: a:1!null b:2!null d:4 + │ │ └── scan t100206nc@idx1 + │ │ ├── columns: a:1!null b:2!null rowid:5!null + │ │ ├── flags: force-index=idx1 + │ │ ├── key: (5) + │ │ └── fd: (5)-->(1,2) + │ └── filters + │ └── ((a:1, b:2) IN ((3, 4), (5, 6))) OR (d:4 IN (9, 10)) [outer=(1,2,4)] + └── projections + └── CASE WHEN a:1 = 5 THEN CASE WHEN b:2 = 6 THEN 1 ELSE d:4 END ELSE b:2 END [as=c:3, outer=(1,2,4)] + +# TODO(msirek): Derive predicates on computed columns using ORed predicates. +opt expect-not=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT * FROM t100206 WHERE (a = 3 AND b = 4) OR (a = 5 AND b = 6) +---- +select + ├── columns: a:1!null b:2!null c:3!null d:4 + ├── key: (1,2) + ├── fd: (1-3)-->(4), (1,2)-->(3) + ├── scan t100206 + │ ├── columns: a:1!null b:2!null c:3!null d:4 + │ ├── computed column expressions + │ │ └── c:3 + │ │ └── a:1 + b:2 + │ ├── key: (1,2) + │ └── fd: (1-3)-->(4), (1,2)-->(3) + └── filters + └── ((a:1 = 3) AND (b:2 = 4)) OR ((a:1 = 5) AND (b:2 = 6)) [outer=(1,2), constraints=(/1: [/3 - /3] [/5 - /5]; /2: [/4 - /4] [/6 - /6])] + +# TODO(msirek): Derive predicates on computed columns using ORed predicates. +# The 'OR c=1' term triggers GenerateConstrainedScans as a disjunction of scans, +# but we should be able to build a single constrained scan. +opt expect=(GenerateConstrainedScans,SplitDisjunction) set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT * FROM t100206 WHERE (a,b) IN ((3,4), (5,6)) OR c=1 +---- +distinct-on + ├── columns: a:1!null b:2!null c:3!null d:4 + ├── grouping columns: a:1!null b:2!null + ├── key: (1,2) + ├── fd: (1-3)-->(4), (1,2)-->(3) + ├── union-all + │ ├── columns: a:1!null b:2!null c:3!null d:4 + │ ├── left columns: a:7 b:8 c:9 d:10 + │ ├── right columns: a:13 b:14 c:15 d:16 + │ ├── scan t100206 + │ │ ├── columns: a:7!null b:8!null c:9!null d:10 + │ │ ├── constraint: /9/8/7 + │ │ │ ├── [/7/4/3 - /7/4/3] + │ │ │ └── [/11/6/5 - /11/6/5] + │ │ ├── cardinality: [0 - 2] + │ │ ├── key: (7,8) + │ │ └── fd: (7-9)-->(10), (7,8)-->(9) + │ └── scan t100206 + │ ├── columns: a:13!null b:14!null c:15!null d:16 + │ ├── constraint: /15/14/13: [/1 - /1] + │ ├── key: (13,14) + │ └── fd: ()-->(15), (13,14)-->(16) + └── aggregations + ├── const-agg [as=c:3, outer=(3)] + │ └── c:3 + └── const-agg [as=d:4, outer=(4)] + └── d:4 + +exec-ddl +CREATE TABLE t100206b ( + a INT NOT NULL, + b INT NOT NULL, + c INT NOT NULL AS (a+b) VIRTUAL, + CHECK ((a,b) IN ((1,2),(3,4),(5,6))), + CONSTRAINT pkey PRIMARY KEY (c ASC, b ASC, a ASC)); +---- + +# This should derive the value of c from a and b. +opt expect=GenerateConstrainedScans set=optimizer_use_improved_computed_column_filters_derivation=true +SELECT * FROM t100206b WHERE a = 1 +---- +select + ├── columns: a:1!null b:2!null c:3!null + ├── key: (2) + ├── fd: ()-->(1), (2)-->(3) + ├── scan t100206b + │ ├── columns: a:1!null b:2!null c:3!null + │ ├── constraint: /3/2/1 + │ │ ├── [/3/2/1 - /3/2/1] + │ │ ├── [/7/4/3 - /7/4/3] + │ │ └── [/11/6/5 - /11/6/5] + │ ├── cardinality: [0 - 3] + │ ├── key: (1,2) + │ └── fd: (1,2)-->(3) + └── filters + └── a:1 = 1 [outer=(1), constraints=(/1: [/1 - /1]; tight), fd=()-->(1)] + # Constrained partial index scan with an indexed virtual computed column also in # the predicate. # TODO(mgartner): Teach indexConstraintCtx.simplifyFilter to remove b=140 from diff --git a/pkg/sql/sessiondatapb/local_only_session_data.proto b/pkg/sql/sessiondatapb/local_only_session_data.proto index 7d7c7edb314e..e3729aa67d53 100644 --- a/pkg/sql/sessiondatapb/local_only_session_data.proto +++ b/pkg/sql/sessiondatapb/local_only_session_data.proto @@ -387,6 +387,12 @@ message LocalOnlySessionData { // expression with a column reference, which can produce more efficient query // plans. bool optimizer_hoist_uncorrelated_equality_subqueries = 102; + // OptimizerUseImprovedComputedColumnFiltersDerivation, when true, causes the + // optimizer to derive filters on computed columns in more cases. Previously, + // filters could only be derived when the expression defining the computed + // column involved a single column and that column was equated with a single + // constant value in a WHERE clause filter. + bool optimizer_use_improved_computed_column_filters_derivation = 104; /////////////////////////////////////////////////////////////////////////// // WARNING: consider whether a session parameter you're adding needs to // diff --git a/pkg/sql/vars.go b/pkg/sql/vars.go index aef88c57ae75..0407391d9431 100644 --- a/pkg/sql/vars.go +++ b/pkg/sql/vars.go @@ -2585,6 +2585,23 @@ var varGen = map[string]sessionVar{ GlobalDefault: globalFalse, }, + // CockroachDB extension. + `optimizer_use_improved_computed_column_filters_derivation`: { + GetStringVal: makePostgresBoolGetStringValFn(`optimizer_use_improved_computed_column_filters_derivation`), + Set: func(_ context.Context, m sessionDataMutator, s string) error { + b, err := paramparse.ParseBoolVar("optimizer_use_improved_computed_column_filters_derivation", s) + if err != nil { + return err + } + m.SetOptimizerUseImprovedComputedColumnFiltersDerivation(b) + return nil + }, + Get: func(evalCtx *extendedEvalContext, _ *kv.Txn) (string, error) { + return formatBoolAsPostgresSetting(evalCtx.SessionData().OptimizerUseImprovedComputedColumnFiltersDerivation), nil + }, + GlobalDefault: globalFalse, + }, + // CockroachDB extension. `enable_create_stats_using_extremes`: { GetStringVal: makePostgresBoolGetStringValFn(`enable_create_stats_using_extremes`),