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

Improve import best practices. #1699

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/guides/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,7 @@ There are some best practices to keep in mind in order to make importing externa
- Avoid adding foreign keys or unique indexes until after the import is completed. These substantially increase import time.
- Minimize your use of blob types. These are expensive to create.
- If running multiple import jobs back to back, be sure to [garbage collect](https://docs.dolthub.com/cli-reference/cli#dolt-gc) the database. Imports can generate a substantial amount of garbage.
- If you're writing your own `.sql` file instead of using `mysqldump`, consider the following:
- Import one table at a time.
- Prefer fewer INSERT statements that each insert multiple values over more, shorter statements that only insert a single value each.
- Sort your inserts by primary key. If a table doesn't have a primary key, consider adding one.