← Back to team overview

launchpad-dev team mailing list archive

Re: performance tuesday: better batches are -go-

 

On 27.09.2011 14:47, Jeroen Vermeulen wrote:
> On 2011-09-27 19:26, Abel Deuring wrote:
> 
>> I wrote a bit about StormRangeFactory in
>> https://dev.launchpad.net/Database/Performance
> 
> Thanks for that.  I made some very small updates, on the principle that
> I should leave what I use slightly better than I found it.
> 
> One thing I'm not sure about: the text said that _calculating_ offsets
> is expensive.  That's probably not exactly what was meant ("next_offset
> = offset + batch_size" can't be too expensive :), so I changed it to
> "finding the end of the result set, and skipping to the right offset."

Right, thanks for the "improved precision" :)

> 
> Those would correspond to the counting query for the batch navigation
> widget and the OFFSET argument in the main query.  But are they both
> part of the problem that StormRangeFactory solves?

yes, this is the core of what StormRangeFactory is intended to improve:
Get rid of the need to count larger result sets for OFFSET and SELECT
count(*). (The latter is replaced by an estimation. It might make sense
to change the text "15->20 of 234 results" with something like "15->20
of approximately 234 results" -- I suspect that the estimated result
size can be drastically wrong for non-trivial queries.)


Follow ups

References