mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 05:52:40 +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 |
||
---|---|---|
.. | ||
agents | ||
fixtures | ||
mocks | ||
admin-utils.js | ||
api.js | ||
assertions.js | ||
batch-email-utils.js | ||
configUtils.js | ||
db-utils.js | ||
e2e-framework-mock-manager.js | ||
e2e-framework.js | ||
e2e-utils.js | ||
fixture-utils.js | ||
index.js | ||
mocha-retry-reporter.js | ||
overrides.js | ||
redirects.js | ||
stripe-mocker.js | ||
url-service-utils.js | ||
urlUtils.js |