use indexes and queries