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

Mysql data can be 10x faster #48

Open
cscortes opened this issue Jun 28, 2018 · 1 comment
Open

Mysql data can be 10x faster #48

cscortes opened this issue Jun 28, 2018 · 1 comment

Comments

@cscortes
Copy link

Hi, love this database, but I noticed that it was taking way too long to load the data in mysql.
I know that an external fix would be to set autocommit = 0, but most people aren't thinking about this when then just try to import the database. A transparent fix is to place the sql in sql-fundamentals/sql/northwind_data.sql in a transaction like so:

START TRANSACTION;
...
All the insert statements ....
...
COMMIT;

That caused that all of the 600 000 statements in the data file to import in a minute or 2.

@nikhilkuyya
Copy link

nikhilkuyya commented Oct 8, 2018

can i know how long it was taking to get data form sql file.
I was running by command in npm run db:setup:mysql and db:setup:pg, both are taking to long on importing data for me.

[edit]
I am able to run postgres database; after looking into it. but i have kept sudo -u postgres before the script.
https://gist.github.com/nikhilkuyya/31e0c7b7e7d2c51ccc9cea81d984f298.
cannot explain why i did it . but my understanding is that postgres is normal user get assigned when installing postgres. so taught that scripts need authentication.

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

No branches or pull requests

2 participants