Changeset: 5fea5dbee4bd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5fea5dbee4bd
Modified Files:
        sql/src/backends/monet5/sql_result.mx
Branch: default
Log Message:

Set the capacity for bulk load
When you bulk load, the estimated total size is used to pre-alloc
the space, so as to avoid repeatative BATextends. In a locked mode
this should be explicitly tested and set.


diffs (16 lines):

diff -r 05a0ec5f0834 -r 5fea5dbee4bd sql/src/backends/monet5/sql_result.mx
--- a/sql/src/backends/monet5/sql_result.mx     Mon Dec 20 21:55:02 2010 +0100
+++ b/sql/src/backends/monet5/sql_result.mx     Wed Dec 22 08:04:47 2010 +0100
@@ -523,6 +523,12 @@
                                        BATmmap(b, STORE_MMAP, STORE_MMAP, 
STORE_MMAP, STORE_MMAP, 0);
                                fmt[i].c[0] = b;
                                cnt = BATcount(b);
+                               if ( BATcapacity(b) < (BUN) sz )
+                                       if ( (fmt[i].c[0] =  
BATextend(fmt[i].c[0], (BUN) sz)) == NULL){
+                                                       for ( i--; i>=0; i--)
+                                                               BBPunfix( 
fmt[i].c[0]->batCacheid);
+                                                       sql_error(m, 500, 
"failed to allocate result table sizes ");
+                               }
                                fmt[i].ci[0] = bat_iterator(fmt[i].c[0]);
                        }
                }
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to