Compute the optimizations to be done for full indexes.
(nblocks: int, optlevel: int)
| 265 | |
| 266 | |
| 267 | def 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 | |
| 290 | def get_reduction_level( |