updated scripts to create index for analytics tables