Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbReadTableArrow is much slower than dbReadTable #884

Open
avhz opened this issue Jan 21, 2025 · 2 comments
Open

dbReadTableArrow is much slower than dbReadTable #884

avhz opened this issue Jan 21, 2025 · 2 comments

Comments

@avhz
Copy link

avhz commented Jan 21, 2025

Using dbReadTableArrow seems to be much slower than the standard dbReadTable.

table <- DBI::Id(schema = "...", table = "...")

conn <- odbc::dbConnect(
    drv = odbc::odbc(),
    .connection_string = "..."
)

system.time(DBI::dbReadTableArrow(conn, table))
system.time(DBI::dbReadTable(conn, table))
> system.time(DBI::dbReadTableArrow(conn, table))
   user  system elapsed 
  1.623   0.020   1.757 

> system.time(DBI::dbReadTable(conn, table))
   user  system elapsed 
  0.706   0.005   0.727 

Note: this is from a SAP HANA database, connected via their odbc driver libodbcHDB.so.

@krlmlr krlmlr transferred this issue from r-dbi/DBI Jan 21, 2025
@krlmlr
Copy link
Member

krlmlr commented Jan 21, 2025

Thanks. This is expected, until the odbc package implements this. The fallback is to use dbSendQuery() and to convert the resulting data frame chunks to Arrow.

You can still use this interface today to take advantage of free performance improvements once this is implemented, if you want to consume the data in Arrow format.

@avhz
Copy link
Author

avhz commented Jan 21, 2025

Ah thanks for the speedy response :)
Is there a timeline for this ?

Edit: I need the data in tibble format, so will cast from Arrow to tibble anyway, I would just like the fetches themselves to be faster. This would be the case once odbc implements it right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants