Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Even though in a single view, the listing will only list down limited number of records (e.g. 10 per page), which should normally take less than a second to load, it will be heavily compounded by the count query earlier that may take more than 1 minute to finally load.

If the database server has stellar buffer or caching size/capabilties, then subsequent viewing of each pages will not be penalized by the expensive count query.

Conclusion

Only use a derived query when it is absolutely necessary. Try to have the data set computed elsewhere or beforehand when possible.