Add support for optimizing an index.