jeudi 26 février 2015

Very slow performance on mongodb find

I'm new with nodejs and mongodb. To test it out I captured 2.500.000 tweets from the #oscars. Now i'm playing a bit with the data, but find queries like the one below are extremely slow... (up to 40 seconds) (I'm doing the queries directly on console)



db.oscars.find({user.screen_name: "monxas"})


Am I doing something wrong? Is there anyway to speed up this queries?


tweets have this structure, if that helps:



{
"_id" : ObjectId("54ea1f0f5fbae7a02067024b"),
"created_at" : "Sun Feb 22 18:25:20 +0000 2015",
"id" : 5.6956360590721434E+17,
"id_str" : "569563605907214338",
"text" : "#Oscars2015 Who will win tonight? All hopes are on you guys.",
"source" : "<a href=\"http://ift.tt/tc51Su\" rel=\"nofollow\">Twitter for iPad</a>",
"truncated" : false,
"in_reply_to_status_id" : null,
"in_reply_to_status_id_str" : null,
"in_reply_to_user_id" : null,
"in_reply_to_user_id_str" : null,
"in_reply_to_screen_name" : null,
"user" : {
"id" : 2596742425.0,
"id_str" : "2596742425",
"name" : "jclivesforever26",
"screen_name" : "jacuasay092600",
"location" : "",
"url" : null,
"description" : "Da Bulls!!! Ed Sheeran is life!!!",
"protected" : false,
"verified" : false,
"followers_count" : 21,
"friends_count" : 183,
"listed_count" : 0,
"favourites_count" : 78,
"statuses_count" : 283,
"created_at" : "Mon Jun 30 18:13:13 +0000 2014",
"utc_offset" : null,
"time_zone" : null,
"geo_enabled" : true,
"lang" : "en",
"contributors_enabled" : false,
"is_translator" : false,
"profile_background_color" : "C0DEED",
"profile_background_image_url" : "http://ift.tt/1eDsrLj",
"profile_background_image_url_https" : "http://ift.tt/1dEhDZS",
"profile_background_tile" : false,
"profile_link_color" : "0084B4",
"profile_sidebar_border_color" : "C0DEED",
"profile_sidebar_fill_color" : "DDEEF6",
"profile_text_color" : "333333",
"profile_use_background_image" : true,
"profile_image_url" : "http://ift.tt/1JuKjqp",
"profile_image_url_https" : "http://ift.tt/1MULMJi",
"profile_banner_url" : "http://ift.tt/1Abe5cd",
"default_profile" : true,
"default_profile_image" : false,
"following" : null,
"follow_request_sent" : null,
"notifications" : null
},
"geo" : null,
"coordinates" : null,
"place" : null,
"contributors" : null,
"retweet_count" : 0,
"favorite_count" : 0,
"entities" : {
"hashtags" : [{
"text" : "Oscars2015",
"indices" : [0, 11]
}],
"trends" : [],
"urls" : [],
"user_mentions" : [],
"symbols" : []
},
"favorited" : false,
"retweeted" : false,
"possibly_sensitive" : false,
"filter_level" : "low",
"lang" : "en",
"timestamp_ms" : "1424629520285"
}

Aucun commentaire:

Enregistrer un commentaire