From: marcandre <malegr...@gmail.com>
Date: Mon, 10 Sep 2012 08:48:11 -0700 (PDT)
Local: Mon, Sep 10 2012 11:48 am
Subject: Re: Very slow query
I get this reponse when I call var_dump($cursor->explain()); : array(15) { ["cursor"]=> string(11) "BasicCursor" ["isMultiKey"]=> I am limiting the find to avoid display every documents in the same page .
Le lundi 10 septembre 2012 17:31:40 UTC+2, Gianfranco a écrit :
> If you run explain() on the cursor you can see why is taking that long.
> var_dump($cursor->explain());
> Do that on one and see if it's using an index (BtreeCursor)
> Another problem could be that you are limiting the find() results to 30 > You can also try to increase the timeout of the cursor and try if that > On Monday, September 10, 2012 4:07:30 PM UTC+1, marcandre wrote:
>> I don't think that Postgres causes the bach being slow, because when I >> my reseach engin is very slow or ends with an error of timeout : *Fatal >> This my code for research douments :
>> $cnx_mongo = new Mongo("127.0.0.1", array("persist" => "x"));
>> $who = array();
>> $cursor = $ma_collection->find($who)->limit(30)->skip(($off_set - 1)*30);
>> $cursor->timeout(1000);
>> print($cursor->count());
>> foreach($cursor as $obj){
>> $id_prod = $obj["id_prod"];
>> $prix_max = $obj["prix_max"];
>> Le lundi 10 septembre 2012 16:42:35 UTC+2, Gianfranco a écrit :
>>> As you did correctly, if this is not a live production database, you >>> Is it possible, and i'm just wondering here, that PostgreSQL is one of >>> On Monday, September 10, 2012 1:50:17 PM UTC+1, marcandre wrote:
>>>> Good afternoon,
>>>> I'am using MongoDB with 350 000 documents and php. The problem is the >>>> When I'm updating documents I drop the database and I insert the >>>> I don't understand, I putted indexes .
>>>> I show you a piece of my php code when I updating documents : >>>> $cnx_mongo = new Mongo("127.0.0.1", array("persist" => "x"));
>>>> $db = $cnx_mongo->my_database;
>>>> $response = $ma_collection->drop();
>>>> $db = $cnx_mongo->my_database;
>>>> ///I Import data from a database Postgres >>>> ///I put index in a fiel named tags >>>> This is the code when php reads documents :
>>>> ///Research of documents who containts key words
>>>> //Get back keywords researching by tags fields
>>>> $who['tags'] = array('$all' => $tmp); >>>> }else{ >>>> $cursor = $ma_collection->find($who)->limit(30)->skip(60);
>>>> $cursor->timeout(1000);
>>>> print($cursor->count()); // I display the number of documents >>>> foreach($cursor as $obj){
>>>> The tags field containts array keywords .
>>>> What should I do to resolve this problem ?
>>>> I checked the RAM (6 Go of physical RAM and 4 Go of available memory) .
>>>> How can I check the cause of this slow reads and inserts ?
>>>> I there is something to configure in mongodb ?
>>>> Best regards .
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||