Batch-fetch field definitions in set_object_fields (avoid N+1) for bulk import #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
catalog::set_object_fields(crates/db/src/catalog.rs) validates field-by-field: onefields::field_definition_by_keyquery per key, plus oneresolve_term/resolve_authorityper term/authority key — an N+1 over the desired map.Fine at single-object catalogue-entry scale. If/when bulk import lands (CSV/Excel → many objects), batch-fetch the relevant field definitions (and resolve references in bulk) once per import rather than per-field-per-object.
Source: Plan 5 (object flexible fields) final review — forward-looking, not relevant at current scale.