Changeset: f14c76295a57 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f14c76295a57
Modified Files:
        gdk/gdk_unique.c
Branch: Oct2014
Log Message:

Stop as soon as we know we can't have more unique values.


diffs (27 lines):

diff --git a/gdk/gdk_unique.c b/gdk/gdk_unique.c
--- a/gdk/gdk_unique.c
+++ b/gdk/gdk_unique.c
@@ -206,6 +206,11 @@ BATsubunique(BAT *b, BAT *s)
                                seen[val >> 4] |= 1 << (val & 0xF);
                                o = i + b->hseqbase;
                                bunfastapp(bn, &o);
+                               if (bn->batCount == 256) {
+                                       /* there cannot be more than
+                                        * 256 distinct values */
+                                       break;
+                               }
                        }
                }
                GDKfree(seen);
@@ -238,6 +243,11 @@ BATsubunique(BAT *b, BAT *s)
                                seen[val >> 4] |= 1 << (val & 0xF);
                                o = i + b->hseqbase;
                                bunfastapp(bn, &o);
+                               if (bn->batCount == 65536) {
+                                       /* there cannot be more than
+                                        * 65536 distinct values */
+                                       break;
+                               }
                        }
                }
                GDKfree(seen);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to