Skip to content

Remove post-create reload for key construction, reducing create-time queries

Choose a tag to compare

released this 19 Dec 13:36
· 12 commits to working since this release

This patch release focuses on simplifying the create operation and cutting unnecessary database work. The create flow no longer re-queries the database to reload a newly created record with nested associations solely for building hierarchical keys. The result is fewer queries during create and a simpler control flow in src/ops/create.ts.

New and Improved

  • Create flow no longer reloads the record to build hierarchical keys (b1732e8):
    • Removed the logic that built nested includes (includesForKey/currentInclude) and called model.findByPk(createdRecord.get('id'), { include }).
    • processRow is now invoked directly with the Sequelize instance returned by model.create, eliminating the extra post-create query.
    • queryMetrics no longer records the additional reload query in this path, so metrics and DB load better reflect the actual create operation.
    • Practical impact: key/event processing operates on the original created record. This reduces latency and removes complexity tied to constructing relationship includes from kta for key assembly.

Internal/Cleanup

  • Minor formatting tidy-up in src/ops/create.ts (b1732e8): removed redundant blank lines around event/ref/agg handling and error blocks, with no behavioral change.

Dependency Updates

  • Bumped @fjell/lib to ^4.4.83 in package.json (12da067). This is a patch-level update within the existing caret range; no application code changes were required here.

Release

  • Marked 4.4.82 as a stable release (42950c0). The package.json version is finalized for publish.

Notes

  • No breaking changes are introduced. The create operation performs fewer queries by avoiding a reload for key construction, which should be observable in both performance and query metrics.