Skip to content

Performance

Thomas Pollet edited this page Aug 1, 2020 · 2 revisions

Request Performance depends mainly on the database model performance. Querying simple models is quite fast (<10ms). However, you may incur a performance hit fetching collections and relationships, depending on your database configuration. If you are worried about performance, you should take good care fine-tuning your database and SQLAlchemy model queries and maybe use caching where appropriate.

Table count

A database table count() is executed when retrieving a collection. For very large tables this may become slow. The count() can be avoided by overriding the SAFRSBase._s_count property. When this property has been defined, the value returned by s_count will be returned in the collection json meta section.

Relationships