File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
devel
2
2
-----
3
3
4
+ * Fix numeric overflow in AQL WINDOW node cost estimation if the number of
5
+ preceding rows was set to `unbounded`.
6
+
4
7
* Updated ArangoDB Starter to 0.15.1-preview-3.
5
8
6
9
* Added garbage collection for finished and failed Pregel conductors.
Original file line number Diff line number Diff line change @@ -492,8 +492,14 @@ CostEstimate WindowNode::estimateCost() const {
492
492
// we never return more rows than above
493
493
CostEstimate estimate = _dependencies.at (0 )->getCost ();
494
494
if (_rangeVariable == nullptr ) {
495
- int64_t numRows = 1 + _bounds.numPrecedingRows () + _bounds.numFollowingRows ();
496
- estimate.estimatedCost += double (numRows * numRows) * _aggregateVariables.size ();
495
+ uint64_t numRows = 1 ;
496
+ if ( _bounds.unboundedPreceding ()) {
497
+ numRows += estimate.estimatedNrItems ;
498
+ } else {
499
+ numRows += std::min<uint64_t >(estimate.estimatedNrItems , _bounds.numPrecedingRows ());
500
+ }
501
+ numRows += _bounds.numFollowingRows ();
502
+ estimate.estimatedCost += double (numRows) * double (numRows) * _aggregateVariables.size ();
497
503
} else { // guestimate
498
504
estimate.estimatedCost += 4 * _aggregateVariables.size ();
499
505
}
You can’t perform that action at this time.
0 commit comments