Rmongodb is very slow to create data.frame

I am using MongoDB to track parsing data in R. I originally used MySQL which worked fine, but I wanted to test MongoDB for this purpose. The dataset contains about 200 million records so far. Using RODBC I can quickly get the query result in data.frame usingsqlQuery(conn, "select * from td where prd = 'TY' and date = '2012-01-03'")

In MongoDB, I have documents like Document{{_id=5537ca647a3ad42a84374f0a, prd=TY, time=1325661600043, px=130.6875, sz=11}}

In Java, I can get data on the number of ticks per day - about 100,000 entries, create Tick objects and add them to an array, in just 2 seconds.

Using rmongodb takes the bottom value forever. Any ideas how to improve this?

query <- mongo.bson.from.list( list(product = "TY", date = as.POSIXct("2012-01-04")) )
res.cursor <- mongo.find(mongo, db.coll, query, limit = 100e3, options=mongo.find.exhaust)
resdf <- mongo.cursor.to.data.frame(res.cursor)

      

Use is find.all

evenly slow.

+3
r mongodb rmongodb


source to share


No one has answered this question yet

Check out similar questions:

756
Remove lines with all or some neural networks (missing values) in data.frame
443
Create an empty data.frame file
ten
Unreasonably slow MongoDB query, although the query is simple and index-consistent
2
Group at rmongodb
1
Unable to query entire collection via sails (sails-mongo or mongodb-native)
1
How to query for date stored as text in bad date format in mongoDB
1
Slow aggregation pipeline with large collection
1
Mongo 3.2 Question about index of sub-documents
0
Mongo group command with missing keys
0
Slow index creation of four fields in MongoDB



All Articles
Loading...
X
Show
Funny
Dev
Pics