« R and Linear Algebra | Main | Because it's Friday: Math experts split the check »

August 30, 2013

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

*parallelization

@mike, thanks, corrected above

I found doSNOW very useful as a way to send multiple SQL queries with minor changes (date ranges, cohort definitions, etc) to a database simultaneously.

library(doSNOW)
cl <- makeCluster(c("localhost","localhost"), type = "SOCK")
registerDoSNOW(cl)

i = list(TYdates,LYdates)

result <- foreach(j = 1:2, .packages="RODBC")%dopar%{
ch=odbcConnect("data warehouse")
sqlQuery(ch, paste('Your SQL here', i[j]))
}

Instead of writing a script that runs everything in series.

The comments to this entry are closed.

Search Revolutions Blog




Got comments or suggestions for the blog editor?
Email David Smith.
Follow revodavid on Twitter Follow David on Twitter: @revodavid
Get this blog via email with Blogtrottr