optimize getTopicsByTids and getTeasers