Revision 3114
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/db_xml.py | ||
---|---|---|
129 | 129 |
|
130 | 130 |
def __str__(self): return self.name |
131 | 131 |
|
132 |
# Controls when and how put_table() will partition the input table |
|
133 |
partition_size = 1e100 # rows; initially never partition |
|
134 |
|
|
132 | 135 |
input_col_prefix = '$' |
133 | 136 |
|
134 | 137 |
put_table_special_funcs = set(['_simplifyPath']) |
... | ... | |
159 | 162 |
sql.add_pkey(db, in_table) |
160 | 163 |
return put_table_(node, in_row_ct_ref) |
161 | 164 |
|
165 |
# Partition in_table if needed |
|
166 |
in_row_ct = sql.table_row_count(db, in_table) |
|
167 |
if in_row_ct > partition_size: |
|
168 |
for start in xrange(0, in_row_ct, partition_size): |
|
169 |
db.log_debug('********** Partition: rows '+str(start)+'-' |
|
170 |
+str(start+partition_size)+' **********', level=1.2) |
|
171 |
pkeys_loc = put_table_(node, in_row_ct_ref, partition_size, start) |
|
172 |
|
|
173 |
return pkeys_loc |
|
174 |
|
|
162 | 175 |
is_func = xml_func.is_func(node) |
163 | 176 |
out_table = name_of(node) |
164 | 177 |
|
Also available in: Unified diff
db_xml.py: put_table(): Partition in_table if larger than a threshold. The threshold is initially set to disable partitioning. Partitioning will hopefully eliminate the excessive disk usage for large input tables, which has caused the system to run out of disk space due to what may be a bug in PostgreSQL.