Skip to content

Set multiple unique features in one SQL query for feature extractors#39

Closed
chrjabs wants to merge 2 commits into
Udopia:mainfrom
chrjabs:mse-26
Closed

Set multiple unique features in one SQL query for feature extractors#39
chrjabs wants to merge 2 commits into
Udopia:mainfrom
chrjabs:mse-26

Conversation

@chrjabs

@chrjabs chrjabs commented May 11, 2026

Copy link
Copy Markdown
Contributor

I noticed that running the wcnfbase feature extractor took a long time even after the features had already been extracted for all instances. Turns out writing the features one by one into the database is really inefficient.
With this PR the set_values methods of Database and Schema now take dicts of multiple values and write as much as possible in one SQL query. I'm not sure I fully understand the schema for non-unique features, so I tried to not modify the logic there.

This made a wcnfbase feature extraction run for me go from ~20 minutes to 40 seconds.

Udopia pushed a commit that referenced this pull request Jul 14, 2026
…d lots of manual adaptions after the latest version bump)
@Udopia Udopia closed this Jul 14, 2026
Udopia pushed a commit that referenced this pull request Jul 14, 2026
Ports the batched multi-value write path contributed by Christoph Jabs
(@chrjabs, #39) to the current schema. Adapted to the Polars-based query
interface and the config-driven registry introduced in 5.1.0: unique
features are written in a single INSERT ... ON CONFLICT statement, while
non-unique features are written individually. This cuts bulk-write time
from roughly 20 min to 40 s on large batches.

Co-authored-by: Christoph Jabs <christoph.jabs@helsinki.fi>
@chrjabs
chrjabs deleted the mse-26 branch July 27, 2026 07:36
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