query optimization for words list and show page