List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:March 23 2011 9:08am
Subject:Re: StoreQueryResults destructor runs without end...
View as plain text  
On Mar 23, 2011, at 3:00 AM, Warren Young wrote:

> On Mar 22, 2011, at 6:48 PM, Paul Dalach wrote:
> 
>> I am pulling ~80k objects with four fields.  Does that constitute huge?
> 
> Well, it depends on how big those fields are, doesn't it?  If they are four 32 byte
> strings, the amount of data in use is at least 10 GB.

Sorry, got my MB confused with my GB there.  80,000 records x 4 x 32-byte strings is ~10
MB, not 10 GB.

Still, the answer may still be valid if the field sizes are large enough.

Keep in mind also the behavior of std::vector, which StoreQueryResult is based on.  (More
or less, it is a 2D vector of mysqlpp::String.)  It doubles in size each time you exceed
its size, so it can keep growing.  That means lots of RAM copies for such a large number
of fields.

You can solve some of that by calling res.reserve(N), where N is larger than the number of
records possible from the query, but you still have to deal with the fact that you're
trying to store all that in RAM at once.
Thread
StoreQueryResults destructor runs without end...Paul Dalach22 Mar
Re: StoreQueryResults destructor runs without end...Dino Korah22 Mar
  • Re: StoreQueryResults destructor runs without end...Paul Dalach23 Mar
    • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
      • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
        • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
          • Re: StoreQueryResults destructor runs without end...Mickael Wolff23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • Re: StoreQueryResults destructor runs without end...Mickael Wolff23 Mar
                • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
          • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • List etiquette - please use good email subjects :)Joel Fielder23 Mar
                • Re: List etiquette - please use good email subjects :)Tomalak Geret'kal23 Mar
                  • Re: List etiquette - please use good email subjects :)Paul Dalach23 Mar
                    • Re: List etiquette - please use good email subjects :)Dino Korah23 Mar
                      • Re: StoreQueryResults destructor runs without end...Paul Dalach23 Mar
                      • Re: StoreQueryResults destructor runs without end...F.N. Bruggeman23 Mar
                    • Re: List etiquette - please use good email subjects :)Joel Fielder23 Mar
              • Re: growth behavior of std::vectorWarren Young23 Mar
                • Re: growth behavior of std::vectorTomalak Geret'kal23 Mar
                  • Re: growth behavior of std::vectorJonathan Wakely23 Mar
                    • Re: (OT) growth behavior of std::vectorTomalak Geret'kal23 Mar
                      • Re: (OT) growth behavior of std::vectorJonathan Wakely23 Mar
                • Re: (OT) growth behavior of std::vectorTomalak Geret'kal23 Mar
            • Re: StoreQueryResults destructor runs without end...Tomalak Geret'kal23 Mar
              • re: (OT) growth behaviour of std::vector [was Re: StoreQueryResultsdestructor runs without end...]Tomalak Geret'kal23 Mar
        • Re: StoreQueryResults destructor runs without end...Warren Young23 Mar
Re: StoreQueryResults destructor runs without end...Dino Korah23 Mar