diff --git a/pkg/sql/exec_util.go b/pkg/sql/exec_util.go index 5889431fea55..258c22530599 100644 --- a/pkg/sql/exec_util.go +++ b/pkg/sql/exec_util.go @@ -3048,6 +3048,10 @@ func (m *sessionDataMutator) SetOptimizerFKCascadesLimit(val int) { m.data.OptimizerFKCascadesLimit = int64(val) } +func (m *sessionDataMutator) SetOptimizerUseForecasts(val bool) { + m.data.OptimizerUseForecasts = val +} + func (m *sessionDataMutator) SetOptimizerUseHistograms(val bool) { m.data.OptimizerUseHistograms = val } diff --git a/pkg/sql/explain_bundle.go b/pkg/sql/explain_bundle.go index 9866ee6ed04b..05ebfc76ce25 100644 --- a/pkg/sql/explain_bundle.go +++ b/pkg/sql/explain_bundle.go @@ -570,6 +570,7 @@ func (c *stmtEnvCollector) PrintSessionSettings(w io.Writer) error { {sessionSetting: "null_ordered_last"}, {sessionSetting: "on_update_rehome_row_enabled", clusterSetting: onUpdateRehomeRowEnabledClusterMode, convFunc: boolToOnOff}, {sessionSetting: "opt_split_scan_limit"}, + {sessionSetting: "optimizer_use_forecasts", convFunc: boolToOnOff}, {sessionSetting: "optimizer_use_histograms", clusterSetting: optUseHistogramsClusterMode, convFunc: boolToOnOff}, {sessionSetting: "optimizer_use_multicol_stats", clusterSetting: optUseMultiColStatsClusterMode, convFunc: boolToOnOff}, {sessionSetting: "optimizer_use_not_visible_indexes"}, diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal b/pkg/sql/logictest/testdata/logic_test/crdb_internal index 3e790d4f2350..410bcf042076 100644 --- a/pkg/sql/logictest/testdata/logic_test/crdb_internal +++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal @@ -791,6 +791,12 @@ SELECT start_pretty, end_pretty FROM crdb_internal.ranges WHERE split_enforced_until IS NOT NULL AND (start_pretty LIKE '/Table/112/1%' OR start_pretty LIKE '/Table/112/2%') ---- +/Table/112/1/1 /Table/112/1/2 +/Table/112/1/2 /Table/112/1/3 +/Table/112/1/3 /Table/112/2/1 +/Table/112/2/1 /Table/112/2/2 +/Table/112/2/2 /Table/112/2/3 +/Table/112/2/3 /Table/112/3/1 statement ok ALTER TABLE foo SPLIT AT VALUES (1), (2), (3) diff --git a/pkg/sql/logictest/testdata/logic_test/information_schema b/pkg/sql/logictest/testdata/logic_test/information_schema index 9f873f6f8918..813970d81a51 100644 --- a/pkg/sql/logictest/testdata/logic_test/information_schema +++ b/pkg/sql/logictest/testdata/logic_test/information_schema @@ -4743,6 +4743,7 @@ null_ordered_last off on_update_rehome_row_enabled on opt_split_scan_limit 2048 optimizer on +optimizer_use_forecasts on optimizer_use_histograms on optimizer_use_multicol_stats on optimizer_use_not_visible_indexes off diff --git a/pkg/sql/logictest/testdata/logic_test/pg_catalog b/pkg/sql/logictest/testdata/logic_test/pg_catalog index 549bea9ccc83..ce421f0fb8fd 100644 --- a/pkg/sql/logictest/testdata/logic_test/pg_catalog +++ b/pkg/sql/logictest/testdata/logic_test/pg_catalog @@ -4223,6 +4223,7 @@ node_id 1 NULL 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_use_forecasts on NULL NULL NULL string optimizer_use_histograms on NULL NULL NULL string optimizer_use_multicol_stats on NULL NULL NULL string optimizer_use_not_visible_indexes off NULL NULL NULL string @@ -4350,6 +4351,7 @@ node_id 1 NULL 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_use_forecasts on NULL user NULL on on optimizer_use_histograms 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 @@ -4475,6 +4477,7 @@ null_ordered_last 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_use_forecasts NULL NULL NULL NULL NULL optimizer_use_histograms NULL NULL NULL NULL NULL optimizer_use_multicol_stats NULL NULL NULL NULL NULL optimizer_use_not_visible_indexes NULL NULL NULL NULL NULL diff --git a/pkg/sql/logictest/testdata/logic_test/schema b/pkg/sql/logictest/testdata/logic_test/schema index 2d924b2c80dd..ff40b4b2e492 100644 --- a/pkg/sql/logictest/testdata/logic_test/schema +++ b/pkg/sql/logictest/testdata/logic_test/schema @@ -885,4 +885,3 @@ DROP SCHEMA sc statement ok SET CLUSTER SETTING server.eventlog.enabled = false - diff --git a/pkg/sql/logictest/testdata/logic_test/show_source b/pkg/sql/logictest/testdata/logic_test/show_source index 6764f90d3f45..4be890aff96c 100644 --- a/pkg/sql/logictest/testdata/logic_test/show_source +++ b/pkg/sql/logictest/testdata/logic_test/show_source @@ -96,6 +96,7 @@ node_id 1 null_ordered_last off on_update_rehome_row_enabled on opt_split_scan_limit 2048 +optimizer_use_forecasts on optimizer_use_histograms on optimizer_use_multicol_stats on optimizer_use_not_visible_indexes off diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_env b/pkg/sql/opt/exec/execbuilder/testdata/explain_env index e5d33bc88e4c..a775cd5688e2 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_env +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_env @@ -39,7 +39,7 @@ CREATE TABLE y ( query T EXPLAIN (OPT, ENV) SELECT * FROM x WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0Vt9O47gXvp48xVFvBn5qIaW_C1Q00nZKVtvdUlCbmR2EkOUkJ6kXxza2UwqrleYheEKeZGWnQFmRZqXV9KJq3POdP9_5znF6PfiK2jAphjCW6Y2WNF2efgZcY5pUjGeowaKxsKqtgqDXA8q5vCNKo6IaCTVEKksUpwKW1IBdImSY04pbWFFe4RBknjtcKo0lJqXCkDtml2RjRVLJiWEP2ALPqMvknjfaTRbnXTg7vfTGG99M2J2-j7eNrabC0NQyKYjSTGpm75uAQuqS8ib0bUU5s_dE5sSgXrG0MQGNRcWpbnKkkWZECt6YxzM572ArgySXrlmov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UdobQOQr7x72w3wv7EPaHYTgMw86WsbtnmUjdK1MlHKAfbvv2y8S_Ttl75QLrbIP9Ln0GbsPcjnwhPBr0jwb-v7-6_zXl5Iek7CP8cVkH1-9PgiD6cjEdTWawd34RdyGafd6HRTR1ovgf_Dw_P4M1_P5LNI8ggQ8wOAl6vV4v8PfZ-qeNzAJ4enx8evz69PgVXubJDuHw6LA_hKvDAfTgcHAd_B0AAP__4rTYRg== statement error ENV only supported with \(OPT\) option @@ -52,7 +52,7 @@ EXPLAIN (ENV) SELECT * FROM x WHERE b = 3 query T EXPLAIN (OPT, ENV) SELECT * FROM x, y WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0Vt9u27YXvq6e4sA3dX6wGzn5XQQOCsx11c1b6hS22rUoCoKSjmQuFMmSlGpnGFDsGXK5p8uTDKScxFkta8DQXAQ2_X3n73cOORzCO9SGSTGGqUyvtKTp6uULwDWmScV4hhosGgt1gwqC4RAo5_ILURoV1UioIVJZojgVsKIG7Aohw5xW3EJNeYVjkHnueKk0lpiUCkO-MLsiWxRJJSeGXWMHPaMukg1vxc2WlwN4_fKDB29tM2EP2j7bBVtNhaGpZVIQpZnUzG7aiELqkvI29ueKcmY3RObEoK5Z2hqAxqLiVLcZ0kgzIgVvjeOuOHu4lUGSS9cs1N6Q6TLCTNPbvOKcWJpwbPp1iLeMYke05jOH5-7kHOAhoDskrax0LlB4q6xUnKXMEoMcU0tyqUmlXIdbXYl99N10nY2E2nRFjKUWSxS2PfBH1oRBbUlOjSWK2tW_IpUVt0y5DzJjOUupi8G4hvu6dVR6a-SaFde0IL9J1j47jdO1cmWiIiOsEFIjEdKSmhnmzKSSV6UwhAmSStUlFSYs6pryg7OkpLGFRuMInOoCG004NRAtv7QWdhSGoefIdDsByrKSXWNGFNWWuSphRpjIcO2tHc5bOKdSZ6gxI5wa25GbU72XEdG4kiW6WElT7OywJ7fDjOKs2VCEs5K1OjsJ_3-25fjctB-1FTNWFpqWHap7zPI68hvQ0i69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0Qc6O5-Vc75XzZqecfZbR21cXk9kc-pev4gFE8zdHsIwuHPZ_8GJx-RLWA9jArz9FiwgSeAqn58FwOBwGTAjUQ_9s6adaGnMUwO3NX7c3n29vPoO_1jdfnax_aOfP_fKnq_XtzU0LuN83dgzHJ8ejMbw_PoUhHJ9-CLZgOeMWtYG-1RUeBX8HAAD__wttO5A= # # Same table twice should only show up once. @@ -61,7 +61,7 @@ https://cockroachdb.github.io/text/decode.html#eJy0Vt9u27YXvq6e4sA3dX6wGzn5XQQOC query T EXPLAIN (OPT, ENV) SELECT * FROM x one, x two ---- -https://cockroachdb.github.io/text/decode.html#eJy0Vs1u27gTP1dPMfClzh92Iaf_Q-CgB9f1At51ncJWiwZBQNDSSOaGIhly5DhZLNCHyHGfLk-yIOUkziKyFljUB0Mi5zcfv_lSvw_f0Dqh1RDGOr2ymqfrTx8Bt5iuKiEztEDoCDa1VBT1-8Cl1DfMWDTcIuOOaUPMSK5gzR3QGiHDnFeSYMNlhUPQee5xqXbEXMqVYzeC1mwnxVItmRN32ALPuPfkVjbKTZdnPfj86TwI73QLRQd1n-wLk-XK8ZSEVsxYoa2g2yag0rbksgl9XXEp6JbpnDm0G5E2OmCxqCS3TYos8oxpJRv9eCTnFWzlkOXaJwttUOTalAhX5zavpGTEVxLrfB3CLSeJB5K7lvDBn5wCPDv0KMkr0t4EqqBVlEaKVBBzKDEllmvLKuMz3GhKvQbfD9frWHFK18wRJyxRUbPjL7Qph5ZYzh0xw2n9r0BlJUkY_6AzkYuUex-cT3jgrYXpnZI7Udzxgv2uRXPv1Ea3xtPEVcZEobRFpjSxjXDCq0m1rErlmFAs1aatVIQitBsuD_aS0Y4Ki84DJLcF1jXhq4FZfdNI7CCO44DR6a4DDIlS3GHGDLckPEuYMaEy3AZth-NW3qi2GVrMmOSOWmLzVR_KiFlc6xK9r6wmOztsyc8wZ6SoJxSTohSNxo7j_5_sMCE2G1ptLRzpwvKypepeokIdhQlIvK1eXyL3KyDwiW39bQpGtijfOV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jSl3oJvh-t1LDilS-aIE5aoqNnx77Qph5ZYzh0xw2n5r0BlJUkY_6AzkYuUex-cL3jI255Mb5Q8iOKBF-x3LZp7pza6Nj5NXGVMFEpbZEoTWwknvJpUy6pUjgnFUm32UUUoQrvicmcvGe2osOg8QHJbYM0JzwZm9V1jYntxHAeMTjcdYEiU4gEzZrgl4bOEGRMqw3XQtjtu5Y1qm6HFjEnuaE9snvWBRsziUpfofWV1srPdlvwMc0aKekIxKUrRaOww_v_xBhNis5tWs5hyt49034OWwpEuLC9_CBXIF8Ym8R-zt02bUATcNxRMwcgW5QcnSiG5H4mMlhbdUsvGlMYfjgLUYo6WSa1vKhNY7kKX5jd7jVpteOHrKJSpqKaAUMUemMUguDG1s4ahgO5WMsdz3JBmn1d-_whVsNeUhpVm0FJlF2ECNGbkbbyfuL4UtpLIjNULvhByx9ZpUGO5ynTJHDazvEaKEh-0auz6z8nQi1Uq1cqR5cL3qtJ-rKxC_rcad29b1TlbYUra7truKoqGs9EgGUEy-DQZgakWUqQf1tCO3nEYT5NjmJ4nMP08mXSid4vNSf02PJ_Ok9lgPE1gzcwN3sPFbHw2mF3Cb6NLaHMYzIcHnejdeHo6-gprtmAiW0N7Ec6jg5MoGkyS0eyflsfTX0fDBObJIBnPk_FwDu-vIgCAP8K__7X4qghfFq0-xJ3X480sbvXh6uWwlm-9vF9vy1vkhBnj1OpD6zDuHXfjXjfuQdzrx3E_jltbwn7PCpX6T6ZKeUAv3rYdhkn4nKJ74x1rbYPDLH0GbsP8jHxReHjUOzwKd392_mvIi58ScvDw50UdXb8_iaLR14vJYDyF9vlF0oHR9MsBzEcTT4r_wS-z8zNYw2AOWmGnfqI7fRJ1u91uJJRC2w0rvZ1a7dxBBE-Pfz09fnt6_AZh5a3hiruPWuF1wxXd6XD1uLnKhSS0DtpkKzyI_g4AAP__FRvwug== # # Set a relevant session variable to a non-default value and ensure it shows up @@ -74,7 +74,7 @@ SET reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) S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hBqo1ZsxcWWh6dHxjCZqxot9Qe9Y_KaHpTsXfwP6cTDGpkpaZ1h3K-rVP6ytMGCF7s7uFndzFrKnDLbHngZRZNFPE5jSMfvZzHoZiV4tr-GnehNA9MkPYZknkLyYTbbi960m1-6_ybzZJkuxtMkhTXqG1rD1WJ6OV5cw5_xNew0MF5Odn_EtVh45MV8EU9_SzpkuwuL-CJexMkkXj63cL_DPHmanMefAo_n97DTBtFo9zSKxrM0XvzY9jT5I56ksEzH6XSZTidLePv5y9vTKIo_Xc3G0wR25lfpHsTJx11YxjOP_R9cLOaXsIa_fo8XMTRwBken0Wg0GkXhTK4jeHp8fHr8-vT4Ff71xp3AwbsT-HxwBCM4OPoS_RMAAP__Rg53bA== # Make sure it shows up correctly even if it matches the cluster setting. statement ok @@ -84,7 +84,7 @@ SET CLUSTER SETTING sql.defaults.reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyMVdFO48gSfR5_Rb0NXBFgLqsVAvGQCWY3u8FBiWd20GhU6thlu5d2d9PdNoSn-Qi-kC9ZdTvswAjH-wZRnVPlc05Vj0bwmYzlSp7ARGU3RrGsOv8IdE_ZquEiJwOOrIO2q4qi0QiYEOoOtSHNDCGzqLRDLZiEillwFUFOBWuEg5aJhk5AFYXHZco6tBmTFu-4q3BThZkSaPkDDcBz5idZi9666XK-B5fn16F4w82l28p9_LLYGSYtyxxXErXhynC37gNKZWom-tC3DRPcrVEVaMm0POsdwFDZCGb6iAyxHJUUvXM8i_MGtrGEhfJmkQlEdoiE287bohECHVsJ6vzahlvGqQc6eyvgzP9yCvBjoOdK1jjlW5AMrLzWgmfcoSVBmcNCGWy0d7i3lXwL_vJzPceKuaxC65ijmqTrH_wVm7RkHBbMOtTMVf8JVDfCce3_UDkveMb8DNYbHnQbUHpD8sDLB1bi34r3707X9F57mZjMkZdSGUKpHLbcck-TKdHU0iKXmCk9FBUuHZmWia27pJV1pSHr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89I1jjlS5AMqrzWgmfcoSVBmcNCGWy0d7i3lHyN_vJzvcaKuaxC65ijmqTrb_w7NWnJOCyYdaiZq_4TqW6E49r_oXJe8Iz5Hqw3PMxtYNIbkQdePrAS_1a8f3e6ovfaj4nJHHkplSGUymHLLfcymRJNLS1yiZnSQ1Hh0pFpmdi6S1pZVxqyniCYKanLhE8DGnXXO9h3h4eHgaOyzQZox2v-QDlqZhz3U6IcuczpPqht_27piyqTk6EcBbNu4Nt86kOM0FClavK9YjfsfHslf8OsFry7UCh4zXuL_f_wl-MNJ3yb2ayaoYzZodB9T6q4dao0rP4pVghfOJuO_Vy9l7EJJtDQUdAlOlPW-5bXXDB_EtFVhmylRO9ID_ePAtVQQQaFUjeNDim3YUuLm8GiRmlWeh-51I3rIsBlOXSIDAXkplZn4hn8evTqTQoe2luBlhW0yc1QY_4J4rLEb1MNr5om4xqzCkegdyiv8_3R9W6YRhBqo1ZsxcWWh6dHxjCZqxot9Qe9Y_KaHpTsXfwP6cTDGpkpaZ1h3K-rVP6ytMGCF7s7uFndzFrKnDLbHngZRZNFPE5jSMfvZzHoZiV4tr-GnehNA9MkPYZknkLyYTbbi960m1-6_ybzZJkuxtMkhTXqG1rD1WJ6OV5cw5_xNew0MF5Odn_EtVh45MV8EU9_SzpkuwuL-CJexMkkXj63cL_DPHmanMefAo_n97DTBtFo9zSKxrM0XvzY9jT5I56ksEzH6XSZTidLePv5y9vTKIo_Xc3G0wR25lfpHsTJx11YxjOP_R9cLOaXsIa_fo8XMTRwBken0Wg0GkXhTK4jeHp8fHr8-vT4Ff71xp3AwbsT-HxwBCM4OPoS_RMAAP__Rg53bA== statement ok SET enable_zigzag_join = false @@ -92,7 +92,7 @@ SET enable_zigzag_join = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyMVdFO48gSfR5_Rb0NXBFgLqsVAvGQCWY3u8FBiWd20GhU6thlu5d2d9PdNoSn-Qi-kC9Zd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kMyTyH5MJvtRW-a7pf2v8k8WaaL8TRJYYP6hjZwtZhejhfX8Gd8DTs1jJeT3R_rGix85cV8EU9_S9rKZhcW8UW8iJNJvHwe4X6HefA0OY8_BRzP72GnCaTR7mkUjWdpvPhx7GnyRzxJYZmO0-kynU6W8Pbzl7enURR_upqNpwnszK_SPYiTj7uwjGe-9n9wsZhfwgb--j1exFDDGRydRqPRaBSFM7mJ4Onx8enx69PjV_jXG3cCB-9O4PPBEYzg4OhL9E8AAAD__-Sad84= statement ok SET optimizer_use_histograms = false @@ -100,7 +100,7 @@ SET optimizer_use_histograms = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyMVdFO48gSfR5_Rb0NXBFgLqsVAvGQCWY3u8FBiWd20GhU6thlu5d2d9PdNoSn-Qi-kC9ZdTvswAjH-wbROafK51RVj0bwmYzlSp7ARGU3RrGsOv8IdE_ZquEiJwOOrIO2Q0XRaARMCHWH2pBmhpBZVNqhFkxCxSy4iiCngjXCQctEQyegisLzMmUd2oxJi3fcVbhBYaYEWv5AA_Sc-U7Wohc3Xc734PL8OoA32ly6rdrHL8HOMGlZ5riSqA1Xhrt1H1EqUzPRx75tmOBujapAS6blWW8DhspGMNMnZIjlqKTo7ePZnDe4jSUslA-LTBCyQyLcdtkWjRDo2EpQl9c23jJOPdHZWwFn_pdTgB8NPSNZ45QvQTKo8loLnnGHlgRlDgtlsNE-4d5S8i36y8_1GivmsgqtY45qkq6_8Vdq0pJxWDDrUDNX_SdS3QjHtf9D5bzgGfM9WB948G3IsY3KAy8fWIl_Ky63mLcpfK-9VUzmyEupDKFUDltuuVfKlGhqaZFLzJQeGhcuHZmWia37pJV1pSHrCYKZkrq58BOBRt31mvvh8PAwcFS22QLteM0fKEfNjOPeKcqRy5zug9p2w6UvqkxOhnIUzLqBb_OTH0YJDVWqJt8rdn7n2yv5O2a14N2VQsFr3lvs_4e_HIcknz_OhH2ruHWqNKy2g3m-Jo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1ZcbhGva3yvvVRM5shLqQyhVA4bbrlnypSoK2mRS8yUHooLl45Mw8TWfdLKutKQ9QDBTEltLnwi0Ki7XnE_HB4eBozKui3Qjlf8gXLUzDjulaIcuczpPrBtF1z6psrkZChHwawb-Daf_BAlNLRWFflZsdU7397J3zGrBW-vFApe8d5m_z_85bjDhG8z3boZypjdGjxv_2vUmlunSsMqOxiC18AQwnA-HRsK-2vky-gEI2joOOgSnSmrfcsrLpg_jejWhuxaiV5ZD_ePAtRQQQaFUje1DmG3YVuLm8GmRmlWei-51LVrY8BlObRehkJl16s18gx-PXpT2eCjvRVoWUFddoYG808RlyX-UDW8bpqMq80qHINeUd7G--Pr3TC1INRGrdiKiy0PUA-NYTJXFVrqD3uL5BU9KNm7_J_SiS-rZaakdYZxv7JS-evSBAte7O_gdrWaNZQ5ZbY99DKKJot4nMaQjj_OYtD1SvBsfwM70bsapkl6DMk8heTTbLYXvWu6X9r_JvNkmS7G0ySFDeob2sDVYno5XlzDn_E17NQwXk52f65rsPCVF_NFPP0taSubXVjEF_EiTibx8nmE-x3mwdPkPP4ScDy_h50mkEa7p1E0nqXx4uexp8kf8SSFZTpOp8t0OlnC-6_f3p9GUfzlajaeJrAzv0r3IE4-78Iynvna_8HFYn4JG_jr93gRQw1ncHQajUajURRO5SaCp8fHp8fvT4_f4V9v3AkcfDiBrwdHMIKDo2_RPwEAAP__rcN4MA== statement ok SET optimizer_use_multicol_stats = false @@ -108,7 +108,7 @@ SET optimizer_use_multicol_stats = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJyMVdFS20YUfY6-4r4FOhhI6XQYGB4cI1q3RmZsJQ2TydxZS1fSltXusrsSmKd8BF_Il3R2ZRqaIitv4Dnn3Ktz7r07GsFHMpYreQITld0YxbLq_D3QPWWrhoucDDiyDtoOFUWjETAh1B1qQ5oZQmZRaYdaMAkVs-AqgpwK1ggHLRMNnYAqCs_LlHVoMyYt3nFX4Qa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pb0lb2ezCIr6IF3EyiZfPI9zvMA-eJufxp4Dj-T3sNIE02j2NovEsjRc_jj1N_ognKSzTcTpdptPJEt5-_vL2NIriT1ez8TSBnflVugdx8nEXlvHM1_4PLhbzS9jAX7_HixhqOIOj02g0Go2icC43ETw9Pj49fn16_Ar_euNO4ODdCXw-OIIRHBx9if4JAAD__7lOeJI= statement ok RESET reorder_joins_limit @@ -132,7 +132,7 @@ CREATE SEQUENCE seq query T EXPLAIN (OPT, ENV) SELECT * FROM seq ---- -https://cockroachdb.github.io/text/decode.html#eJyMVcFu20gMvfsr5ri7qAMnbptsgx68rhYIEDvd2Am6J2IsURI3o5kxh3ISf_1iRi6SAJHVm2DzPXIeH8nxWN0jB3L2i5q7_IGdzutvfyl8wnzTkimQlWAQteuiRqPxWGlj3CN4Rq8ZQQdwXsAbbVWtg5IaVYGlbo2onTYtflGuLCMud0Eg5NoGeCSp4RAFuTMQaI8D8ELHSp5Nb9zV6uaDWnz7NwUfuMnKUe6L18HC2gadCzkLnskxyXMf0DputOlDb1ttSJ7BlRCQd5T3FsBYtUZzHxGjLsBZ01vHT3HewbYBoXSxWciJKAyRUOh6W7bGgOiNwa5fx3CrbB2BErZGfY2_XCr1UtDPSN2KiynQJlZqvKGcBAIazAVKx9D62OHeVPY9-OvnRo6NlryGIFqwQSv9hb9hswFZoNRBwGupfwnUtEbIxw9XUEm5jjWE2PCk24DSB5I9VXtdwX-O-menS_rko0zaFkCVdYxgncCOAkWa3Jm2sQHIQu78kFXICvJOm6Oz5F2QijFEgNFcYeeJ6AZg99gr7OlkMkkYlx8mwAs1tMcCvGahqBIWQLbAp8R2_N02JnVcIGMBRgcZeFt0fbIRMNauwVgrdGIXxzPFHRa8oW5DgaGGepOdTT5eHDDpbZxGraYgrmLdDLjuLSr5KG1A0UN-fYt87YCkJw7Nt69AuGpOAjVkdNxuIDVjqJ3pVWdyMk1QxhIZjHMPrU-GDWngyofBpOy8rmJLyPpWum6SrYZ2CmOKPOTq-vFVfZ6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JiUfdBl0pFcaKSzALlyaBExtpGHXJ2In9XH6as7qdUwbi1EXeDBN0OFpRNEroQfXW2vWkCWhjftEuhtyuv4tHSTGtxYhMB-ozdkjxyeHhrWLvc1ROw3eoekGvfe9Q7-3XqewhpnvIvCmtK4Op82y66V4MXsDk5W17MdGvF87MC70Wh-m83WmVpl_9xly3mmQrOxZE4ibtXiank_u77L1KlazL51n3-enU2n52eT6ceLD-_Pzz9cTM7V1XJ-my2y5VqdqtV6drtWp5ejUfbt6_Xsaql-u_m6fqey5f3vapVdZ_O1-kP9fXuzUBG3l6PxeDweRdw26AyOu6uU_hn9HwAA__-wnkTd # # Test views. @@ -144,7 +144,7 @@ CREATE VIEW v AS SELECT a, b, u, v FROM x, y WHERE b = 3 query T EXPLAIN (OPT, ENV) SELECT * FROM v ---- -https://cockroachdb.github.io/text/decode.html#eJy0Vt9u27YXvo6e4sA3tX-wEzn-YQgcFJjrqpu31C5s9R-KgqCkI5kLRaokpdgZBhR7hlzu6fIkAyk7cVbLHjC0F0VEf9_5-51D9nrwDpVmUgxhLONrJWm8fPkCcIVxVDKeoAKD2kBVozyv1wPKubwhhcKCKiRUE1kYUnAqYEk1mCVCgiktuYGK8hKHINPU8mKpDdExFZrcMLMkGxSJJSea3eIRekJtJGveiJssZl14_fKjA29sM2EO2r7YBRtFhaaxYVKQQjGpmFk3EYVUOeVN7C8l5cysiUyJRlWxuDEAhVnJqWoypJAmRAreGMe2OHu4pUaSStssVM6QPmaE6bq3ack5MTTiWPfrEG8RhJZo9BcOz-3JJcBjQFskLY20LlA4qywvOIuZIRo5xoakUpGysB1udCX20XfTtTYiauIl0YYazFGY5sCfWBMalSEp1YYU1Cz_FSkvuWGF_UMmLGUxtTFo23BXtyOV3hi5ZdktzchvkjXPTu10VdgyUZEQlgmpkAhpSMU0s2ZiyctcaMIEiWVxTCpMGFQV5QdnqZDaZAq1JXCqMqw1YdVAlLxpLGzf933HkfFmAgrDcnaLCSmoMsxWCRPCRIIrZ-1w3sI6lSpBhQnhVJsjuVnVOxkRhUuZo42V1MVODnuyO0wXnNUbinCWs0Zn5_7_LzYcl5tyo7Zk2shM0fyI6p6ynI7cBjT0mF6fMncV4OqJx-a7yIhRWX6qWc44tduNmKVCvZS8sTr-6cBRFaaoCJfyuiycYLUbuPT6qFMlC5rZljBRlKbuJhPZsZ2i0CE3vup-PIcfBnvXi2uH_sKJpiluJHAsMHubMJGRx6q6C6pAZUoVuXluLMp-vt2fthuq5EgKJSMaMX7gDmkwo6hIZE40Nmu2ZrIcb6VonOG34djCShFLoY2izE6ekHZJVK4FO2N4dEjqmlUYG6kO3dXC88bzYBQGEI5eXAVQlBFn8ekK2t4Jhck0vIDpLITp26urrncSbU7qr_Fsugjno8k0hBUprnENb-aT16P5R_g1-AhtCqPFuNP1TibTl8EHWJGIsGQF7cide51LzxtdhcH8n54n01-CcQiLcBROFuFkvIBnnzwAgN_d__Zfi1aZeye0huB3H483m7U1hE8PhzW-9fD9eRevkBpMCDWtIbTO_f5Fz-_3_D74_aHvD32_tQO2tyYTsX0AlcIS-v6ub7dP3OPIrAsbWGuX7DbjlrhLsxvvweD5oH8-cL_90f2vKUffJWUX4ffL2vv87HK_ItdWkeU3iqyaFLneo8hyq8gnuIqkFvlqNg8mP01rZNWBefAqmAfTcbB4kGabPsrZ8pycq4NyXu-V826W7ybB-y26cmNnB63rnZQ2Pa8DowUsgitrg3Yh6kLZhQpezWev3S463QbXffK5hvc_B_MAIngOg0vPCz68uRpNptCevQm7EEzfdbZG_1fbqi69Xq_X85gQqHruidOOldS648H93V_3d1_v776CewKsvzlZ_biZbvvLn7aT93d3G8DDNjNDODs_6w_h09kAenA2-OztwFLGDSoNbaNK7Hh_BwAA__84MEGu +https://cockroachdb.github.io/text/decode.html#eJy0Vt9u27YXvo6e4sA3tX-wEzn-YQgcFJjrqpu31C5s9R-KgqCkI5kLRaokpdoZBhR7hlzu6fIkAyk7cVbLXjG0F0VEf9_5-51D9nrwBpVmUgxhLONrJWm8fP4McIVxV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6sIG1dslunW6JuzS7Ju8Nng_65wP32x_d_5py9F1SdhF-v6y9j08u9ytybRVZfqXIqkmR6z2KLLeKfISrSGqRL2bzYPLTtEZWHZgHL4J5MB0Hi3tptumDnC3Pybk6KOf1XjnvZvlmErzdois3dnbQut5JadPzOjBawCK4sjZoF6IulF2o4MV89tLtotNtcN1Hn2t4-3MwDyCCpzC49Lzg3aur0WQK7dmrsAvB9E1na_R_ta3q0uv1ej2PCYGq595F7VhJrTse3N3-dXf75e72C7h3w_qrk9WPm-m2v_xpO3l3e7sB3G8zM4Sz87P-ED6cDaAHZ4OP3g4sZdyg0tA2qsSO93cAAAD__8LDVSA= # # Test tables in user-defined schemas. @@ -157,7 +157,7 @@ CREATE TABLE s.t (a int primary key) query T EXPLAIN (OPT, ENV) SELECT * FROM s.t; ---- -https://cockroachdb.github.io/text/decode.html#eJyMVV1v20YQfA5_xb3FLizDbYrCiJEHRVEBtbJsSExQoygWJ3JJbn28O-8t5Y9fX9xRQWTAFPsmCDuzy9mZvclEfUMO5OxHNXPFPTtdNF8-K3zCYtuRKZGVYBC166uybDJR2hj3CJ7Ra0bQAZwX8EZb1eigpEFVYqU7I2qnTYcflauqiCtcEAiFtgEeSRrYV0HhDAR6wRF4qeMkz2awbrG5OVPXX-5S8Z6brBzlvjwsFtY26ELIWfBMjkmeh4DWcavNEPqh04bkGVwFAXlHxeAAjHVnNA8RMeoSnDWDc3wX5w1sFxAqF5eFnIjCGAmFfrdVZwyI3hrs93UMt5nnESjhwahP8Z8rpX4M9L1Sd-JiC7SJlVpvqCCBgAYLgcoxdD5ueLCVfQt--LmRY6ulaCCIFmzRyvDgr9hsQBaodBDwWpr_BWo7I-TjD1dSRYWOM4S48KTbiNJ7kheqX3QN_zoazk7f9MlHmbQtgWrrGME6gR0FijSFM11rA5CFwvkxq5AV5J02R7PkXZCaMUSA0Vxj74noBmD3OCjszxcXFwnjin0CvFBLL1iC1ywUVcISyJb4lNiOf7eNTR2XyFiC0UFGvi26PtkIGB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J_AV6opRcswWsWilvCEsiW-JTYjn-3jU0dl8hYgtFBRr4tuj7ZCBgb12KcFfpll8c7xQwL3lCfUGCopcFmv1z8ernHpG_j_akxFjqMme57UENBXM26_SFUMl-KTdE_1u_QNkkEHAsFX4Nw3Z4HasnoGIkgDWNonBlc6cX5uwRlrJDBOHff-eTykK60uh9tys7rOupI1nfSW4BsPRZEjKly36sX8YP67d2rmZQ0DA8Ggq5w75uxweITRLaGb1tNr5pHlo63KQQGl_I6PoZuVIM7g-DZbfWWzJGHZ4CGtS1dCwGHjd4jqcUXZwcP_3M-i2WdLZwNwpriuVoXk2WXJDi43dHL6ne2w0IcH3vgbZbN1vNpPlf59ONyrsK5qJPsjVaLVX6pVje5Wn1eLs-yN7Ob1SZfTxerXAn4e3xWt-vF9XR9p_6c36kTraab2Wl2epVl02U-Xx_QLVZ_zGe52uTTfLHJF7ONevv3P2-vsmz-1-1yulipk5vb_EzNV19O1Wa-jLU_qd_XN9cRfZVNJpNJlvJKsv8CAAD__3SdR4U= # # Test default_transaction_quality_of_service settings. @@ -169,7 +169,7 @@ SET default_transaction_quality_of_service=background query T EXPLAIN (OPT, ENV) VALUES(1); ---- -https://cockroachdb.github.io/text/decode.html#eJyMVcFu3EYMvesr5mgD3sBuiiJI4EOa-BAgTQLYMdoTwZUoifVoOOZQa3tP-Qh_ob-kmNEGsYHVqrfFgu-R8_getVq5a9LEEt66D1LfqGDdf_zT0T3V65F9Q-qMkrnNVFVVq5VD7-UOolJEJcAEEg2ix-B6TM56cg21OHpzG_QjvXXSthlXSzJINYYEd2w97KqgFg-Jt7QAbzBP8uBn6z5dfj1xf338pxTvuDnYQe43z4tNMSSsjSVAVBZle5gDBtEBfXV5cbUXfjuiZ3sAaSGRbrgmd-7WWN90KmNo3jn3q-9PSqVu9KhzEylhAxL87Eg_ddqDHRNBK3lvpIUoLZFwmtbcjt6D4drTtLpDuCIGJ0u33p3nf_Y-E0eT3IJCYeUheq7ZIJGn2qAVhTHmZc-2Cvvg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xtsYN_hafXaGx6n4pMGBvgLooSRDHYcOZC4yUMfczAEbykuahwNNINhoNrlSRbp5QLIKB2NGaipAFU7iaFPTs9Pa0Y8btdSMY9b6mBhGpcVKIGODZ0X9kOvzuWpqINKTUQMNvM20rqa4xAaS09lVlhFLs53Kmcs5wCj8cKAvc82ey3099f7TD1bbpbNSWPeS50P4PWnE06xf6XUDV89YIa_lq_57GpJtDcUUgdmHb9i8w9ByzXEWytlNcSJiU9ffGyQpVaUggiN0OqKc91S9ub2aYqCbviI8c02BgBjt3cIVKqlbteo4nn7o-Xe29S9TDfBsjY0i43c4OVrxHHDn6oWj9widQGXdUjMCnKfnw5usUNHQJBUlnhisOBb9AEjWJspIdM00EfkdzTVuLk4n-9elfKhuglZlPksq5RymXZVAue7e7sZo2abcib6KFvfVwsLv7-8vHth0_u6POXqxN38en62F2__fj14tIdnR2_WSyXy-WilueFe3p8fHr89vT4zR2dnRwv_gsAAP__QkEw2g== statement ok SET default_transaction_quality_of_service=critical @@ -177,4 +177,4 @@ SET default_transaction_quality_of_service=critical query T EXPLAIN (OPT, ENV) VALUES(1); ---- -https://cockroachdb.github.io/text/decode.html#eJyMVcFuG0cMvesr5mgDVmA3RREk8CFNfAiQJgHsGO2JoGa5K9azwzGHK9s65SP8hf6SYmYVxAa02t4Ege-R8_ged7l016SZJb51H8TfqKBff_zT0T351cChIXVG2dxmrFoslkuHIcgdJKWESoAZJBmkgNGtMTtbk2uoxSGY22AY6K2Tti04L9kge4wZ7tjWsKsCLwEyb2kG3mCZ5CFM1n26_Hri_vr4Ty3ecXO0g9xvnhebYszojSVCUhZle5gCRtEew-Ly4mov_HbAwPYA0kIm3bAnd-68srHH8M65X11_Eip1Q0CdmkcJG5AYJgf6qdIe7JAJWilbI61EeY6E87jkdggBDFeBxsUdwlUpOFu-De68_LP3mTiYlBYUKyv3KbBng0yBvEErCkMqq55sFffBnz-3cKzQ_BqyoVFP0aYHf8EWM6lBi9kgoa3_F6gfgnEqP6Thlj2WGXJZ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KRyPdYDi4VEmydUq5AAJqR2MmShpA5W5S2LPT09OKEb_bhGTc85YaSKjGRSVqgGND95Xt8LtjaSrakFIDAbPNvK2kvsYIlNbSU5kVRrGbw53KMcsp8HiqIHDPk81-O_391Q5T36a7VVPymOdC9zNozdmkU-x_CVXDV--n4a_1ex6bagLNHYXUgWnXv8jcc8ByG8HWSnktYVLS0xcvK1SpJYUgcjOkmvJct7S9mW2qkrArPnJMg40R4NjNHSKlWrnrNZp47v54ufcmVQ_zbYCMLe1yMzdY-RZx7OCHqvXzlkht0FU9ApOi7MeXo1vc0CEQJJUVrjgc-AJN0CjGRnrINB30Eck9bSVOLv7Xq3elbIheYjZFLusapVyWTbXg2e7Obtao2Ya8iR760sfF4uLvLx_ffvjkjj5_uTpxF5-uj931249fLy7d0dnxm8VyuVwuanleuKfHx6fHb0-P39zR2cnx4r8AAAD__xVIMAU= diff --git a/pkg/sql/opt/exec/execbuilder/testdata/forecast b/pkg/sql/opt/exec/execbuilder/testdata/forecast index 00fcee581ac0..56427ea9f783 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/forecast +++ b/pkg/sql/opt/exec/execbuilder/testdata/forecast @@ -734,3 +734,111 @@ WHERE stat->>'name' = '__forecast__'; "upper_bound": "19" } ] + +# Test that optimizer_use_forecasts can be used to enable and disable forecasts. + +statement ok +SET optimizer_use_forecasts = off + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM g WHERE a > 8 +---- +scan g + ├── columns: a:1 + ├── constraint: /1: [/9 - ] + ├── stats: [rows=1.8e-09, distinct(1)=1.8e-09, null(1)=0] + │ histogram(1)= + ├── cost: 14.02 + ├── key: (1) + └── distribution: test + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM s WHERE b < 3 +---- +scan s + ├── columns: b:1 + ├── constraint: /1: [ - /2] + ├── stats: [rows=3, distinct(1)=3, null(1)=0] + │ histogram(1)= 0 1 0 1 0 1 + │ <--- 0 --- 1 --- 2 + ├── cost: 17.05 + ├── key: (1) + └── distribution: test + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM c WHERE h > '1988-08-07' +---- +scan c + ├── columns: h:1 + ├── constraint: /1: [/'1988-08-07 00:00:00.000001+00:00' - ] + ├── stats: [rows=4.8e-09, distinct(1)=4.8e-09, null(1)=0] + │ histogram(1)= + ├── cost: 14.02 + ├── key: (1) + └── distribution: test + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM x WHERE a > 16 +---- +scan x + ├── columns: a:1 + ├── constraint: /1: [/17 - ] + ├── stats: [rows=8e-10, distinct(1)=8e-10, null(1)=0] + │ histogram(1)= + ├── cost: 14.02 + ├── key: (1) + └── distribution: test + +statement ok +RESET optimizer_use_forecasts + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM g WHERE a > 8 +---- +scan g + ├── columns: a:1 + ├── constraint: /1: [/9 - ] + ├── stats: [rows=2.666667, distinct(1)=2.33333, null(1)=0] + │ histogram(1)= 0 0.66667 0 0.66667 0 1.3333 + │ <----- 9 ------ 10 ------ 11 - + ├── cost: 16.7133333 + ├── key: (1) + └── distribution: test + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM s WHERE b < 3 +---- +scan s + ├── columns: b:1 + ├── constraint: /1: [ - /2] + ├── stats: [rows=1, distinct(1)=1, null(1)=0] + │ histogram(1)= + ├── cost: 15.03 + ├── key: (1) + └── distribution: test + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM c WHERE h > '1988-08-07' +---- +scan c + ├── columns: h:1 + ├── constraint: /1: [/'1988-08-07 00:00:00.000001+00:00' - ] + ├── stats: [rows=23, distinct(1)=23, null(1)=0] + │ histogram(1)= 0 0 5 1 5 1 5 1 5 0 + │ <--- '1988-08-07 00:00:00+00:00' --- '1988-08-07 06:00:00+00:00' --- '1988-08-07 12:00:00+00:00' --- '1988-08-07 18:00:00+00:00' --- '1988-08-08 00:00:00+00:00' + ├── cost: 38.63 + ├── key: (1) + └── distribution: test + +query T +EXPLAIN (OPT, VERBOSE) SELECT * FROM x WHERE a > 16 +---- +scan x + ├── columns: a:1 + ├── constraint: /1: [/17 - ] + ├── stats: [rows=2, distinct(1)=2, null(1)=0] + │ histogram(1)= 0 0 2 0 + │ <--- 16 --- 19 + ├── cost: 16.04 + ├── key: (1) + └── distribution: test diff --git a/pkg/sql/opt/memo/memo.go b/pkg/sql/opt/memo/memo.go index 3a8d2954d53d..98883c49ef4b 100644 --- a/pkg/sql/opt/memo/memo.go +++ b/pkg/sql/opt/memo/memo.go @@ -137,6 +137,7 @@ type Memo struct { // fields in explain_bundle.go. reorderJoinsLimit int zigzagJoinEnabled bool + useForecasts bool useHistograms bool useMultiColStats bool useNotVisibleIndex bool @@ -187,6 +188,7 @@ func (m *Memo) Init(evalCtx *eval.Context) { 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, @@ -321,6 +323,7 @@ func (m *Memo) IsStale( // changed. if m.reorderJoinsLimit != int(evalCtx.SessionData().ReorderJoinsLimit) || m.zigzagJoinEnabled != evalCtx.SessionData().ZigzagJoinEnabled || + m.useForecasts != evalCtx.SessionData().OptimizerUseForecasts || m.useHistograms != evalCtx.SessionData().OptimizerUseHistograms || m.useMultiColStats != evalCtx.SessionData().OptimizerUseMultiColStats || m.useNotVisibleIndex != evalCtx.SessionData().OptimizerUseNotVisibleIndexes || diff --git a/pkg/sql/opt/memo/memo_test.go b/pkg/sql/opt/memo/memo_test.go index 2c4505c0b69d..abd2c69ad88a 100644 --- a/pkg/sql/opt/memo/memo_test.go +++ b/pkg/sql/opt/memo/memo_test.go @@ -196,6 +196,12 @@ func TestMemoIsStale(t *testing.T) { evalCtx.SessionData().ZigzagJoinEnabled = false notStale() + // Stale optimizer forecast usage enable. + evalCtx.SessionData().OptimizerUseForecasts = true + stale() + evalCtx.SessionData().OptimizerUseForecasts = false + notStale() + // Stale optimizer histogram usage enable. evalCtx.SessionData().OptimizerUseHistograms = true stale() diff --git a/pkg/sql/opt/memo/statistics_builder.go b/pkg/sql/opt/memo/statistics_builder.go index 068f91660ac4..bad48e8005aa 100644 --- a/pkg/sql/opt/memo/statistics_builder.go +++ b/pkg/sql/opt/memo/statistics_builder.go @@ -610,15 +610,23 @@ func (sb *statisticsBuilder) makeTableStatistics(tabID opt.TableID) *props.Stati // Make now and annotate the metadata table with it for next time. stats = &props.Statistics{} - if tab.StatisticCount() == 0 { + + // Find the most recent statistic. (Stats are ordered with most recent first.) + var first int + if !sb.evalCtx.SessionData().OptimizerUseForecasts { + for first < tab.StatisticCount() && tab.Statistic(first).IsForecast() { + first++ + } + } + + if first >= tab.StatisticCount() { // No statistics. stats.Available = false stats.RowCount = unknownRowCount } else { - // Get the RowCount from the most recent statistic. Stats are ordered - // with most recent first. + // Use the RowCount from the most recent statistic. stats.Available = true - stats.RowCount = float64(tab.Statistic(0).RowCount()) + stats.RowCount = float64(tab.Statistic(first).RowCount()) // Make sure the row count is at least 1. The stats may be stale, and we // can end up with weird and inefficient plans if we estimate 0 rows. @@ -626,8 +634,11 @@ func (sb *statisticsBuilder) makeTableStatistics(tabID opt.TableID) *props.Stati // Add all the column statistics, using the most recent statistic for each // column set. Stats are ordered with most recent first. - for i := 0; i < tab.StatisticCount(); i++ { + for i := first; i < tab.StatisticCount(); i++ { stat := tab.Statistic(i) + if stat.IsForecast() && !sb.evalCtx.SessionData().OptimizerUseForecasts { + continue + } if stat.ColumnCount() > 1 && !sb.evalCtx.SessionData().OptimizerUseMultiColStats { continue } diff --git a/pkg/sql/opt/optbuilder/builder_test.go b/pkg/sql/opt/optbuilder/builder_test.go index 6f47867c06df..c13c41b2c803 100644 --- a/pkg/sql/opt/optbuilder/builder_test.go +++ b/pkg/sql/opt/optbuilder/builder_test.go @@ -78,6 +78,7 @@ func TestBuilder(t *testing.T) { ctx := context.Background() semaCtx := tree.MakeSemaContext() evalCtx := eval.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) + evalCtx.SessionData().OptimizerUseForecasts = true evalCtx.SessionData().OptimizerUseHistograms = true evalCtx.SessionData().OptimizerUseMultiColStats = true evalCtx.SessionData().LocalityOptimizedSearch = true diff --git a/pkg/sql/opt/testutils/opttester/opt_tester.go b/pkg/sql/opt/testutils/opttester/opt_tester.go index 4bdb4b9e68e3..8ebf3ee851eb 100644 --- a/pkg/sql/opt/testutils/opttester/opt_tester.go +++ b/pkg/sql/opt/testutils/opttester/opt_tester.go @@ -278,6 +278,7 @@ func New(catalog cat.Catalog, sql string) *OptTester { ot.evalCtx.SessionData().UserProto = username.MakeSQLUsernameFromPreNormalizedString("opttester").EncodeProto() ot.evalCtx.SessionData().Database = "defaultdb" ot.evalCtx.SessionData().ZigzagJoinEnabled = true + ot.evalCtx.SessionData().OptimizerUseForecasts = true ot.evalCtx.SessionData().OptimizerUseHistograms = true ot.evalCtx.SessionData().LocalityOptimizedSearch = true ot.evalCtx.SessionData().ReorderJoinsLimit = opt.DefaultJoinOrderLimit diff --git a/pkg/sql/sessiondatapb/local_only_session_data.proto b/pkg/sql/sessiondatapb/local_only_session_data.proto index 452f6a8ded52..1f0f51a5a39d 100644 --- a/pkg/sql/sessiondatapb/local_only_session_data.proto +++ b/pkg/sql/sessiondatapb/local_only_session_data.proto @@ -281,6 +281,9 @@ message LocalOnlySessionData { // disable_hoist_projection_in_join_limitation disables the restrictions // placed on projection hoisting during query planning in the optimizer. bool disable_hoist_projection_in_join_limitation = 76; + // OptimizerUseForecasts indicates whether we should use statistics forecasts + // for cardinality estimation in the optimizer. + bool optimizer_use_forecasts = 77; /////////////////////////////////////////////////////////////////////////// // WARNING: consider whether a session parameter you're adding needs to // diff --git a/pkg/sql/vars.go b/pkg/sql/vars.go index 05ad8edf3e29..f9cbbf3f8cf9 100644 --- a/pkg/sql/vars.go +++ b/pkg/sql/vars.go @@ -711,6 +711,23 @@ var varGen = map[string]sessionVar{ }, }, + // CockroachDB extension. + `optimizer_use_forecasts`: { + GetStringVal: makePostgresBoolGetStringValFn(`optimizer_use_forecasts`), + Set: func(_ context.Context, m sessionDataMutator, s string) error { + b, err := paramparse.ParseBoolVar("optimizer_use_forecasts", s) + if err != nil { + return err + } + m.SetOptimizerUseForecasts(b) + return nil + }, + Get: func(evalCtx *extendedEvalContext, _ *kv.Txn) (string, error) { + return formatBoolAsPostgresSetting(evalCtx.SessionData().OptimizerUseForecasts), nil + }, + GlobalDefault: globalTrue, + }, + // CockroachDB extension. `optimizer_use_histograms`: { GetStringVal: makePostgresBoolGetStringValFn(`optimizer_use_histograms`),