create index and persistence