Ticket #160 (closed enhancement: fixed)
Small optimization to Table._markColumnsAsDirty()
| Reported by: | ivilata | Owned by: | somebody |
|---|---|---|---|
| Priority: | trivial | Component: | PyTables Pro |
| Version: | Keywords: | _markColumnsAsDirty optimization dirty columns | |
| Cc: |
Description
The following patch avoids Table._markColumnsAsDirty() iterating over all columns. Instead, it only iterates over updated columns:
--- tables/table.py (revision 3513)
+++ tables/table.py (working copy)
@@ -2136,10 +2136,11 @@
"""Mark column indexes in `colnames` as dirty."""
if self.indexed:
+ colindexed, cols = self.colindexed, self.cols
# Mark the proper indexes as dirty
- for (colname, colindexed) in self.colindexed.iteritems():
- if colindexed and colname in colnames:
- col = self.cols._g_col(colname)
+ for colname in colnames:
+ if colindexed[colname]:
+ col = cols._g_col(colname)
col.index.dirty = True
This is valid for trunk and 2.0.
Change History
Note: See
TracTickets for help on using
tickets.
