use mmap for mkindex as well; add dim and names