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

Function reorderqueue_cmp

src/backend/executor/nodeIndexscan.c:444–456  ·  view source on GitHub ↗

* Pairing heap provides getting topmost (greatest) element while KNN provides * ascending sort. That's why we invert the sort order. */

Source from the content-addressed store, hash-verified

442 * ascending sort. That's why we invert the sort order.
443 */
444static int
445reorderqueue_cmp(const pairingheap_node *a, const pairingheap_node *b,
446 void *arg)
447{
448 ReorderTuple *rta = (ReorderTuple *) a;
449 ReorderTuple *rtb = (ReorderTuple *) b;
450 IndexScanState *node = (IndexScanState *) arg;
451
452 /* exchange argument order to invert the sort order */
453 return cmp_orderbyvals(rtb->orderbyvals, rtb->orderbynulls,
454 rta->orderbyvals, rta->orderbynulls,
455 node);
456}
457
458/*
459 * Helper function to push a tuple to the reorder queue.

Callers

nothing calls this directly

Calls 1

cmp_orderbyvalsFunction · 0.85

Tested by

no test coverage detected