* Pairing heap provides getting topmost (greatest) element while KNN provides * ascending sort. That's why we invert the sort order. */
| 442 | * ascending sort. That's why we invert the sort order. |
| 443 | */ |
| 444 | static int |
| 445 | reorderqueue_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. |
nothing calls this directly
no test coverage detected