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

Function col_full

tables/idxutils.py:267–287  ·  view source on GitHub ↗

Compute the optimizations to be done for full indexes.

(nblocks: int, optlevel: int)

Source from the content-addressed store, hash-verified

265
266
267def col_full(nblocks: int, optlevel: int) -> tuple[bool, bool, bool, bool]:
268 """Compute the optimizations to be done for full indexes."""
269 optmedian, optstarts, optstops, optfull = (False,) * 4
270
271 # Full case
272 if nblocks <= 1:
273 if 0 < optlevel <= 3:
274 optmedian = True
275 elif 3 < optlevel <= 6:
276 optmedian, optstarts = (True, True)
277 elif 6 < optlevel <= 9:
278 optfull = 1
279 else: # More than a block
280 if 0 < optlevel <= 3:
281 optfull = 1
282 elif 3 < optlevel <= 6:
283 optfull = 2
284 elif 6 < optlevel <= 9:
285 optfull = 3
286
287 return optmedian, optstarts, optstops, optfull
288
289
290def get_reduction_level(

Callers 1

calcoptlevelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected