add script for indexing tables