[ZPT] Re: Please make "total" lazy!

Chris Withers chrisw@nipltd.com
Sat, 16 Mar 2002 09:23:32 +0000


Steve Alexander wrote:
> 
> > But why would the length of a ZCatalog results set need to be calculated in this way?
> 
> Why do you think that ZTUtils batching is only used with ZCatalog?

I don't ;-)

> Your latest cvs commit causes the length to be calculated for every
> batch, whether it is needed or not. This is a bug. Please fix it so that
> the length is only calculated when required, or back out your changes.

I agree, but I see Evan beat me to the fix :-S

> > PS: If it does need to calculate it in this way, I think that's a bug in the BTrees
> > implementation. The users shouldn't have to care about how the length is stored or
> > computed, the BTrees internally should keep a seperate counter ifthat's what they need to
> > do, then it can be kept in synch in a much tigher loop..
> 
> That's not a bug in the BTrees implementation. It is one of the central
> trade-offs when using that particular abstract data type. It is a design
> decision.

...in BTrees I still actually think this is a sorely lacking feature. I mean,
how hard is it to maintain a seperate length counter at the C level which is
updated on insertion and deletion?

cheers,

Chris