Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feature: support bulk insert to speed insert times #181

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alexisvisco
Copy link

@alexisvisco alexisvisco commented Dec 7, 2023

Description

Overview

This pull request introduces a new feature to the fixture library, enabling bulk inserts for fixture files. Prior to this enhancement, inserts were performed sequentially, leading to potential performance bottlenecks, especially with large datasets. The new functionality allows users to opt for bulk inserts, significantly improving the efficiency of the fixture loading process.

Changes Made

Added a functional option parameter UseBulkInsert() to allow bulk inserting for fixture files.

Modified the implementation to group records with exactly same columns together for efficient bulk inserts when this parameter is set to true.

Also add a free new STRING= like RAW= because I was in trouble this last days due to time conversion for string ids... So with this new "annotation" it solve the problem.

Benefits

Improved performance by enabling bulk inserts.

Maintained flexibility by allowing users to choose between sequential and bulk inserts using the UseBulkInsert() functional option (mostely because I write this for postgres in the first place and I don't know if it works for other databse right now)

Feedback and suggestions for further improvements are welcome!


Not tested right now but this is coming.

@andreynering
Copy link
Contributor

Hi @alexisvisco, thanks for opening the PR!

The change looks promising, indeed. Performance gains are certainly welcome!

I agree to make this a setting so it's not enabled by default.

To make this complete, I'd be awesome to have tests for each database system where it's possible to have bulk loading working. Also, updating the README to contain the new setting would be nice.

@alexisvisco
Copy link
Author

Hi @alexisvisco, thanks for opening the PR!

The change looks promising, indeed. Performance gains are certainly welcome!

I agree to make this a setting so it's not enabled by default.

To make this complete, I'd be awesome to have tests for each database system where it's possible to have bulk loading working. Also, updating the README to contain the new setting would be nice.

Yep sure, I was just doubting somebody is anwsering to me so I just fork it, we use my fork to test our application at my company since december.

I would add tests indeed ! :)

@slsyy
Copy link
Contributor

slsyy commented Aug 3, 2024

@alexisvisco do you work on this PR anymore?

@alexisvisco
Copy link
Author

@alexisvisco do you work on this PR anymore?

Hey ! I do not have time to work on this in the future weeks, but eventually you can add tests, if you have any questions I can reply to you.

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.

3 participants