add indexes, trigger