Skip to content

Actually bulk load documents in one query in bulkLoad - #1124

Merged
olovy merged 3 commits into
developfrom
feature/bulk-load
Jun 8, 2022
Merged

Actually bulk load documents in one query in bulkLoad#1124
olovy merged 3 commits into
developfrom
feature/bulk-load

Conversation

@olovy

@olovy olovy commented Jun 7, 2022

Copy link
Copy Markdown
Contributor
  • Use whelk.bulkLoad when loading data for Normalizers
  • Actually bulk load documents in one query in bulkLoad

This cuts the normalizer initialization part of of Whelk startup from ~20 to ~2 seconds when connecting to e.g. QA database from my laptop over VPN.

@olovy
olovy requested review from andersju, lrosenstrom and niklasl June 7, 2022 15:36
return (o instanceof List) ? (List) o : o != null ? [o] : []
}

static boolean looksLikeIri(String s) {

@olovy olovy Jun 8, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #1009

Comment thread whelk-core/src/main/groovy/whelk/Whelk.groovy
@olovy
olovy force-pushed the feature/bulk-load branch from ec7f4be to b5e8477 Compare June 8, 2022 08:36

@andersju andersju left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM!

@olovy

olovy commented Jun 8, 2022

Copy link
Copy Markdown
Contributor Author

In theory this could starve the connection pool since the connection is held for one larger query. We have a limit of 100 docs in place in reindex so it should be fine.

Fix this when we split the connection pool in two for fast and slow transactions.

@olovy
olovy merged commit ecaae76 into develop Jun 8, 2022
@olovy
olovy deleted the feature/bulk-load branch June 8, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants