diff --git a/pkg/sql/alter_table.go b/pkg/sql/alter_table.go index 1269eb805d5b..254223052b8b 100644 --- a/pkg/sql/alter_table.go +++ b/pkg/sql/alter_table.go @@ -1587,11 +1587,45 @@ func insertJSONStatistic( fullStatisticIDValue = s.FullStatisticID } - _ /* rows */, err := txn.Exec( - ctx, - "insert-stats", - txn.KV(), - `INSERT INTO system.table_statistics ( + if s.ID != 0 { + _ /* rows */, err := txn.Exec( + ctx, + "insert-stats", + txn.KV(), + `INSERT INTO system.table_statistics ( + "statisticID", + "tableID", + "name", + "columnIDs", + "createdAt", + "rowCount", + "distinctCount", + "nullCount", + "avgSize", + histogram, + "partialPredicate", + "fullStatisticID" + ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)`, + s.ID, + tableID, + name, + columnIDs, + s.CreatedAt, + s.RowCount, + s.DistinctCount, + s.NullCount, + s.AvgSize, + histogram, + predicateValue, + fullStatisticIDValue, + ) + return err + } else { + _ /* rows */, err := txn.Exec( + ctx, + "insert-stats", + txn.KV(), + `INSERT INTO system.table_statistics ( "tableID", "name", "columnIDs", @@ -1604,19 +1638,20 @@ func insertJSONStatistic( "partialPredicate", "fullStatisticID" ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)`, - tableID, - name, - columnIDs, - s.CreatedAt, - s.RowCount, - s.DistinctCount, - s.NullCount, - s.AvgSize, - histogram, - predicateValue, - fullStatisticIDValue, - ) - return err + tableID, + name, + columnIDs, + s.CreatedAt, + s.RowCount, + s.DistinctCount, + s.NullCount, + s.AvgSize, + histogram, + predicateValue, + fullStatisticIDValue, + ) + return err + } } // validateConstraintNameIsNotUsed checks that the name of the constraint we're diff --git a/pkg/sql/logictest/testdata/logic_test/distsql_stats b/pkg/sql/logictest/testdata/logic_test/distsql_stats index 6437b085a664..9a16e5161d61 100644 --- a/pkg/sql/logictest/testdata/logic_test/distsql_stats +++ b/pkg/sql/logictest/testdata/logic_test/distsql_stats @@ -1631,7 +1631,9 @@ statement ok CREATE STATISTICS s FROM all_null query T -SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) +SELECT jsonb_pretty( + regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"id": [0-9]+', '"id": 0', 'g')::JSONB +) FROM ( SELECT json_array_elements(statistics) - 'created_at' AS stat FROM [SHOW STATISTICS USING JSON FOR TABLE all_null] @@ -1654,6 +1656,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE all_null] ], "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "s", "null_count": 0, "row_count": 1 @@ -1666,6 +1669,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE all_null] "distinct_count": 1, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "s", "null_count": 1, "row_count": 1 @@ -1689,7 +1693,9 @@ statement ok CREATE STATISTICS s FROM greeting_stats query T -SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) +SELECT jsonb_pretty( + regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"id": [0-9]+', '"id": 0', 'g')::JSONB +) FROM ( SELECT json_array_elements(statistics) - 'created_at' AS stat FROM [SHOW STATISTICS USING JSON FOR TABLE greeting_stats] @@ -1712,6 +1718,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE greeting_stats] ], "histo_col_type": "test.public.greeting", "histo_version": 3, + "id": 0, "name": "s", "null_count": 0, "row_count": 1 @@ -1877,7 +1884,9 @@ SHOW HISTOGRAM $hist_id_1 upper_bound range_rows distinct_range_rows equal_rows query T -SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) +SELECT jsonb_pretty( + regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"id": [0-9]+', '"id": 0', 'g')::JSONB +) FROM (SELECT json_array_elements(statistics) - 'created_at' AS stat FROM [SHOW STATISTICS USING JSON FOR TABLE tabula]) ---- @@ -1890,6 +1899,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) "distinct_count": 0, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "aristotle", "null_count": 0, "row_count": 0 @@ -1902,6 +1912,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) "distinct_count": 0, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "aristotle", "null_count": 0, "row_count": 0 @@ -1914,6 +1925,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) ], "distinct_count": 0, "histo_col_type": "", + "id": 0, "name": "aristotle", "null_count": 0, "row_count": 0 @@ -1926,6 +1938,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) "distinct_count": 0, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "aristotle", "null_count": 0, "row_count": 0 @@ -1973,7 +1986,9 @@ SHOW HISTOGRAM $hist_id_1 upper_bound range_rows distinct_range_rows equal_rows query T -SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) +SELECT jsonb_pretty( + regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"id": [0-9]+', '"id": 0', 'g')::JSONB +) FROM (SELECT json_array_elements(statistics) - 'created_at' - 'avg_size' AS stat FROM [SHOW STATISTICS USING JSON FOR TABLE tabula]) ---- @@ -1993,6 +2008,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) ], "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "locke", "null_count": 0, "row_count": 1 @@ -2012,6 +2028,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) ], "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "locke", "null_count": 0, "row_count": 1 @@ -2023,6 +2040,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) ], "distinct_count": 1, "histo_col_type": "", + "id": 0, "name": "locke", "null_count": 0, "row_count": 1 @@ -2034,6 +2052,7 @@ SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) "distinct_count": 1, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "name": "locke", "null_count": 1, "row_count": 1 @@ -2081,7 +2100,9 @@ NULL {rowid} 0 0 0 true t1_ab {a,b} 0 0 0 false query T -SELECT jsonb_pretty(COALESCE(json_agg(stat), '[]')) +SELECT jsonb_pretty( + regexp_replace(COALESCE(json_agg(stat), '[]')::STRING, '"id": [0-9]+', '"id": 0', 'g')::JSONB +) FROM ( SELECT json_array_elements(statistics) - 'created_at' AS stat FROM [SHOW STATISTICS USING JSON FOR TABLE t1] @@ -2096,6 +2117,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1] "distinct_count": 0, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "null_count": 0, "row_count": 0 }, @@ -2107,6 +2129,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1] "distinct_count": 0, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "null_count": 0, "row_count": 0 }, @@ -2118,6 +2141,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1] "distinct_count": 0, "histo_col_type": "INT8", "histo_version": 3, + "id": 0, "null_count": 0, "row_count": 0 }, @@ -2129,6 +2153,7 @@ FROM [SHOW STATISTICS USING JSON FOR TABLE t1] ], "distinct_count": 0, "histo_col_type": "", + "id": 0, "name": "t1_ab", "null_count": 0, "row_count": 0 @@ -2363,6 +2388,18 @@ statistics_name partial_predicate row_count n xy_x_partial (x IS NULL) OR ((x < 0:::INT8) OR (x > 3:::INT8)) 4 0 xy_x_partial_2 (x IS NULL) OR ((x < 0:::INT8) OR (x > 3:::INT8)) 4 0 +query T +SELECT jsonb_pretty(stat->'name') +FROM ( + SELECT jsonb_array_elements(statistics) AS stat + FROM [SHOW STATISTICS USING JSON FOR TABLE xy] +) +WHERE stat->>'full_statistic_id' = '$statistics_id' +ORDER BY stat->>'name'; +---- +"xy_x_partial" +"xy_x_partial_2" + # Test null values. statement ok CREATE TABLE a_null (a INT, INDEX (a)); diff --git a/pkg/sql/opt/exec/execbuilder/testdata/explain_env b/pkg/sql/opt/exec/execbuilder/testdata/explain_env index c57b9d9b246f..e48baf94911d 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/explain_env +++ b/pkg/sql/opt/exec/execbuilder/testdata/explain_env @@ -13,6 +13,7 @@ CREATE TABLE x ( statement ok ALTER TABLE x INJECT STATISTICS '[ { + "id": 1, "columns": ["a"], "created_at": "2018-01-01 1:00:00.00000+00:00", "row_count": 123123, @@ -20,6 +21,7 @@ ALTER TABLE x INJECT STATISTICS '[ "histo_col_type": "" }, { + "id": 2, "columns": ["b"], "created_at": "2018-01-01 1:00:00.00000+00:00", "row_count": 123123, @@ -39,7 +41,7 @@ CREATE TABLE y ( query T EXPLAIN (OPT, ENV) SELECT * FROM x WHERE b = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U-2Om0YU_b3zFFf8sV0ZDLYiRVgrlZDZlNbBKyBpotVqNAxDMwpmNszg4laV8hB-lb5AH2WfpBq8sV2VJOrH8gNpLueee87ljG3Da94oIWsfQsneN5Kyd8-fAe84y1tRFbwBzZWG7QGFkG1DijMoqKY5VRwuYWQAoyXqy0Jp9aGCS5BluQSwbSh4SdtKw5ZWLfeBtlr2UFEXvCMNZ3Kz4XVBtZC1IrymecWLLxAYEaY_XL1KM5wYNVkUvwD1oXJYU-RE1Jo3Na0cbahII38mSlMtlBZMOVQRWRItNr102_vjdzUanGN7rvrsoAesck6GR7Ish5mOloeYjDTlGMiGasEIk1XFmVmGc9rFqKSV4sPsumn5v2HfiNrs5bAhZYY8GR7wxHW_wl_KhjOqtPr_JKud0nxD-l-oiDFwqP-DAShMcJBhyIJnK9yn2Llr80owp4MxuqAQxdlTiNcZxK9Wqym6yB8qh1O4jtMsCaI4g47cvec7uE6il0HyFn7Ab2FMIUjDyRRdRPFz_AY6khNRdDDO-zqaLBEKVsbb0Pgo_h6HGaRZkEVpFoUpjG4QAMCv_ds8Ft3-RJT4hVs-uNNTmcmq3dTK8uHmWDzgreP59hzfcKp5Qai2fLDmrvfUdj3b9cD1fNf1Xdc6A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ieQ4Cuc4DjEKXxI8Jieom_6-uhvPx_93WD0-33xq-tVEMUwXl9nU8DxywmkeGWw38FVsn4OHfz8A04w5HAJiyWybdtGitEauu8fbh-C-_3-fv_-fv8emKyVbqiotQ-z-czz4Wa2ABtmi1v0dwAAAP__GYf9hw== statement error pq: at or near "EOF": syntax error: the ENV flag can only be used with OPT @@ -52,7 +54,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#eJy0VO1u2zYU_R0-xYX_2B5MR4pRoJARYK7LdNpcOZDUrkUQEBRFrVxlMhUpT9owoNgz-OdeYy-wR8mTDJRTx0PVFvuIfxjg5bnnnnN9aIzhpaiM1CqApeZvK834m6dPQDSCZ7Usc1GBFcbCdo9CCGNISAo5syxjRsA5DB1gOEddWRpr3pVwDroo5gAYQy4KVpcWtqysRQCstrqDSpWLhlaC681GqJxZqZWhQrGsFPlnCJwI179cvUhSEjs1aRg9A_OunPIqz6hUVlSKlVPrqGilf6LGMiuNldxMmaG6oFZuOunY__MPM-ydg33PfHLQHdZM7w0PdVH0Mx0s9zE5aWbqIBtmJadcl6XgbhnT-10MC1Ya0c9uq1r8G_aNVG4v-w0ZN-RR_4BHnvcF_kJXgjNjzf8n2bTGig3tfkJDnYF9_R8MQMuYLFIC6eLJinQpnt7UWSn5tIEROmEQRuljiNYpRC9Wqwk6ye4q-9NyHSVpvAijFBp681a0cBmHzxfxa_iOvIYRg0WyHE_QSRg9Ja-goRmVeQOjrKuj8Ryhxcp56xsfRt-SZQpJukjDJA2XCQyvEADAL923-wzY9gdq5M9iEIA3uS9zXdYbZQYBXB2Ke_zgcL4-xleCWZFTZgcBDM48_zH2fOz54PmB5wWeNzgCuzRLxS3lulauwfeOZ7-RxmqXIWrbGydscNys6rI8NB63uRd4IDyb-Wez7u7XyX-1nD2I5U7hw7lG18P5Z7LZumzWH2Vz-6lstj3ZrD9k82-4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Z4PISFLh_0GLuPVU9iOoIEfvyMxgQwuYDpDGGOMpFKiwj9rqWDAK23MEMHd7s-73du73VswnClo3qtsv71_sO7mD-f63W53D-BaGVsxqWwA55NzP4Dr8ylgOJ_eoBNYIUsrKgMD92czRP8EAAD__w3UIZ8= # # Same table twice should only show up once. @@ -61,7 +63,7 @@ https://cockroachdb.github.io/text/decode.html#eJy0VO1u2zYU_R0-xYX_2B5MR4pRoJARY query T EXPLAIN (OPT, ENV) SELECT * FROM x one, x two ---- -https://cockroachdb.github.io/text/decode.html#eJy0VN1u2zYUvg6f4kA3tgdLkFIUKGzkQlWZQpsrB5JatAgCgqKolatMpiLlyBsG9CF8udfYC-xR8iQD5cT2MCXBfqILQTznO98539EnuS584I0WSs4gUuxLoyj7_OY18I6zohV1yRswXBtY71AIuS5kOIeSGlpQzeEMRhYwmqM-LLTRX2s4A1VVcwDXhZJXtK0NrGnd8hnQ1qgeKmTJO9JwplYrLktqhJKacEmLmpePENghbH20eJ_lOLXT5HHyFvTX2mNNWRAhDW8krT1jqUijbog21AhtBNMe1URVxIhVP7ob_PG7Hg32cQNfP9joDqu9g-CRqqphpr3kISY7mvYsZEWNYISpuubMLsM77GJU0VrzYXbTtPzfsK-EtHvZbUjbJi-HG7z0_Sf4K9VwRrXR_9_IeqMNX5H-FWpiBezi_6ABilIc5hjy8PUC9y72rtuiFszrYIxOKMRJ_gqSZQ7J-8Viik6Ku8juFC2TLE_DOMmhI9df-AYu0vhdmH6CH_AnGFMIs2gyRSdx8gZ_hI4URJQdjIs-jiZzhMKF1TbUPk6-x1EOWR7mcZbHUQajSwQA8Et_t5dD1z8SLX7mzgz86SHMVN2upHZmcLkP7vDO_nx1jG84Nbwk1DgzcE794JXrB64fgB_MfH_m-84R2LpZSGYIU620BYF_3Puz0EZZDxGzubaDOcfFsq3rfeFxmf0C94SnL4LTF33u1-l_lVw8i-R-wudTja5G80e8ubHebP_mzfVD3twMeLO99-ZfcGtSWeT5MsXx22SHXE8gxec4xUmE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xclJIxZo7SeILjb_XG3-3S3-wSaUQkdXFF9riS_fqBlblXf2t23KlEb3mgY27-SCfo7AAD__5L6Fgo= # # Set a relevant session variable to a non-default value and ensure it shows up @@ -74,7 +76,7 @@ SET reorder_joins_limit = 63 query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgZLkWJ0CGTkQlWZTpsrB5LatQgCgqKolatEpiLlWRsG9CHyKnuBPUqeZKDc2h6mttjW-sKAjr-f8x1_chx4wVstlAwgUuxNqyh7_eQx8C1nRSfqkrdguDaw2aEQchzIcA4lNbSgmsMlTC1gukTDWGij39ZwCaqqlgCOAyWvaFcb2NC64wHQzqgBKmTJt6TlTDUNlyU1QklNuKRFzctPCCg50Fuu2pK35GclpCa1aISBS_h2Mcq5QAMnWj3PcpzaAHmcPAX9tnZZWxZESMNbSWvXWHfSql-INtQIbQTTLtVEVcSIZkjr-H_-oaejNo7v6Y8avcdq93CjqaqqcaX9lcaU7GratZCGGsEIU3XNmb2fezjftKK15uPqpu34f1FvhLR32V1IW5NH4waPPO8z-pVqOaPa6C-3su614Q0Z_kJNbIDd_F8YoCjFYY4hDx-v8FB8964rasHcLczQCYU4yS8gWeeQPF-t5uikeD_ZPUXrJMvTME5y2JK7N7yH6zR-Fqav4Af8CmYUwiw6naOTOHmCX8KWFESUW5gVwxydLhEKVzbbmH2cfI-jHLI8zOMsj6MMpjcIAOC34dt-JnTzE9HiVz4JwJsfxkzVXSP1JICb_XCHn-yfb4_xLaeGl4SaSQCTc8-_cDzf8Xzw_MDzAs-bHIFtm4VkhjDVSUvwvWPv10IbZTtETH9nF5sck2VX13viMc2-gXvB84V_vhh--33-fyMXXyXysOHXS41up8tPdLO33ez-0c3Nx7rZj3Sz-9DNv-E2pLLIq3WK46fJDrk5hRRf4RQnEc7gQz9n9FBsyxuKvfl8sfvRYg958cvrVRgnMFtf53PAyYtTyPDKYr-Bq3T9DHr48TucYujgEhZL5DiOgzSjEnoED_f3D_fvHu7fAVNSm5YKaQI48wO4OVuAA2eLW_RXAAAA__8JxwUg +https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgZLkWJ0CGTkQlWZTpsrB5LatQgCgqKolatEpiLlWRsG9CHyKnuBPUqeZKDc2h6mtui6-cKAjr-fcz5_chx4wVstlAwgUuxNqyh7_eQx8C1nRSfqkrdguDaw2aEQchzIcA4lNbSgmsMlTC1gukTDWGij39ZwCaqqlgCOAyWvaFcb2NC64wHQzqgBKmTJt6TlTDUNlyU1QklNuKRFzctPCCg50Fuu2pK35GclpCa1aISBS_h2Mcq5QAMnWj3PcpzaA_I4eQr6be2ytiyIkIa3ktause6kVb8QbagR2gimXaqJqogRzXCt4__5h56O2ji-pz9q9B6r3UNGU1VV40r7lMaU7GratZCGGsEIU3XNmc3PPcQ3rWit-bi6aTv-b9QbIW0uu4S0NXk0bvDI8z6jX6mWM6qN_u9W1r02vCHDX6iJPWA3_wIDFKU4zDHk4eMVHorv3nVFLZi7hRk6oRAn-QUk6xyS56vVHJ0U7ye7p2idZHkaxkkOW3L3hvdwncbPwvQV_IBfwYxCmEWnc3QSJ0_wS9iSgohyC7NimKPTJULhyt42Zh8n3-MohywP8zjL4yiD6Q0CAPht-LafCd38RLT4lU8C8OaHMVN110g9CeBmP9zhJ_vn22N8y6nhJaFmEsDk3PMvHM93PB88P_C8wPMmR2DbZiGZIUx10hJ879j7tdBG2Q4R09_ZxSbHZFFawtFAdnW9VzrWsa_k3uF84Z8vht9-n39tBsX_ksGw4ZfFcP41MaDb6fIT7e1te7t_tHfzsfb2I-3tPrT3b7gNqSzyap3i-GmyQ25OIcVXOMVJhDP40OAZPVTf8obqbz5f_X60-sO9-OX1KowTmK2v8zng5MUpZHhlsd_AVbp-Bj38-B1OMXRwCYslchzHQZpRCT2Ch_v7h_t3D_fvgCmpTUuFNAGc-QHcnC3AgbPFLforAAD__0aGCsU= # Make sure it shows up correctly even if it matches the cluster setting. statement ok @@ -84,7 +86,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#eJy0U91u2zYUvg6f4sA3dgZLkWK0CGTkQlWZTpsrB5LatQgCgqKolatEpiLlWRsG9CHyKnuBPUqeZKDcOh6mpNhPfWFAR98Pv6OPjgOveauFkgFEir1vFWXvnj8DvuWs6ERd8hYM1wY2OxRCjgMZzqGkhhZUcziHqQVMl2gYC230hxrOQVXVEsBxoOQV7WoDG1p3PADaGTVAhSz5lrScqabhsqRGKKkJl7SoefmIgJIDveWqLXlLflJCalKLRhg4h6eLUc4ZGjjR6lWW49QGyOPkBegPtcvasiBCGt5KWrvGupNW_Uy0oUZoI5h2qSaqIkY0Q1rH_-N3PR21cXxPP2j0Cavd-x1NVVWNK-239KjS-A6mTxfjomcPKtqw2rWmDTWCEabqmjP7Rdz7DzKtaK35uLRpO_5v1Bsh7aZ3O9fW5Mm4wRPP-4J-pVrOqDb6_zuy7rXhDRlKoYkNsJv_AwMUpTjMMeThsxUerpJ70xW1YO4WZuiIQpzkZ5Csc0herVZzdFR8muyeonWS5WkYJzlsyc173sNlGr8M07fwPX4LMwphFh3P0VGcPMdvYEsKIsotzIphjo6XCIUrm23MPk6-w1EOWR7mcZbHUQbTKwQA8Ovwb38TuvmRaPELnwTgze_HTNVdI_UkgKv9cIef7J-vD_Etp4aXhJpJAJNTzz9zPN_xfPD8wPMCz5scgO39EJIZwlQnLcH3Dr3fCW2U7RAx_Y092OSQLLu63hMPafZO7wVPF_7pYnj32_y_Ri6-SuThhF8vNbqeLh_pZm-72f2tm5uHutmPdLP73M2_4DakssiLdYrjF8kOuTmGFF_gFCcRzuBzP2f0vtiWNxR78-Vi96PFHvLiN5erME5gtr7M54CT18eQ4ZXFfgMX6fol9PDDtzjF0ME5LJbIcRwHaUYl9Ajubm_vbj_e3X4EpqQ2LRXSBHDiB3B1sgAHThbX6M8AAAD__2aAH4o= +https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgbLkWK0CGTkQlWZTpsrB5LatQgCgqKolatEpiLlWRsG9CHyKnuBPUqeZKDc2h6mpOiy-sKAjr4fnk8fHQde80YLJX0IFXvfKMrePX8GfMNZ3oqq4A0Yrg2styiEHAdSnEFBDc2p5nAOYwsYL1A_FtroDxWcgyrLBYDjQMFL2lYG1rRquQ-0NaqHClnwDWk4U3XNZUGNUFITLmle8eIBASV7esNVU_CG_KKE1KQStTBwDk_ng5wz1HPC5as0w4ldIIviF6A_VDPWFDkR0vBG0mpmrDtp1K9EG2qENoLpGdVElcSIut_W8f76U48HbRzP1fcafcLq2T6jsSrLYaVdSg8qDWcwfjofFj27V9Euq2fWtKZGMMJUVXFmv8hs_0HGJa00H5Y2Tcv_i3otpE16m7m2Jk-GDZ647hf0S9VwRrXR_9-RdacNr0lfCk3sAtv5VxigMMFBhiELni1xf5VmN21eCTbbwAQdUYji7AziVQbxq-Vyio7yT5PtU7iK0ywJojiDDbl5zzu4TKKXQfIWfsRvYUIhSMPjKTqK4uf4DWxITkSxgUnez9HxAqFgaXcbso_iH3CYQZoFWZRmUZjC-AoBAPze_9vfiK5_Jlr8xkc-uNP9mKmqraUe-XC1G27xo93z9SG-4dTwglAz8mF06npnjus5rgeu57uu77qjA7C9H0IyQ5hqpSV47qH3O6GNsh0ipruxBxsdkkVhCQcD2VbVTulQx17yncPp3Dud9-_-mD42g_ybZNCf8OtiOH1MDOh6vHigvZ1tb_uv9q7va2830N72c3v_gVuT0iIvVgmOXsRb5PoYEnyBExyHOIXPDZ7QffUtr6_--svV7war3--L31wugyiGyeoymwKOXx9DipcW-x1cJKuX0MFP3-MEQwvnMF8gx3EcpBmV0CG4u729u_14d_sRmJLaNFRI48OJ58PVyRwcOJlfo78DAAD__yWPJS8= statement ok SET enable_zigzag_join = true @@ -92,7 +94,7 @@ SET enable_zigzag_join = true query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgbLkWK0CGTkwnWZTpsrB5LatQgCgqKolKtEpiLlWRkG9CHyKnuBPUqeZCDdOh6mpNhPfGFAR98Pv6OPngdveaOFkiEsFPvYKMo-vHwBfMNZ3oqq4A0Yrg2styiEPA9SnEFBDc2p5nAKQwsYzpAbC230pwpOQZXlDMDzoOAlbSsDa1q1PATaGuWgXNK84uRGXN3QK_KzEtKyZC9JlaXjCFnwDWk4U3XNZUGNUFKTrVLxiKmSjt5w1RS8cWaaVKIWBk7h-bSXc4IcZ7F8k2Y4saGzKH4F-lM1YU2REyENbyStJsblaNQvRBtqhDaC6QnVRJXEiNptyAv--F0Pe228wNcPGn3B6sn9XoeqLPuVdpt9VKl_B8Pn037RkwcVbVg9saY1NYIRpqqKM_tFJvcfZFjSSvN-adO0_N-o10LaTW93rq3Js36DZ77_Df1SNZxRbfT_d2TdacNr4kqhiQ2wnf8DA7RI8DzDkM1fLLG7fpPrNq8Em2xghA4oRHF2AvEqg_jNcjlGB_mXyfZpsYrTLJlHcQYbcv2Rd3CeRK_nyXv4Eb-HEYV5ujgco4MofonfwYbkRBQbGOVujg5nCM2XNluffRT_gBcZpNk8i9IsWqQwvEAAAL-6f_sb0PUV0eKGD0Lwx_djpqq2lnoQwsVuuMUPds-X-_iGU8MLQs0ghMGxH5x4fuD5AfhB6Puh7w_2wPZ-CMkMYaqVlhD4-94fhDbKdoiY7toebLBPlm1V7Yj7NHund4LH0-B46t79Nv6vkfMniexO-HSp0eVw9kg3O9vN9m_dXD_Uza6nm-3Xbv4FtyalRZ6tEhy9irfI9SEk-AwnOF7gFL72c0Tvi215rtjrbxe76y22y4vfnS_nUQyj1Xk2Bhy_PYQULy32OzhLVq-hg5--xwmGFk5hOkOe53lIMyqhQ3B3e3t3-_nu9jMwJbVpqJAmhKMghIujKXhwNL1EfwYAAP__6jExBw== +https://cockroachdb.github.io/text/decode.html#eJy0U91u2zYUvg6f4sA3dgbLkWK0CGTkwnWZTpsrB5LatQgCgqKolKtEpiLlWRkG9CHyKnuBPUqeZCDdOh6mpOi6-sKAjr4fnk8fPQ9e80YLJUNYKPa-UZS9e_4M-IazvBVVwRswXBtYb1EIeR6kOIOCGppTzeEUhhYwnCE3FtroDxWcgirLGYDnQcFL2lYG1rRqeQi0NcpBuaR5xcmNuLqhV-RXJaRlyV6SKkvHEbLgG9Jwpuqay4IaoaQmW6XiEVMlHb3hqil448w0qUQtDJzC02kv5wQ5zmL5Ks1wYpfOovgF6A_VhDVFToQ0vJG0mhi3R6N-I9pQI7QRTE-oJqokRtQuIS_460897LXxAl8_aPQJqyf3uQ5VWfYr7ZJ9VKk_g-HTab_oyYOKdlk9saY1NYIRpqqKM_tFJvcfZFjSSvN-adO0_L-o10LapLeZa2vypN_gie9_Qb9UDWdUG_3_HVl32vCauFJoYhfYzr_CAC0SPM8wZPNnS-yu3-S6zSvBJhsYoQMKUZydQLzKIH61XI7RQf5psn1arOI0S-ZRnMGGXL_nHZwn0ct58hZ-xm9hRGGeLg7H6CCKn-M3sCE5EcUGRrmbo8MZQvOl3a3PPop_wosM0myeRWkWLVIYXiAAgN_dv_0N6PqKaHHDByH44_sxU1VbSz0I4WI33OIHu-fLfXzDqeEFoWYQwuDYD048P_D8APwg9P3Q9wd7YHs_hGSGMNVKSwj8fe93QhtlO0RMd20PNtgni8IS9gayraqd0r6OveQ7h-NpcDx17_4Yf2sG-XfJwJ3w62I4_pYY0OVw9kh7O9ve9l_tXT_U3q6nve3n9v4DtyalRZ6tEhy9iLfI9SEk-AwnOF7gFD43eETvq295rvrrL1e_662-2xe_OV_OoxhGq_NsDDh-fQgpXlrsD3CWrF5CB7_8iBMMLZzCdIY8z_OQZlRCh-Du9vbu9uPd7UdgSmrTUCFNCEdBCBdHU_DgaHqJ_g4AAP__-_g2rA== statement ok SET optimizer_use_histograms = false @@ -100,7 +102,7 @@ SET optimizer_use_histograms = false query T EXPLAIN (OPT, ENV) SELECT * FROM y WHERE u = 3 ---- -https://cockroachdb.github.io/text/decode.html#eJy0VN1u2zYUvg6f4sA3cgbLkWK0CGTkwnWZTpsrB5LatQgCgpKolKtEpiTl2RkG9CHyKnuBPUqeZCDdOh6mJNhPfWGAx98Pzzkf7fvwlinNpYhgLsuPStLyw8sXwNasLDreVEyBYdrAaotCyPchwzlU1NCCagan4FmAN0WuzLXRnxo4BVnXUwDfh4rVtGsMrGjTsQhoZ6SDMkGLhpEbfnVDr8jPkgvLEr0kWdeOw0XF1kSxUrYtExU1XApNtkrVI6ZSOLq8NrzlN0yRTjPygWsjrxRt9dNMxaSqmHLX1KThLTdwCs8nvZwT5DjzxZssx6kdVx4nr0B_asalqgrChWFK0GZs3ASU_IVoQw3Xhpd6TDWRNTG8dbP1wz9-116vjR8G-kGjL1g9vt-IJ-u6X2m3k0eV-mfgPZ_0i548qGib1WNr2lLDS1LKpmGl3eX4fpVeTRvN-qWN6ti_UW-5sJPeztxu3XvWb_AsCJ7Qr6ViJdVG_39X1httWEtcKDSxDWzr_8AAzVM8yzHksxcL7B7u-LorGl6O1zBEBxTiJD-BZJlD8maxGKGD4ktle5ovkyxPZ3GSw5pcf2QbOE_j17P0PfyI38OQwiybH47QQZy8xO9gTQrCqzUMC1dHh1OEZgvbW599nPyA5zlk-SyPszyeZ-BdIACAX923_Qzo6opofsMGEQSj-3Ipm64VehDBxa64xQ9258t9vGLUsIpQM4hgcByEJ34Q-kEIQRgFQRQEgz2wfR9clIaUshOWEAb73u5PwmaImM21vdhgnyy6ptkR92n2Te8Ejyfh8cT99tvov7ZcfJOW3Q2_Xdfo0ps-ks2NzWb3t2yuHsrmpieb3dds_gW3IrVFni1THL9KtsjVIaT4DKc4meMMvuZzSO-DbXku2Kung73pDbbrF787X8ziBIbL83wEOHl7CBleWOx3cJYuX8MGfvoepxg6OIXJFPm-7yNdUgEbBHe3t3e3n-9uP0MphTaKcmEiOAojuDiagA9Hk0v0ZwAAAP__FoxFUg== +https://cockroachdb.github.io/text/decode.html#eJy0VN1u2zYUvg6f4sA3cgbLkWK0CGTkwnWZTpsrB5LatQgCgpKolKtEpiLlWRkG9CHyKnuBPUqeZCDd2h6mJOiy-sKAjr8f8juf7LrwljWKSxHAXOYfG0nzDy9fAFuzPGt5VbAGNFMaVhsUQq4LCU6hoJpmVDE4BccAnCmyY660-lTBKciynAK4LhSspG2lYUWrlgVAWy0tlAmaVYzc8KsbekV-lVwYluglybK0HC4KtiYNy2VdM1FQzaVQZKNUPGAqhaXLa81rfsMa0ipGPnCl5VVDa_U4s2GyKVhjj6lIxWuu4RSeT3o5J8hy5os3SYpjE1caRq9AfarGeVNkhAvNGkGrsbYJNPI3ojTVXGmeqzFVRJZE89pm6_p__amcXhvX99S9Rl-warzbiCPLsl9pu5MHlfozcJ5P-kVP7lU0l1VjY1pTzXOSy6piudnleLdKp6SVYv3SumnZf1GvuTBJbzI3W3ee9Rs887xH9EvZsJwqrf6_I6tOaVYTWwpFzAU2828wQPMYz1IM6ezFAtsXd3zdZhXPx2sYogMKYZSeQLRMIXqzWIzQQfZlsnmaL6MkjWdhlMKaXH9kHZzH4etZ_B5-xu9hSGGWzA9H6CCMXuJ3sCYZ4cUahpmdo8MpQrOFuVuffRj9hOcpJOksDZM0nCfgXCAAgN_tt_kM6OqKKH7DBgF4o904l1VbCzUI4GI73OAH2-fLfXzDqGYFoXoQwODY809cz3c9Hzw_8LzA8wZ7YPN-cJFrkstWGILv7XvbPwnTIaK7a3OwwT6ZF4awNxBtVW2V9nXMS751OJ74xxP72x-jp2aQfZcM7Am_LYbjp8SALp3pA-3tTHvbf7V3dV97u572tl_b-w_cipQGebaMcfgq2iBXhxDjMxzjaI4T-NrgId1V3_Bs9VePV7_rrb69L353vpiFEQyX5-kIcPT2EBK8MNgf4CxevoYOfvkRxxhaOIXJFLmu6yKVUwEdgrvb27vbz3e3nyGXQumGcqEDOPIDuDiagAtHk0v0dwAAAP__2mdK9w== statement ok SET optimizer_use_multicol_stats = false @@ -108,7 +110,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#eJy0VN1u2zYUvo6e4sA3cgbLkWK0CGTkwnWZTpsrB5LatQgCgqKolCtFpiLl2RkG9CHyKnuBPUqeZCDdOh6mpOu2-sIAj78fnnM-OgjgNWs1VzKGuaLvW0Xou-fPgK0ZLTsuKtaCYdrAaovyvCCAHBVQEUNKohmcgm8B_tRzZa6N_iDgFFRdTwGCACpWk04YWBHRsRhIZ5SDMklKwfANv7ohV_hnxaVlyV6SqmvH4bJia9wyqpqGyYoYrqTGW6XqEVMlHV1dG97wG9biTjP8jmujrlrS6K9lNp0wnCqBtSHmH7BbptqKta5JjQVvuIFTeDrp5Zx4jjNfvMoLlNlhF0n6AvQHMaZtVWIuDWslEWPj5teqX9w1uDac6jHRWNXY8MZtJoj--F37vTZBFOoHjT5h9fh-n76q636l3UYfVeqfgf900i968qCim_nYmjbEcIqpEoJRm4TxfRD8mgjN-qVN27F_o95waSe9nbnduv-k3-BJGH5Bv1Yto0Qb_f9dWW-0YQ12odDYNrCtf4WBN8_QrEBQzJ4tkHv24-uuFJyO1zD0DggkaXEC6bKA9NViMfIOyk-V7Wm-TPMimyVpAWt8_Z5t4DxLXs6yt_AjegtDArN8fjjyDpL0OXoDa1xiXq1hWLq6dzj1vNnC9tZnn6Q_oHkBeTErkrxI5jn4Fx4AwK_u234GZHWFNb9hgxjC0X2ZKtE1Ug9iuNgVt_jB7ny5j28ZMazCxAxiGByH0UkQRkEYQRjFYRiH4WAPbN8Hl9RgqjppCVG47-3-YmyGsNlc24sN9smyE2JH3KfZN70TPJ5ExxP322-j_9py-U1adjf8dl17l_70kWxubDa7v2Vz9VA2Nz3Z7D5n8y-4Fa4t8myZoeRFukWuDiFDZyhD6Rzl8DmfQ3IfbMtzwV59Odib3mC7ftGb88UsSWG4PC9GgNLXh5CjhcV-B2fZ8iVs4KfvUYagg1OYTL0gCA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gkbD25vbm5vPt3efAKqpDYt4dLEcBjFcH44gQAOJxfenwEAAP__xxFg-A== statement ok RESET reorder_joins_limit @@ -144,7 +146,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#eJy0VNFu2zYUfQ6_4sIvtgfJkWO0CGQEmOoynTZXDiQ1bREEBCVRK1eZTElKszcMKPYNftxv7Af2KfmSgXLiuKuSYlvjBwO6Ovccnstz5bpwzpTmUvgwk_l7JWn-7vkzYCuWZzWvCqbAMG2g2aIQcl1IcAoFNTSjmsEJ9C2gP0VtmWujP1RwArIspwCuCwUraV0ZaGhVMx9obWQL5aJgK6JYLpdLJgpquBSaMEGzihUPEEjRtismVcEU-UlyoUnFl9zACTyddPYco7ZnNn-VpDi2BtIwegH6QzXKVZERLgxTglYjY9WJkj8Tbajh2vBcj6gmsiSGL1u37vivP3W_U8Yde_peoRusHt3NqC_LsptpN6UHmbpn0H866SY9vpfRmtUjK7qkhuckl1XFcnsjo7sL6Ze00qyb2qia_Rf2JRd20tuZayvypFvgied9gb-UiuVUG_31jqzX2rAlaUOhiTWwrf8LATSLcZBiSINnc9yu0uiqziqej1YwQAcUwig9hmiRQvRqPnfQQXZT2T7NFlGSxkEYpbAiV-_ZGs7i8GUQv4Uf8FsYUAiS2dBBB2H0HL-BFckIL1YwyNo6Gk4RCubWW5d8GH2PZykkaZCGSRrOEuhfIACAX9t_--vR5kei-S-s54Pn3JVzWdVLoXs-XOyKW3xv93y5j1eMGlYQano-9I688bHrjV1vDN7Y9zzf83p7YLsfXOSG5LIWtmHs7Wu_49pImyFi1lf2YL39ZlFX1a5xv83u9I7waDI-mrTvfnP-r-XsUSy3J3w81-iyP30gm2ubzfqzbDb3ZXPdkc36Npuf4BpSWuTpIsbhi2iLbIYQ41Mc42iGE7jN54DeBdv2tcFuvhzsdWew9_2eh_j1rUzTbqHdOwcd1NYjGkKQQILnloM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7hL8IDuo2_62ug3X47-ujP6h_NeBPj1nUzT7qnZTAsd1WZGNAQ_hhjPDQe1ILWgtqCBs2jx8tMds_6h-_o7HGFI4RQmU4Twm_O5H4QwWJwnFuDwYnhH-s2Wq5ki27ZtxIVglW1ueRhklVRqiOBm88fN5uPN5iOojApYf1ZZfXt7HZg3v5szvdlsbgGZFEpXlAvtwfH42PXg8ngCNhxPrtABrOClZpWCgbnKhujvAAAA___ibmah # # Test tables in user-defined schemas. @@ -194,17 +196,17 @@ CREATE TABLE z ( query T EXPLAIN (OPT, ENV) SELECT * FROM z; ---- -https://cockroachdb.github.io/text/decode.html#eJy0U92O2jgUvh4_xRE3MCuCwoxajUBzQamnyi4NoyStWlWV5ThO68XYjO1kCat9rH2BfbKVQ4ehaqDan3KB5MP34-_wOQjgLTdWaDWBuWYroyn7_PIF8C1neSVkwQ04bh3UexRCQQApzqCgjubUcriFvgf0p6gd85JW0hFnqLKUOaEVeaioFK4huiSWm1owT2JGOMGonAIEwSMNaiorPgHDP1WSmr2isM4-SLgFXZadaFo53UKFKviWGM70es1VQb27JVzRXPLijIBWLd1wbQpuyK9aKEukWAsHt_D8upNzg1rOfPEmzXDiV5JF8SuwD3LETJEToRw3isqR8-7E6N-IddQJ6wSzI2r9NpxYt_sLxn_9afudNsE4tCeNvmDt6GlHfV2W3UqHLZ1V6t5B__l1t-jNSUUf1o686Zo6wQjTUvK2D6OnP6RfUml5t7QzFf836muh_Kb3O7fe5Fm3wbMw_I5-qQ1n1Dr7_13ZNtbxNWlLYYkPsJ__AwM0T_Asw5DNXixw-zhHmyqXgo22MEAXFKI4u4F4mUH8ZrEYoov8y2R_mi_jNEtmUZzBlmxWvIH7JHo9S97DL_g9DCjM0vnlEF1E8Uv8DrYkJ6LYwiBv5-hyitBs4bN12Ufxz3ieQZrNsijNonkK_Q8IAOD39tt_erT-RKzY8d4EwuHTmGlZrZXtTeDDYbjH9w7nj8d4w6njBaGuN4HeVTi-CcJxEI4hHE_CcBKGvSOwf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KV9fDq-vmt7_6T80g_ykZNDf8sRiunhID-tgdn2lv7dtbfdPe9an21i3trR7b-xVuTUqPvJsnOHoV75DrS0jwHU5wPMUpPDa4Rw_V93tN9dffr37dWv3zfrfe72rxjWHDy1OWty2WV4sWz-Xia7eGl21-61513tf2tC_87n42iWLoze-zPuD47SWkeOaxv8BdMn8N2zEKgiBAllEFW_RvAAAA__-HkG80 query T EXPLAIN (OPT, ENV) SELECT * FROM y; ---- -https://cockroachdb.github.io/text/decode.html#eJy0U92O2jgUvh4_xRE3MCuCwoxajUBzQamnyi4NoyStWlWV5ThO68XYjO1kyaz2sfYF9slWDh2gaqDan3KB5MP34-_wOQjgLTdWaDWBuWYroyn7_PIF8C1neSVkwQ04bh3UOxRCQQApzqCgjubUcriFvgf0p6gd85JW0hFnqLKUOaEVeaioFK4huiSWm1owT2JGOMGonAIEwRMNaiorPgHDP1WSmp2isM4-SLgFXZadaFo53UKFKviWGM70es1VQb27JVzRXPLijIBWLd1wbQpuyK9aKEukWAsHt_D8upNzg1rOfPEmzXDiV5JF8SuwD3LETJEToRw3isqR8-7E6N-IddQJ6wSzI2r9NpxYt_sLxn_9afudNsE4tCeNvmDt6LCjvi7LbqX9ls4qde-g__y6W_TmpKIPa0fedE2dYIRpKXnbh9HhD-mXVFreLe1Mxf-N-loov-ndzq03edZt8CwMv6NfasMZtc7-f1e2jXV8TdpSWOID7Ob_wADNEzzLMGSzFwvcPs7RpsqlYKMtDNAFhSjObiBeZhC_WSyG6CL_Mtmd5ss4zZJZFGewJZsVb-A-iV7PkvfwC34PAwqzdH45RBdR_BK_gy3JiSi2MMjbObqcIjRb-Gxd9lH8M55nkGazLEqzaJ5C_wMCAPi9_fafHq0_ESseeW8C4fAwZlpWa2V7E_iwH-7wvf354zHecOp4QajrTaB3FY5vgnAchGMIx5MwnIRh7wjs34dQzBGmK-UJ4_DY-7OwTvsOEdds_MV6x2RVSbknHtP8m94LXl2Pr67b3_4Y_tfI-Q-J3N7wx6VGH_vTM91s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zjB8Ryn8NDgAX2svt9rq19_v_pNZ_VP-733fjerbwwbXh6zfN9hebPq8FyuvnZreNnltxlUp33dH_eF390uZlEMg-VtNgQcvz2HFC889he4SZavoZmiIAgCZBlV0KB_AwAA__-Hf28y query T EXPLAIN (OPT, ENV) SELECT * FROM x; ---- -https://cockroachdb.github.io/text/decode.html#eJy0U92O2jgUvh4_xRE3MCuCwoxajUBzQamnyi4NoyStWlWV5ThO68XYjO2wyaz2sfYF9slWDh2gaqDan3KB5MP34-_wOQjgLTdWaDWBuWYroyn7_PIF8JqzvBKy4AYctw62OxRCQQApzqCgjubUcriFvgf0p6gd85JW0hFnqLKUOaEVeaioFK4huiSWm61gnsSMcIJROQUIgicabKms-AQM_1RJanaKwjr7IOEWdFl2omnldAsVquA1MZzp9Zqrgnp3S7iiueTFGQGtWrrh2hTckF-1UJZIsRYObuH5dSfnBrWc-eJNmuHErySL4ldgH-SImSInQjluFJUj592J0b8R66gT1glmR9T6bTixbvcXjP_60_Y7bYJxaE8afcHa0WFHfV2W3Ur7LZ1V6t5B__l1t-jNSUUf1o686Zo6wQjTUvK2D6PDH9IvqbS8W9qZiv8b9bVQftO7nVtv8qzb4FkYfke_1IYzap39_65sG-v4mrSlsMQH2M3_gQGaJ3iWYchmLxa4fZyjTZVLwUY1DNAFhSjObiBeZhC_WSyG6CL_Mtmd5ss4zZJZFGdQk82KN3CfRK9nyXv4Bb-HAYVZOr8coosofonfQU1yIooaBnk7R5dThGYLn63LPop_xvMM0myWRWkWzVPof0AAAL-33_7To9tPxIpH3ptAODyMmZbVWtneBD7shzt8b3_-eIw3nDpeEOp6E-hdheObIBwH4RjC8SQMJ2HYOwL79yEUc4TpSnnCODz2_iys075DxDUbf7HeMVlVUu6JxzT_pveCV9fjq-v2tz-G_zVy_kMitzf8canRx_70TDcb383qm25uT3Wz6ehm9dTNr3BbUnrk3TLB0at4h9xeQoLvcILjOU7hqZ8Deii257XF3n6_2E1nsc_nffR5N6tvAhtenor82BF5s-rIXK6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1f9wXfne7mEUxDJa32RBw_PYcUrzw2F_gJlm-hnqKgiAIkGVUQY3-DQAA__-Hbm8w # A foreign key cycle shouldn't cause infinite recursion. statement ok @@ -213,7 +215,7 @@ ALTER TABLE y ADD CONSTRAINT fk FOREIGN KEY (v) REFERENCES z (pk); query T EXPLAIN (OPT, ENV) SELECT * FROM y; ---- -https://cockroachdb.github.io/text/decode.html#eJy0U9Fu2zYUfQ6_4sIvdgbLkBO0CGzkwXWZQpsrB5JatCgKgqKoljNNOiTlWR72WfuBfdlAObU9VHawrclDAN2cew7PyblBAO-5sUKrEUw1WxhN2dfXr4BvOMsrIQtuwHHrYL1DIRQEkOIMCupoTi2HW-h6QHeMmjEvaSUdcYYqS5kTWpGHikrhaqJLYrlZC-aXmBFOMCrHAEHwbQ3WVFZ8BIZ_qSQ1O0ZhnX2QcAu6LFvRtHK6gQpV8A0xnOnlkquCenVLuKK55MUZAq2adcO1Kbghv2qhLJFiKRzcwsvr1p0b1OxMZ-_SDCc-kiyK34B9kANmipwI5bhRVA6cVydG_0aso05YJ5gdUOvTcGLZ5BcM__rTdltlgmFoTwo9Yu3gkFFXl2U70z6ls0ztGXRfXreT3pxk9GbtwIsuqROMMC0lb_owOPxDuiWVlrdTO1Px_8K-FMonvcvcepEX7QIvwvAJ_lIbzqh19sc92dbW8SVpSmGJN7Cb_wsBNE3wJMOQTV7NcHOcg1WVS8EGG-ihCwpRnN1APM8gfjeb9dFF_jjZfU3ncZolkyjOYENWC17DfRK9nSQf4Rf8EXoUJun0so8uovg1_gAbkhNRbKCXN3N0OUZoMvPe2uSj-Gc8zSDNJlmUZtE0he4nBADwe_Pb_3To-guxYss7Iwj7hzHTsloq2xnBp_1wh-_svz8f4w2njheEus4IOlfh8CYIh0E4hHA4CsNRGHaOwP4-hGKOMF0pvzAMj7W_Cuu07xBx9co_rHO8rCop94vHa_6m94RX18Or6-Zvf_T_r-X8WSw3L3w-1-hzd3ymm1vfzdXiu3IaXp6q57alnqvFt34eAcsF3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KTweoe5V5yu-ba34eV-191V9Z2t9ylTdYqpq8VSTNSk98h_O1m2-Nj36RCCta9veanG4CrxecxWsn74K6tM54Q_3s0kUQ29-n_UBx-8vIcUzj_0J7pL5W6jHKAiCAFlGFdTo7wAAAP__7cp-9g== # Check that we remove histograms from statistics correctly. @@ -226,6 +228,7 @@ CREATE TABLE b ( statement ok ALTER TABLE b INJECT STATISTICS '[ { + "id": 1, "avg_size": 1, "columns": [ "b" @@ -253,6 +256,7 @@ ALTER TABLE b INJECT STATISTICS '[ "row_count": 1100 }, { + "id": 2, "avg_size": 0, "columns": [ "rowid" @@ -269,4 +273,4 @@ ALTER TABLE b INJECT STATISTICS '[ query T EXPLAIN (OPT, ENV) SELECT * FROM b ---- -https://cockroachdb.github.io/text/decode.html#eJy8VN1u2zYUvg6f4sA3cgZLkJWmS23kQnHUQZsqB5YStCgKgqKolitFJiSVJhv2WHuBPdlAunE8QMl-sM0XBvyd74f6eOQwhCumDVdyAStFP2tF6KfzM2B3jDYDFy3TYJmxcLtlIRSGUGU1tMSShhgGpxA4QrBEHmYdGYTFVhNpCLVcSXwzEMHtPVYdNkzfcupEVHPLKRFLgDB8kMEtEQNbgGYfB0H01pEba24EnILqulE2GazyVC5bdoc1o6rvmWyJSzeYSdII1j5joKSXa6Z0yzT-UXFpsOA9t3AKL49GNSfIa1bFZVVnG1dJnZffgbkREdVtg7m0TEsiIuvSsVZfsLHEcmM5NRExrg3Le99fOP_tVxOMxoTz2DwZ9JVroseOAtV14067lp51Gu8geHk0bnrypKN7WBO50J5YTjFVQjC_D9HjhQQdEYaNW1s9sH_i3nPpmt52blzI8XjAcRz_iX-nNKPEWPPvHdncG8t67JfCYPcAW_xvBKDVJkvrDOr0rMj8yxldD43gNGpgig4aOFuvCyjXNZSXRTFDB1p94S3kZX3i0au8yp3ygQHn2ev0sqhhkPxm8LXxdno4QwerdVnVmzQva2jw9Wd2Dxeb_E26eQc_ZO9guvVNq5Xj5uV59hYa3GDe3sG08Tg6XCKU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cwPxkcfRskbyIjn989uIomex53FvFJbWYqkE6X7K3-IEbq9y9w_b-2u1usm_l7T_2K0nvRdifOcb7YjkIseuI9xbcn8bDfD6PY7_yx-wJRPF_QeTP7Ttiir8OU_ItMX1mhN4FS4Sy1xdFmpcwXV_UM8jKq0OossJduR_g5Wb9CpolCsMwRIYSCQ36OwAA__8hCA7K diff --git a/pkg/sql/opt/exec/execbuilder/testdata/partial_stats b/pkg/sql/opt/exec/execbuilder/testdata/partial_stats index f2587f3b6732..5896a53efd6a 100644 --- a/pkg/sql/opt/exec/execbuilder/testdata/partial_stats +++ b/pkg/sql/opt/exec/execbuilder/testdata/partial_stats @@ -22,6 +22,7 @@ CREATE TABLE g (b INT PRIMARY KEY) statement ok ALTER TABLE g INJECT STATISTICS '[ { + "id": 1, "avg_size": 1, "columns": [ "b" @@ -52,10 +53,10 @@ ALTER TABLE g INJECT STATISTICS '[ "histo_version": 2, "name": "__auto__", "null_count": 0, - "row_count": 3, - "statistics_id": 1 + "row_count": 3 }, { + "id": 2, "avg_size": 1, "columns": [ "b" @@ -125,6 +126,7 @@ ALTER TABLE g INJECT STATISTICS '[ "row_count": 9 }, { + "id": 3, "avg_size": 2, "columns": [ "b" @@ -156,34 +158,21 @@ ALTER TABLE g INJECT STATISTICS '[ "name": "partial", "null_count": 0, "partial_predicate": "(b < 0:::INT8) OR ((b > 8:::INT8) OR (b IS NULL))", - "row_count": 3 + "row_count": 3, + "full_statistic_id": 2 } ]' -# Here and below, we retrieve the id of the statistic (which is the -# histogram_id) to ensure that we can mark our partial injected statistic(s) as -# being collected from the injected full table statistics, for the purposes of -# testing. This is because our merge function verifies that a partial statistic -# is merging with the full statistic it has been collected from. Since the -# statistic id is generated when a statistic is added to -# system.table_statistics, and since we don't store it in the JSON statistic -# object, we need to set it manually here. - -let $stat_id_simple -SELECT "histogram_id" FROM [SHOW STATISTICS FOR TABLE g] WHERE created = '1988-08-07 00:00:00.000000' - -statement ok -UPDATE system.table_statistics SET "fullStatisticID" = '$stat_id_simple' WHERE name = 'partial' - -query TTTIIII -SELECT statistics_name, column_names, created, row_count, distinct_count, null_count, avg_size +query IITTTIIII colnames +SELECT histogram_id, full_histogram_id, statistics_name, column_names, created, row_count, distinct_count, null_count, avg_size FROM [SHOW STATISTICS FOR TABLE g WITH MERGE] ORDER BY created ---- -__auto__ {b} 1988-08-05 00:00:00 +0000 UTC 3 3 0 1 -__auto__ {b} 1988-08-07 00:00:00 +0000 UTC 9 9 0 1 -partial {b} 1988-08-08 00:00:00 +0000 UTC 3 3 0 2 -__merged__ {b} 1988-08-08 00:00:00 +0000 UTC 12 12 0 1 +histogram_id full_histogram_id statistics_name column_names created row_count distinct_count null_count avg_size +1 NULL __auto__ {b} 1988-08-05 00:00:00 +0000 UTC 3 3 0 1 +2 NULL __auto__ {b} 1988-08-07 00:00:00 +0000 UTC 9 9 0 1 +3 2 partial {b} 1988-08-08 00:00:00 +0000 UTC 3 3 0 2 +0 NULL __merged__ {b} 1988-08-08 00:00:00 +0000 UTC 12 12 0 1 query T SELECT jsonb_pretty(stat) @@ -453,6 +442,7 @@ statement ok ALTER TABLE h INJECT STATISTICS ' [ { + "id": 1, "avg_size": 1, "columns": [ "h" @@ -503,16 +493,11 @@ ALTER TABLE h INJECT STATISTICS ' "name": "partial", "null_count": 0, "partial_predicate": "(h < 10:::INT8) OR ((h > 40:::INT8) OR (h IS NULL))", - "row_count": 0 + "row_count": 0, + "full_statistic_id": 1 } ]' -let $stat_id_empty -SELECT "histogram_id" FROM [SHOW STATISTICS FOR TABLE h] WHERE statistics_name = 'full' - -statement ok -UPDATE system.table_statistics SET "fullStatisticID" = '$stat_id_empty' WHERE name = 'partial' - query TTTIIII SELECT statistics_name, column_names, created, row_count, distinct_count, null_count, avg_size FROM [SHOW STATISTICS FOR TABLE h WITH MERGE] @@ -564,6 +549,7 @@ WHERE stat->>'name' = '__merged__'; ], "histo_col_type": "INT8", "histo_version": 2, + "id": 1, "name": "__merged__", "null_count": 0, "row_count": 4 @@ -578,6 +564,7 @@ CREATE TABLE i (i INT PRIMARY KEY) statement ok ALTER TABLE i INJECT STATISTICS '[ { + "id": 1, "avg_size": 1, "columns": [ "i" @@ -660,16 +647,11 @@ ALTER TABLE i INJECT STATISTICS '[ "name": "sp", "null_count": 0, "partial_predicate": "(i < 0:::INT8) OR ((i > 3:::INT8) OR (i IS NULL))", - "row_count": 6 + "row_count": 6, + "full_statistic_id": 1 } ]' -let $stat_id_start_and_end -SELECT "histogram_id" FROM [SHOW STATISTICS FOR TABLE i] WHERE statistics_name = 'full_0' - -statement ok -UPDATE system.table_statistics SET "fullStatisticID" = '$stat_id_start_and_end' WHERE name = 'sp' - query TTTIIII SELECT statistics_name, column_names, created, row_count, distinct_count, null_count, avg_size FROM [SHOW STATISTICS FOR TABLE i WITH MERGE] @@ -787,6 +769,7 @@ statement ok ALTER TABLE ab INJECT STATISTICS '[ { + "id":1, "avg_size":3, "columns":[ "b" @@ -899,9 +882,11 @@ ALTER TABLE ab INJECT STATISTICS "name":"partial_b", "null_count":5, "row_count":36, - "partial_predicate": "(b < 15:::INT8) OR ((b > 35:::INT8) OR (b IS NULL))" + "partial_predicate": "(b < 15:::INT8) OR ((b > 35:::INT8) OR (b IS NULL))", + "full_statistic_id": 1 }, { + "id":2, "avg_size":3, "columns":[ "a" @@ -1008,22 +993,11 @@ ALTER TABLE ab INJECT STATISTICS "name":"partial_a", "null_count":5, "row_count":36, - "partial_predicate": "(b < 15:::INT8) OR ((b > 35:::INT8) OR (b IS NULL))" + "partial_predicate": "(b < 15:::INT8) OR ((b > 35:::INT8) OR (b IS NULL))", + "full_statistic_id": 2 } ]' -let $stat_id_full_a -SELECT "histogram_id" FROM [SHOW STATISTICS FOR TABLE ab] WHERE statistics_name = 'full_a' - -statement ok -UPDATE system.table_statistics SET "fullStatisticID" = '$stat_id_full_a' WHERE name = 'partial_a' - -let $stat_id_full_b -SELECT "histogram_id" FROM [SHOW STATISTICS FOR TABLE ab] WHERE statistics_name = 'full_b' - -statement ok -UPDATE system.table_statistics SET "fullStatisticID" = '$stat_id_full_b' WHERE name = 'partial_b' - query TTTIIII colnames SELECT statistics_name, column_names, created, row_count, distinct_count, null_count, avg_size FROM [SHOW STATISTICS FOR TABLE ab WITH MERGE] diff --git a/pkg/sql/show_stats.go b/pkg/sql/show_stats.go index 4d2b35e79b31..ff814d1fc431 100644 --- a/pkg/sql/show_stats.go +++ b/pkg/sql/show_stats.go @@ -258,6 +258,7 @@ func (p *planner) ShowTableStats(ctx context.Context, n *tree.ShowTableStats) (p if ignoreStatsRowWithDroppedColumn { continue } + statsRow.ID = (uint64)(*r[statIDIdx].(*tree.DInt)) statsRow.CreatedAt = tree.AsStringWithFlags(r[createdAtIdx], tree.FmtBareStrings) statsRow.RowCount = (uint64)(*r[rowCountIdx].(*tree.DInt)) statsRow.DistinctCount = (uint64)(*r[distinctCountIdx].(*tree.DInt)) diff --git a/pkg/sql/stats/json.go b/pkg/sql/stats/json.go index 094543536aec..8438043d71eb 100644 --- a/pkg/sql/stats/json.go +++ b/pkg/sql/stats/json.go @@ -28,6 +28,7 @@ import ( // // See TableStatistic for a description of the fields. type JSONStatistic struct { + ID uint64 `json:"id,omitempty"` Name string `json:"name,omitempty"` CreatedAt string `json:"created_at"` Columns []string `json:"columns"`