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

Bulk insertion speed #22

Open
nmoreaud opened this issue Jan 26, 2022 · 0 comments
Open

Bulk insertion speed #22

nmoreaud opened this issue Jan 26, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@nmoreaud
Copy link

nmoreaud commented Jan 26, 2022

Hello

With this code I can insert 900 rows/sec with a SSD.
On a network folder it inserts 200 rows/sec.

for i in range(50000):
    data = (str(i), str(i) + '.jpeg', 'Lorem ipsum dolor sit amet', '{GCF2807B-E86B-CAC7-5F21-4B18C46ADDD0}', '441000', '4637070', '5', '600', '600', '791', '6', '41', '27', '0', '0', '0', '1.5', '1753322669', '0', '440998', '443998', '4634072', '4637072', '440998', '443998', '4634072', '4637072', 0, 1)
    mydbf.append(data) # write line per line

This doesn't seem faster :

metadata.append(multiple=50000) # 7s
i = 0
for rec in dbf.Process(metadata):
    data = (str(i), str(i) + '.jpeg', 'Lorem ipsum dolor sit amet', '{GCF2807B-E86B-CAC7-5F21-4B18C46ADDD0}', '441000', '4637070', '5', '600', '600', '791', '6', '41', '27', '0', '0', '0', '1.5', '1753322669', '0', '440998', '443998', '4634072', '4637072', '440998', '443998', '4634072', '4637072', 0, 1)
    rec[:] = data
    i += 1

Is there any sub-second bulk insert method?

@ethanfurman ethanfurman added the enhancement New feature or request label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants