dbAppendTable() is very slow on a file. It is fast for the in-memory DB.
tab <- pkgcache::meta_cache_list()
## Remove the list columns
tab <- tab[, !sapply(tab, is.list)]
dim(tab)
#> [1] 35359 31
con <- DBI::dbConnect(RSQLite::SQLite(), tempfile(), create = TRUE)
system.time(DBI::dbWriteTable(con, "pkgs", tab))
#> user system elapsed
#> 0.162 0.043 0.211
dim(DBI::dbReadTable(con, "pkgs"))
#> [1] 35359 31
rm(con)
con2 <- DBI::dbConnect(RSQLite::SQLite(), tempfile(), create = TRUE)
DBI::dbCreateTable(con2, "pkgs", tab)
dim(DBI::dbReadTable(con2, "pkgs"))
#> [1] 0 31
system.time(DBI::dbAppendTable(con2, "pkgs", tab))
#> user system elapsed
#> 1.122 11.886 15.088
dim(DBI::dbReadTable(con2, "pkgs"))
#> [1] 35359 31
Created on 2019-12-23 by the reprex package (v0.3.0)
dbAppendTable()is very slow on a file. It is fast for the in-memory DB.Created on 2019-12-23 by the reprex package (v0.3.0)