Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions go/vt/vttablet/tabletserver/splitquery/full_scan_algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,11 @@ func (a *FullScanAlgorithm) generateBoundaries() ([]tuple, error) {
}
result := make([]tuple, 0, a.splitParams.splitCount)
var iteration int64
// We have to allow for more than splitCount query-parts since we use an estimated
// tableSize in the equation 'numRowsPerQueryPart * splitCount = tableSize'.
maxIterations := 10 * a.splitParams.splitCount
// We used to have a safety check that makes sure the number of iterations does not
// exceed 10*a.splitParams.splitCount. The splitCount parameter was calculated from
// the estimated number of rows in the information schema, which could have been grossly
// inaccurate (more than 10 times too low).
for iteration = 0; prevTuple != nil; iteration++ {
if iteration > maxIterations {
panic(fmt.Sprintf("splitquery.FullScanAlgorithm.generateBoundaries(): didn't terminate"+
" after %v iterations (=10*splitCount). FullScanAlgorithm: %v", maxIterations, a))
}
result = append(result, prevTuple)
a.populatePrevTupleInBindVariables(prevTuple, a.noninitialQuery.BindVariables)
prevTuple, err = a.executeQuery(a.noninitialQuery)
Expand Down