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 11devel
22-----
33
4+ * Fix numeric overflow in AQL WINDOW node cost estimation if the number of
5+ preceding rows was set to `unbounded`.
6+
47* Updated ArangoDB Starter to 0.15.1-preview-3.
58
69* 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 {
492492 // we never return more rows than above
493493 CostEstimate estimate = _dependencies.at (0 )->getCost ();
494494 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 ();
497503 } else { // guestimate
498504 estimate.estimatedCost += 4 * _aggregateVariables.size ();
499505 }
You can’t perform that action at this time.
0 commit comments