Comments (4)
Added an analysis of the reading behavior to https://github.com/krlmlr/duckdb-mem. Indeed, it seems that reading also consumes at least twice the size of the data read, which is surprising. We'll need to trace memory allocations to understand what's going on here. This is likely an issue in the glue, whereas the dbWriteTable()
problems likely originate in the C++ core.
from duckdb-r.
I have started to investigate memory consumption with dbWriteTable()
in https://github.com/krlmlr/duckdb-mem. The script https://github.com/krlmlr/duckdb-mem/blob/main/setup-manual-limited.R shows how the memory consumption is not enforced with a CREATE TABLE ... FROM ...
statement. The only difference to the setup-register.R
script in the same repository is that CREATE TABLE
statement. @Tmonster: can you please take a look?
I'll also review memory usage for reading the table, might reorganize that repository a bit.
from duckdb-r.
Thanks for looking into this. I looked at the https://github.com/krlmlr/duckdb-mem, repo and I didnt see a reading scenario that includes the to_arrow() function like in that comment.
I was under the impression that it only requires 16GB for reading the 16GB file instead of 32GB. TIL in your repo that you can use "/usr/bin/time" to know how much memory a process used at its peak so I'll go check if my to_arrow() solution actually works.
bigdata <- tbl(con, "straight_from_memory") %>% collect() # 32 GB peak
bigdata <- tbl(con, "straight_from_memory") %>% to_arrow() %>% collect() # 16 GB peak
from duckdb-r.
Thanks, added Arrow. The usage is still 2x the data size, unfortunately.
from duckdb-r.
Related Issues (20)
- Segfault when creating persistent database HOT 4
- Feature request: Support for clock::add_days and clock::add_years HOT 3
- Interop with spatial extension HOT 2
- Request for duckdb_read_csv2 function and clarification on data types in duckdb_read_csv HOT 4
- Failing to connect in v0.10 with dbdir HOT 4
- Do not use RE2 on CRAN HOT 4
- Reuse database object HOT 2
- Deprecate `dbConnect(dbdir, config, read_only)`
- Reenable RE2 checks on CRAN
- Cannot read CSV or Parquet with dplyr::tbl HOT 7
- Error Writing Encrypted Parquet Files on Windows HOT 2
- duckdb fails filtering OSM files due to `Unknown column type for prepare: MAP(VARCHAR, VARCHAR)` error HOT 9
- Error: rapi_prepare: Unknown column type for prepare: MAP(BLOB, BLOB) when using parquet_metadata with dbGetQuery HOT 2
- Execute queries without registering Data Frames / Arrow Tables HOT 5
- Undefined behavior with list columns HOT 10
- add `temporary` parameter to `duckdb_read_csv()` HOT 2
- `round()` semantics of R-version differs from its duckdb-translation HOT 1
- Use proper std::isnan in C++ code, not C99 versions which may not compile HOT 2
- Error: String contains null byte
- `NULL` mapped to `NA_integer_` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duckdb-r.