@@ -1541,6 +1541,10 @@ func ValidateConstraint(
15411541 runHistoricalTxn descs.HistoricalInternalExecTxnRunner ,
15421542 execOverride sessiondata.InternalExecutorOverride ,
15431543) (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+
15441548 tableDesc , err = tableDesc .MakeFirstMutationPublic (catalog .IgnoreConstraints )
15451549 if err != nil {
15461550 return err
@@ -1666,6 +1670,10 @@ func ValidateInvertedIndexes(
16661670 execOverride sessiondata.InternalExecutorOverride ,
16671671 protectedTSManager scexec.ProtectedTimestampManager ,
16681672) (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+
16691677 grp := ctxgroup .WithContext (ctx )
16701678 invalid := make (chan descpb.IndexID , len (indexes ))
16711679
@@ -1769,6 +1777,11 @@ func countExpectedRowsForInvertedIndex(
17691777) (int64 , error ) {
17701778 desc := tableDesc
17711779 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+
17721785 if withFirstMutationPublic {
17731786 // Make the mutations public in an in-memory copy of the descriptor and
17741787 // add it to the Collection's synthetic descriptors, so that we can use
@@ -1867,6 +1880,10 @@ func ValidateForwardIndexes(
18671880 execOverride sessiondata.InternalExecutorOverride ,
18681881 protectedTSManager scexec.ProtectedTimestampManager ,
18691882) (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+
18701887 grp := ctxgroup .WithContext (ctx )
18711888
18721889 invalid := make (chan descpb.IndexID , len (indexes ))
@@ -1983,6 +2000,10 @@ func populateExpectedCounts(
19832000 runHistoricalTxn descs.HistoricalInternalExecTxnRunner ,
19842001 execOverride sessiondata.InternalExecutorOverride ,
19852002) (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+
19862007 desc := tableDesc
19872008 if withFirstMutationPublic {
19882009 // The query to count the expected number of rows can reference columns
@@ -2049,6 +2070,10 @@ func countIndexRowsAndMaybeCheckUniqueness(
20492070 runHistoricalTxn descs.HistoricalInternalExecTxnRunner ,
20502071 execOverride sessiondata.InternalExecutorOverride ,
20512072) (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+
20522077 // If we are doing a REGIONAL BY ROW locality change, we can
20532078 // bypass the uniqueness check below as we are only adding or
20542079 // removing an implicit partitioning column. Scan the
0 commit comments