Added indexing to a few tables decrease query time.