@@ -1541,6 +1541,10 @@ func ValidateConstraint(
1541
1541
runHistoricalTxn descs.HistoricalInternalExecTxnRunner ,
1542
1542
execOverride sessiondata.InternalExecutorOverride ,
1543
1543
) (err error ) {
1544
+ // Validation queries use full table scans which we always want to distribute.
1545
+ // See https://github.com/cockroachdb/cockroach/issues/152859.
1546
+ execOverride .AlwaysDistributeFullScans = true
1547
+
1544
1548
tableDesc , err = tableDesc .MakeFirstMutationPublic (catalog .IgnoreConstraints )
1545
1549
if err != nil {
1546
1550
return err
@@ -1666,6 +1670,10 @@ func ValidateInvertedIndexes(
1666
1670
execOverride sessiondata.InternalExecutorOverride ,
1667
1671
protectedTSManager scexec.ProtectedTimestampManager ,
1668
1672
) (err error ) {
1673
+ // Validation queries use full table scans which we always want to distribute.
1674
+ // See https://github.com/cockroachdb/cockroach/issues/152859.
1675
+ execOverride .AlwaysDistributeFullScans = true
1676
+
1669
1677
grp := ctxgroup .WithContext (ctx )
1670
1678
invalid := make (chan descpb.IndexID , len (indexes ))
1671
1679
@@ -1769,6 +1777,11 @@ func countExpectedRowsForInvertedIndex(
1769
1777
) (int64 , error ) {
1770
1778
desc := tableDesc
1771
1779
start := timeutil .Now ()
1780
+
1781
+ // Validation queries use full table scans which we always want to distribute.
1782
+ // See https://github.com/cockroachdb/cockroach/issues/152859.
1783
+ execOverride .AlwaysDistributeFullScans = true
1784
+
1772
1785
if withFirstMutationPublic {
1773
1786
// Make the mutations public in an in-memory copy of the descriptor and
1774
1787
// add it to the Collection's synthetic descriptors, so that we can use
@@ -1867,6 +1880,10 @@ func ValidateForwardIndexes(
1867
1880
execOverride sessiondata.InternalExecutorOverride ,
1868
1881
protectedTSManager scexec.ProtectedTimestampManager ,
1869
1882
) (err error ) {
1883
+ // Validation queries use full table scans which we always want to distribute.
1884
+ // See https://github.com/cockroachdb/cockroach/issues/152859.
1885
+ execOverride .AlwaysDistributeFullScans = true
1886
+
1870
1887
grp := ctxgroup .WithContext (ctx )
1871
1888
1872
1889
invalid := make (chan descpb.IndexID , len (indexes ))
@@ -1983,6 +2000,10 @@ func populateExpectedCounts(
1983
2000
runHistoricalTxn descs.HistoricalInternalExecTxnRunner ,
1984
2001
execOverride sessiondata.InternalExecutorOverride ,
1985
2002
) (int64 , error ) {
2003
+ // Validation queries use full table scans which we always want to distribute.
2004
+ // See https://github.com/cockroachdb/cockroach/issues/152859.
2005
+ execOverride .AlwaysDistributeFullScans = true
2006
+
1986
2007
desc := tableDesc
1987
2008
if withFirstMutationPublic {
1988
2009
// The query to count the expected number of rows can reference columns
@@ -2049,6 +2070,10 @@ func countIndexRowsAndMaybeCheckUniqueness(
2049
2070
runHistoricalTxn descs.HistoricalInternalExecTxnRunner ,
2050
2071
execOverride sessiondata.InternalExecutorOverride ,
2051
2072
) (int64 , error ) {
2073
+ // Validation queries use full table scans which we always want to distribute.
2074
+ // See https://github.com/cockroachdb/cockroach/issues/152859.
2075
+ execOverride .AlwaysDistributeFullScans = true
2076
+
2052
2077
// If we are doing a REGIONAL BY ROW locality change, we can
2053
2078
// bypass the uniqueness check below as we are only adding or
2054
2079
// removing an implicit partitioning column. Scan the
0 commit comments