[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-plusplus
Subject:    Re: Strange inefficiency with mysql++ SELECT
From:       dbuck () mindspring ! com
Date:       2001-07-30 15:14:15
[Download RAW message or body]

the solution i found when iterating through large result sets was to
use fetch_row() as follows:

Result res = query.store();
Row row;
const Result::const_iterator ie( res.end() );
for (Result::iterator ib = res.begin(); ib != ie; ++ib) {
row = res.fetch_row();// much faster
//do something with the result
}

from profiling i noticed that the iterator was doing the equivalent of
a linear table scan from result row 1 to n to get the nth row every time.

hth,

-Darin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic