0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core
Daniel Lockyer 94f5add1c0 Refactored default settings population to reduce unnecessary DB queries
refs https://github.com/TryGhost/Toolbox/issues/202

- this code suffers from two problems:
  - when we don't have any new settings to insert, we still end up
    fetching the columnInfo and owner info, even though we only need
    them if we're inserting data. This results in 3 extra queries upon
    boot
  - secondly, we insert every setting with a separate query - MySQL and
    SQLite both support batch inserts and knex has a utility to help us
    that I've [used
    before](38821c5242).
    With 95 settings at the time of writing, this adds 94 extra queries
    during the DB init
- this commit refactors the code so that we only fetch the columnInfo and
  owner data if we've got new settings to insert, and batches the
  inserts using knex's batchInsert util
- this query results in ~95 less queries during DB init and saves a
  couple of queries during boot
2022-02-08 10:11:00 +01:00
..
client@7231f031e5 Updated Admin to v4.35.0 2022-02-04 16:00:26 +00:00
frontend 🐛 Fixed AssetHelper not working with svg (#13978) 2022-02-07 15:07:18 +00:00
server Refactored default settings population to reduce unnecessary DB queries 2022-02-08 10:11:00 +01:00
shared Merged v4.34.1 into main 2022-02-01 08:58:24 +00:00
app.js Fixed express app stacking 2021-12-06 21:28:53 +13:00
boot.js Added library for extracting database information 2022-01-18 09:31:08 +00:00
bridge.js Added missing async/await calls 2021-11-23 17:24:50 +00:00