Changeset: c7e6ce7c46b8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c7e6ce7c46b8
Modified Files:
        gdk/gdk_sketch.c
        sql/backends/monet5/sql_statistics.c
Branch: pp_hashjoin
Log Message:

Do not set uniques estimate to -1 to align with other code.


diffs (36 lines):

diff --git a/gdk/gdk_sketch.c b/gdk/gdk_sketch.c
--- a/gdk/gdk_sketch.c
+++ b/gdk/gdk_sketch.c
@@ -162,7 +162,7 @@ double
 bat_guess_uniques(BAT *b, BATiter *bi, struct canditer *bci)
 {
        uint8_t cnting_sketch[BUCKETS][CLZ_BUCKETS] = {0};
-       double unique_guess = -1;
+       double unique_guess = 0;
 
        BATiter nbi = bi ? *bi : bat_iterator(b);
        struct canditer nbci;
diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -205,6 +205,9 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
                                        /* Guess number of uniques if not 
entirely unique */
                                        /* unique_est = 
(double)BATguess_uniques(b, NULL); */
                                        unique_est = 
(double)bat_guess_uniques(b, NULL, NULL);
+                                       MT_lock_set(&b->theaplock);
+                                       b->tunique_est = unique_est;
+                                       MT_lock_unset(&b->theaplock);
 
                                        /* Collect min and max values */
                                        mn = BATmin(b, NULL);
@@ -213,8 +216,8 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
                                        GDKfree(mx);
                                        BBPunfix(b->batCacheid);
 
-                                       if (unique_est > 0)
-                                               
store->storage_api.set_stats_col(tr, c, &unique_est, NULL, NULL);
+                                       /* if (unique_est > 0) */
+                                       /*      
store->storage_api.set_stats_col(tr, c, &unique_est, NULL, NULL); */
                                }
                        }
                }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to