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

Function EvalOrderByExpressions

src/backend/executor/nodeIndexscan.c:363–384  ·  view source on GitHub ↗

* Calculate the expressions in the ORDER BY clause, based on the heap tuple. */

Source from the content-addressed store, hash-verified

361 * Calculate the expressions in the ORDER BY clause, based on the heap tuple.
362 */
363static void
364EvalOrderByExpressions(IndexScanState *node, ExprContext *econtext)
365{
366 int i;
367 ListCell *l;
368 MemoryContext oldContext;
369
370 oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
371
372 i = 0;
373 foreach(l, node->indexorderbyorig)
374 {
375 ExprState *orderby = (ExprState *) lfirst(l);
376
377 node->iss_OrderByValues[i] = ExecEvalExpr(orderby,
378 econtext,
379 &node->iss_OrderByNulls[i]);
380 i++;
381 }
382
383 MemoryContextSwitchTo(oldContext);
384}
385
386/*
387 * IndexRecheck -- access method routine to recheck a tuple in EvalPlanQual

Callers 1

IndexNextWithReorderFunction · 0.85

Calls 3

MemoryContextSwitchToFunction · 0.85
ExecEvalExprFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected