server/sources/native.py
changeset 10061 ecbfec2da8a2
parent 10037 6b83ceda8323
parent 10053 079b5279a2cd
child 10074 ab956b780d4e
child 10076 3810332ef42c
--- a/server/sources/native.py	Fri Sep 19 13:08:26 2014 +0200
+++ b/server/sources/native.py	Wed Nov 26 17:58:23 2014 +0100
@@ -1559,6 +1559,8 @@
     Tables are saved in chunks in different files in order to prevent
     a too high memory consumption.
     """
+    blocksize = 100
+
     def __init__(self, source):
         """
         :param: source an instance of the system source
@@ -1642,10 +1644,7 @@
         sql = 'SELECT * FROM %s' % table
         columns, rows_iterator = self._get_cols_and_rows(sql)
         self.logger.info('number of rows: %d', rowcount)
-        if table.startswith('cw_'): # entities
-            blocksize = 2000
-        else: # relations and metadata
-            blocksize = 10000
+        blocksize = self.blocksize
         if rowcount > 0:
             for i, start in enumerate(xrange(0, rowcount, blocksize)):
                 rows = list(itertools.islice(rows_iterator, blocksize))