mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
bd93bf0dea
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 |
||
---|---|---|
.. | ||
admin-build | ||
config | ||
csv | ||
data | ||
email-service | ||
export | ||
filter-param | ||
images | ||
import | ||
media | ||
settings | ||
themes | ||
urls | ||
cache-rules.js | ||
context.js | ||
data-generator.js | ||
default-settings-browser.json | ||
default-settings.json | ||
fixtures.json | ||
test.hbs |