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

Function reorderqueue_pop

src/backend/executor/nodeIndexscan.c:495–515  ·  view source on GitHub ↗

* Helper function to pop the next tuple from the reorder queue. */

Source from the content-addressed store, hash-verified

493 * Helper function to pop the next tuple from the reorder queue.
494 */
495static HeapTuple
496reorderqueue_pop(IndexScanState *node)
497{
498 HeapTuple result;
499 ReorderTuple *topmost;
500 int i;
501
502 topmost = (ReorderTuple *) pairingheap_remove_first(node->iss_ReorderQueue);
503
504 result = topmost->htup;
505 for (i = 0; i < node->iss_NumOrderByKeys; i++)
506 {
507 if (!node->iss_OrderByTypByVals[i] && !topmost->orderbynulls[i])
508 pfree(DatumGetPointer(topmost->orderbyvals[i]));
509 }
510 pfree(topmost->orderbyvals);
511 pfree(topmost->orderbynulls);
512 pfree(topmost);
513
514 return result;
515}
516
517
518/* ----------------------------------------------------------------

Callers 2

IndexNextWithReorderFunction · 0.85
ExecReScanIndexScanFunction · 0.85

Calls 2

pairingheap_remove_firstFunction · 0.85
pfreeFunction · 0.50

Tested by

no test coverage detected