limit query execution time to 20s
load feeds only when needed
flush the session for large inserts
throw an exception if there are no items in the feed