On 3/23/2011 4:07 AM, Tomalak Geret'kal wrote:
>
> It's not necessarily strictly doubled.
Name an implementation of std::vector that doesn't do this.
> I don't see why you'd ever reserve *more* than the number of records
In this case, you'd do that to avoid the need for a separate COUNT(*)
query. If you have a pretty good idea already how many records to
expect, reserving that amount plus some small fudge factor will probably
run faster than doing two queries so you can reserve only exactly what
is required.