MCPcopy Create free account
hub / github.com/PyTables/PyTables / recreate_indexes

Function recreate_indexes

tables/scripts/ptrepack.py:49–71  ·  view source on GitHub ↗

Re-create indexes.

(table, dstfileh, dsttable)

Source from the content-addressed store, hash-verified

47
48
49def recreate_indexes(table, dstfileh, dsttable):
50 """Re-create indexes."""
51 listoldindexes = table._listoldindexes
52 if listoldindexes != []:
53 if not regoldindexes:
54 if verbose:
55 print(
56 f"[I]Not regenerating indexes for table: "
57 f"'{dstfileh.filename}:{dsttable._v_pathname}'"
58 )
59 return
60 # Now, recreate the indexed columns
61 if verbose:
62 print(
63 f"[I]Regenerating indexes for table: "
64 f"'{dstfileh.filename}:{dsttable._v_pathname}'"
65 )
66 for colname in listoldindexes:
67 if verbose:
68 print("[I]Indexing column: '%s'. Please wait..." % colname)
69 colobj = dsttable.cols._f_col(colname)
70 # We don't specify the filters for the indexes
71 colobj.create_index(filters=None)
72
73
74def copy_leaf(

Callers 2

copy_leafFunction · 0.85
copy_childrenFunction · 0.85

Calls 2

_f_colMethod · 0.80
create_indexMethod · 0.80

Tested by

no test coverage detected