Changeset: 802c51349bce for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/802c51349bce
Modified Files:
        gdk/gdk_firstn.c
Branch: Jun2023
Log Message:

Skip select if it's not needed.


diffs (21 lines):

diff --git a/gdk/gdk_firstn.c b/gdk/gdk_firstn.c
--- a/gdk/gdk_firstn.c
+++ b/gdk/gdk_firstn.c
@@ -229,7 +229,7 @@ BATfirstn_unique(BATiter *bi, BAT *s, BU
                /* trivial: return all candidates */
                bn = canditer_slice(&ci, 0, ci.ncand);
                if (bn && lastp)
-                       *lastp = BUNtoid(bn, cnt - 1);
+                       *lastp = oid_nil;
                TRC_DEBUG(ALGO, "b=" ALGOBATFMT ",s=" ALGOOPTBATFMT
                          ",n=" BUNFMT " -> " ALGOOPTBATFMT
                          " (trivial -- " LLFMT " usec)\n",
@@ -1061,7 +1061,7 @@ BATfirstn_grouped(BAT **topn, BAT **gids
                        BBPunfix(bn1->batCacheid);
                        if (bn == NULL)
                                return GDK_FAIL;
-               } else {
+               } else if (last != oid_nil) {
                        BAT *bn1, *bn2;
 
                        bn1 = bn;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to