[PATCH 0/4] Add 'Event.payload' field
Daniel Axtens
dja at axtens.net
Wed Mar 28 10:02:23 AEDT 2018
Stephen Finucane <stephen at that.guru> writes:
Hi Stephen,
> The '/event' API endpoint is really slow due to the amount of JOINs
> necessary to retrieve records from the database. Resolve this by
> a static JSON representation of any embedded data in the database. This
> has some disadvantages, noted in the patches, but the performance
> improvement is huge and users will not notice a thing.
>
> As a necessary side-effect of this change, events now require the REST
> API be enabled. To be honest, this should have been the case from day 1
> as events are currently only exposed over this API.
How does perfomance of this compare to
https://patchwork.ozlabs.org/project/patchwork/list/?series=35029 ?
This is a much bigger change than that series, so if the performance
impact is similar perhaps the smaller, migration-free change would be
preferable?
Regards,
Daniel
>
> Stephen Finucane (4):
> REST: Support embedded serializers without context
> signals: Only enable events when REST API enabled
> models: Migrate event fields to JSON field
> REST: Only fetch required fields event filtering
>
> patchwork/api/embedded.py | 60 ++++++++---
> patchwork/api/event.py | 110 +++++++++++++--------
> patchwork/api/filters.py | 7 ++
> patchwork/fields.py | 32 ++++++
> .../migrations/0025_add_event_payload_field.py | 21 ++++
> ...26_migrate_data_from_event_fields_to_payload.py | 63 ++++++++++++
> .../migrations/0027_remove_old_event_fields.py | 34 +++++++
> patchwork/models.py | 28 +-----
> patchwork/signals.py | 70 +++++++++++--
> patchwork/tests/test_events.py | 110 +++++++++++++--------
> .../events-require-rest-api-47eab4a3be745f75.yaml | 5 +
> 11 files changed, 413 insertions(+), 127 deletions(-)
> create mode 100644 patchwork/migrations/0025_add_event_payload_field.py
> create mode 100644 patchwork/migrations/0026_migrate_data_from_event_fields_to_payload.py
> create mode 100644 patchwork/migrations/0027_remove_old_event_fields.py
> create mode 100644 releasenotes/notes/events-require-rest-api-47eab4a3be745f75.yaml
>
> --
> 2.14.3
>
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork
More information about the Patchwork
mailing list