Ghost/ghost/core/test/e2e-api
Kevin Ansfield bd93bf0dea Optimised email stats aggregation query for typical column usage
ref https://linear.app/tryghost/issue/ENG-790/remove-use-of-sub-queries-in-email-analytics

- the `delivered_at` column is typically entirely/nearly entirely filled with values meaning the `IS NOT NULL` query matches a huge number of rows that MySQL has to fetch from the index to count
- using `IS NULL` switches that behaviour around as it will now match very few rows which has been shown in testing to be considerably quicker
- after switching to `IS NULL` the query returns an "undelivered" count rather than a "delivered" count, in order to keep the rest of the system behaviour the same we can calculate the delivered count by subtracting the query result from the total number of emails sent which we can fetch using a very fast primary key lookup query on the `emails` table
2024-04-03 16:27:23 +01:00
..
admin Optimised email stats aggregation query for typical column usage 2024-04-03 16:27:23 +01:00
content 🐛 Fixed unexpected conversion of single-quoted attributes in HTML cards (#19727) 2024-03-06 09:11:49 +00:00
members Cleaned up duplicate await 2023-12-13 11:54:31 +01:00
members-comments Added /comments/:id/replies/ to X-Cache-Invalidate 2024-02-28 23:15:02 +00:00
shared Added portal default plan setting (#19238) 2023-12-06 11:39:58 +01:00
webmentions Updated to use assert/strict everywhere (#17047) 2023-06-21 09:56:59 +01:00