List:MySQL++« Previous MessageNext Message »
From:Earl Miles Date:October 26 2005 5:46pm
Subject:Re: Retrieving 300K+ records
View as plain text  
Chris Frey wrote:
> On Tue, Oct 25, 2005 at 03:14:52PM -0400, Alex Vishnev wrote:
> 
>>        Query q << "select * from table";
>>
>>        mysqlpp::ResUse use = q.use();
>>        while ((row = use.fetch_row()))
>>        {
>>                string col1 = (string)row.lookup_by_name("col1");
>>                string col2 = (string)row.lookup_by_name("col2")
>>                float col3 = row.lookup_by_name("col3");
>>        }
> 
> 
> Before you jump completely to C, you might try using the .at() function
> to reference fields by index instead of by name.  This removes the repeated
> name lookup on each cycle of your loop.
> 
> I haven't done timings, so I don't know if this is significant.
> 
> - Chris

The name lookups aren't what cause the slowdown (for me, at least) -- it's 
translating from a mysql row to a MySQL++ Row object that takes all the time.
Thread
SSQLS contained within class definition compilation issueswilliam.lieberman25 Oct
  • Retrieving 300K+ recordsAlex Vishnev25 Oct
    • Re: Retrieving 300K+ recordsEarl Miles25 Oct
      • RE: Retrieving 300K+ recordsAlex Vishnev25 Oct
        • Re: Retrieving 300K+ recordsWarren Young27 Oct
      • RE: Retrieving 300K+ recordsAlex Vishnev26 Oct
        • Re: Retrieving 300K+ recordsWarren Young27 Oct
          • RE: Retrieving 300K+ recordsAlex Vishnev27 Oct
    • Re: Retrieving 300K+ recordsChris Frey26 Oct
      • Re: Retrieving 300K+ recordsEarl Miles26 Oct
        • Re: Retrieving 300K+ recordsChris Frey26 Oct
          • RE: Retrieving 300K+ recordsAlex Vishnev26 Oct
            • Re: Retrieving 300K+ recordsEarl Miles26 Oct
            • Re: Retrieving 300K+ recordsChris Frey26 Oct
  • Re: SSQLS contained within class definition compilation issuesahnkle28 Oct
    • New FeaturesFabricio Mota29 Oct
RE: SSQLS contained within class definition compilation issueswilliam.lieberman25 Oct
  • Re: SSQLS contained within class definition compilation issuesWarren Young27 Oct
Re: SSQLS contained within class definition compilation issuesWarren Young27 Oct