{"action":"created","issue":{"url":"https://api.github.com/repos/rstats-db/RMySQL/issues/71","labels_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/71/comments","events_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/71/events","html_url":"https://github.com/rstats-db/RMySQL/issues/71","id":82680501,"number":71,"title":"LOAD DATA LOCAL INFILE vs INSERT INTO","user":{"login":"szilard","id":844827,"avatar_url":"https://avatars.githubusercontent.com/u/844827?v=3","gravatar_id":"","url":"https://api.github.com/users/szilard","html_url":"https://github.com/szilard","followers_url":"https://api.github.com/users/szilard/followers","following_url":"https://api.github.com/users/szilard/following{/other_user}","gists_url":"https://api.github.com/users/szilard/gists{/gist_id}","starred_url":"https://api.github.com/users/szilard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szilard/subscriptions","organizations_url":"https://api.github.com/users/szilard/orgs","repos_url":"https://api.github.com/users/szilard/repos","events_url":"https://api.github.com/users/szilard/events{/privacy}","received_events_url":"https://api.github.com/users/szilard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-30T03:22:09Z","updated_at":"2015-06-01T20:28:27Z","closed_at":null,"body":"For dbWriteTable:\r\n- Latest CRAN version (0.10.3) uses LOAD DATA LOCAL INFILE https://github.com/rstats-db/RMySQL/blob/april/R/table.R#L139\r\n- Latest dev uses INSERT INTO https://github.com/rstats-db/RMySQL/blob/master/R/table.R#L105\r\n\r\nMost analytical/columnar/MPP databases (e.g. MySQL-based Infobright) strongly prefer \"bulk loads\", but my guess is that standard MySQL is faster with LOAD than with INSERT as well http://dev.mysql.com/doc/refman/5.0/en/insert-speed.html\r\n\r\nAlso, the latest dev uses one INSERT per row rather then \"bulk insert\" (not to be confused with \"bulk load\") http://stackoverflow.com/questions/7977172/mysql-multiple-insert-performance Looping 1 row at a time is probably the slowest solution.\r\n\r\nAny comments @jeroenooms @hadley on why LOAD was changed to INSERT?\r\n\r\nPS: The way I found this is that the latest CRAN 0.10.3 does not work with Infobright (call it a \"bug\") as Infobright has different FIELDS TERMINATED BY defaults. Adding `FIELDS TERMINATED BY '\\t'` here https://github.com/rstats-db/RMySQL/blob/april/R/table.R#L141 would fix the issue on 0.10.3, but that's moot in dev (as LOAD was changed to INSERT).\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rstats-db/RMySQL/issues/comments/107697017","html_url":"https://github.com/rstats-db/RMySQL/issues/71#issuecomment-107697017","issue_url":"https://api.github.com/repos/rstats-db/RMySQL/issues/71","id":107697017,"user":{"login":"jeroenooms","id":216319,"avatar_url":"https://avatars.githubusercontent.com/u/216319?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroenooms","html_url":"https://github.com/jeroenooms","followers_url":"https://api.github.com/users/jeroenooms/followers","following_url":"https://api.github.com/users/jeroenooms/following{/other_user}","gists_url":"https://api.github.com/users/jeroenooms/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroenooms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroenooms/subscriptions","organizations_url":"https://api.github.com/users/jeroenooms/orgs","repos_url":"https://api.github.com/users/jeroenooms/repos","events_url":"https://api.github.com/users/jeroenooms/events{/privacy}","received_events_url":"https://api.github.com/users/jeroenooms/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T20:28:27Z","updated_at":"2015-06-01T20:28:27Z","body":"Ok merged. FYI I renamed the `april` branch to `stable`."}}