Skip to content

WIP: PoC: bulk insert

Kamil Trzciński requested to merge kamil-poc-bulk-insert into master

What does this MR do?

Based on !22781 (merged). Closes #196166 (closed)

This "HACKS" to add a PoC of bulk insert:

  1. This runs as part of regular .save!,
  2. This gathers all objects for the given relation association and tries to save them in bulk (up-to 100),
  3. This follows all callbacks and validations,
  4. This is inefficient, as it runs very deep into stack trace, as we get another object to bulk insert (100) and try to save it,
  5. It is very HACKY,
  6. It does not work across different associations (relations assigned to different objects), as it only allows to bulk insert single relation.
  7. Maybe we could do something simpler: mark some relations as BulkInsert, disallow usage of Callbacks on them, and simply overwrite the behaviour how they are persisted: doing it less hacky than proposed? (Or maybe still use callbacks, and all, but ignore after save/create)??

This runs in-line while doing .save! and gathers all object

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports