odbc icon indicating copy to clipboard operation
odbc copied to clipboard

Limit on query for previewing large tables

Open MariaSemple opened this issue 3 years ago • 0 comments

Issue Description and Expected Result

When calling previewObject even with a small row limit such as 50, it still takes a long time for the query to return when the table in question is quite large. This can cause an RStudio Session to hang while the query is being performed.

Ideally, if we limit the number of rows in the preview, we could query only that many rows to avoid the hang in the IDE. A LIMIT or a TOP statement here would fit that need, but that may not be possible due to database language support differences.

Database

I'm unsure if this is specific to one database or another, but we have a reproducible example on the IDE team, so I will get the information about that table and its Database and update it here (it has something like 30000 rows).

Reproducible Example

Specific details about loading the database to come.

  1. In an RStudio Session, navigate through the Connections pane until you find a large table.
  2. Preview the table by clicking on it.
  3. Even though the preview is limited to 1000 rows, it takes quite some time for the query to return. Restricting the limit to 50 has no impact on performance.
Session Info
devtools::session_info()
#> output

MariaSemple avatar Aug 05 '22 02:08 MariaSemple