On 23/03/2011 11:59, Warren Young wrote:
> 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'm in the process of attempting to compile a list of
multipliers across toolchains. I'll post it when it's done
if you're interested.
Still, though, it's besides the point. That the multiplier
is not standardised means that on any toolchain it could
change at any time. It doesn't really matter whether all
your favourite implementations currently use a doubling-up
technique if they could legally stop doing that at any time.
>
>> 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.
Sure, if you don't know what the number of entries will be,
that makes sense.
The phrasing "the number of records possible from the query"
implied to me that no higher number would be possible, and
reserving more space than is possible to fill is the "waste
of space" I was talking about.
Tom