fedora-infra/datagrepper — pull request #125 by lmacken (2014-02-27 20:03:03+00:00)
Title: Optimize count_all_messages()

When counting the exact number of messages, `dm.Message.grep()[0]` is used to
get the total. Since no arguments are given, no filters are added to the
Message.query. However, with the default defer=True argument, the grep method
returns the total count, the number of pages, and `Message.query.all()`.
Thankfully, we can pass defer=True and it won't call all() on the query.

:warning: untested :construction: