mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-28 22:09:44 -05:00
Add additional relationships to exclude in the ServiceSchema metaclass. Marshmallow by default lazily loads relationships when dumping, so any relationships we know we won't need, we can exclude and avoid a DB call. Lots of tables are linked to services, so it loads a lot of tables. So don't load statistics tables, since they're clearly not needed. We *do* however want to return the users for the service - they're used in a few places. If we're returning all services, then we don't want to make separate queries for these users, so we modify the services_dao queries to load users the first time round. This should speed up all GET queries to the services endpoints, most notably pages that get many services (platform_admin, choose service, login)