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

Speed up creation of db #32

Closed
ateucher opened this issue Jan 9, 2019 · 6 comments
Closed

Speed up creation of db #32

ateucher opened this issue Jan 9, 2019 · 6 comments

Comments

@ateucher
Copy link
Contributor

ateucher commented Jan 9, 2019

Add an autoincrementing Primary Key.

Possibly try something like:

dbExecute(conn, 
"CREATE TABLE foo(
  id INTEGER PRIMARY KEY,
  a REAL,
  b TEXT);")

dbAppendTable(conn, "foo", data.frame(a = rnorm(5), b = letters[1:5]), row.names = NULL)

dbGetQuery(conn, "SELECT * from foo;")

Also, dbWriteTable has a mechanism to write from a file - worth investigating

@ateucher
Copy link
Contributor Author

ateucher commented Jan 9, 2019

Regarding importing directly from file... see here for why it won't work (at least for now)

@ateucher
Copy link
Contributor Author

ateucher commented Jan 9, 2019

Could try depending on arkdb:

unark("ems.csv", db_con = conn, streamable_readr_csv(), tablenames = "test_arkdb", 
      col_types = col_spec(), locale = readr::locale(tz = ems_tz()))

@ateucher
Copy link
Contributor Author

Another option is MonetDB-Lite - should be a drop-in replacement for SQLite, should be faster, and importing directly from csv should work.

@ateucher
Copy link
Contributor Author

ateucher commented Mar 1, 2019

@ateucher
Copy link
Contributor Author

ateucher commented May 6, 2019

Possibly use vroom package to replace readr

@ateucher
Copy link
Contributor Author

Made mostly unecessary by #37

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

1 participant