MCPcopy Create free account
hub / github.com/apache/cloudberry / compute_tuples_needed

Function compute_tuples_needed

src/backend/executor/nodeLimit.c:455–462  ·  view source on GitHub ↗

* Compute the maximum number of tuples needed to satisfy this Limit node. * Return a negative value if there is not a determinable limit. */

Source from the content-addressed store, hash-verified

453 * Return a negative value if there is not a determinable limit.
454 */
455static int64
456compute_tuples_needed(LimitState *node)
457{
458 if ((node->noCount) || (node->limitOption == LIMIT_OPTION_WITH_TIES))
459 return -1;
460 /* Note: if this overflows, we'll return a negative value, which is OK */
461 return node->count + node->offset;
462}
463
464/* ----------------------------------------------------------------
465 * ExecInitLimit

Callers 1

recompute_limitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected