SQL novice here. In the Hello World section of the RMySQL github page, there is the following -
# You can fetch all results:
res <- dbSendQuery(con, "SELECT * FROM mtcars WHERE cyl = 4")
dbFetch(res)
dbClearResult(res)
I don't understand the purpose of dbClearResult()
. This is important to me because I'm working with a few large tables and dbClearResult(rs)
can be very slow at times (taking minutes to complete). However, if I go into the mysql shell I can simply kill a query instantaneously.
So, what is the purpose of dbClearResult()
and is there any way to avoid it or speed it up?