library(pool)
library(dbplyr)
library(DBI)
library(tidyverse)
local_pool <- pool::dbPool(odbc::odbc(), dsn = "my_dsn", PWD = "my_psw")
my_db_tbl <- tbl(local_pool, in_schema('"my_schema"', "my_table_in_oracle"))
my_db_tbl %>% tally() #200000 (and super fast)
my_db_tbl %>% head(100) #again super fast
在oracle中运行的所有内容都是computations
等,对于超过5-million
行来说超级快...
但是,如果我想将这200,000行带到R中以使用parsnip
等进行建模,则需要花一些时间(一个小时以上)。
我还有另一个只有61,000行的表,这花了半个多小时才恢复到R。
我在做什么错?如何加快速度?