Skip to content

Use read-only adapter method instead of read-write one (performance optimization) #2609

@eecavanna

Description

@eecavanna

When I wrote migrator migrator_from_11_9_1_to_11_10_0_part_3, I accidentally used an unnecessarily powerful adapter method, process_each_document. This adapter method performs a "write" of each resulting document to the database. The migrator's run duration could be reduced by switching to a less powerful adapter method, do_for_each_document, which does not perform that "write".

self.adapter.process_each_document(
"data_generation_set", [self.confirm_specific_fields_are_absent]
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions