Comments (3)
I have some concerns as to how having the indexes and keys present in the database before the import affects the speed of the import.
In most databases it tends to be slower, even in bulk load, because:
- every row has to be PK-checked, FK-checked, before insert; failure of a FK check would result in the entire import failing;
- having the FKs in place means that the files need to be loaded in a precise order, with the files providing the FK first, and the files using the FK last;
- after every row or row-threshold insert the indexes may have to be rebuilt, slowing the whole process down (rebuilding at the end is a single table scan)
By contrast, the current solution leaves a DB full of data at the end of the csv import; optimization (PK, FK, indexes) is then left at the latitude of the users.
All that aside, could you try the following two scenarios and see if the outcome is acceptable?
In a script:
Scenario A
- Run CreateTables.sql
- Import csv
- Run the rest of the sql scripts
Scenario B
- Run all sql scripts
- Import csv
Run each script of the scripts above with the time
command and if the results from scenario B are positive and faster than A, I'd be happy to start looking into it.
from discogs-xml2db.
Hi, if you look at my scripts you'll see indexes etc are created AFTER the import. Im just suggesting the user should be able to run one command that creates db tables, import and then creates indexes, keys and constraints, rather than having to run 5 different commands.
from discogs-xml2db.
--- is then left at the latitude of the users.
There maybe cases where they want to change this, but for most I cannot see why they would not want to run add keys and indexes after the db import, otherwise the db will be almost unusable.
from discogs-xml2db.
Related Issues (20)
- get_latest_dumps.sh should checksum the downloaded files
- Allow specifying direct files rather than `--export` + input dir
- Investigate the opportunities of a .NET-based parser HOT 4
- ImportError: cannot import name zip_longest HOT 4
- Export artist groups
- Export sublabels
- C# csv files should not have BOM
- Use python virtual environment over sudo HOT 2
- run.py failing on parsing discogs_20200901_releases.xml.gz, maybe an error in xmlfile HOT 3
- get_latest_dumps should checksum the downloads HOT 1
- When I run postgresql/sql/CreateFKConstraints.sql some fail because of problems with data HOT 5
- Hexadecimal issue with experimental C Parser HOT 2
- Type in postgressql/sq/CreateTables.sql HOT 2
- Change CSV delimiter and quotes HOT 1
- Issues while importing the November 2020 dump to PostgreSQL HOT 4
- C# exports gz, neither of which are compatible with mysql importer HOT 1
- release_artist missing data for tracks column HOT 1
- get_latest_dumps.sh broken by URL changes
- Incorrect progress bar percentage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discogs-xml2db.