This has nothing to do with indexes and so it does not belong in this checkIndexes function. Put it back where it was or give it its own (static?) "partitionMaterializedView" function.