Re: Z SQL equivelant of MySQL's SQL_CALC_FOUND_ROWS?

Chris Withers <[email protected]>
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
Charlie Clark wrote:
>>>>I wonder how the two methods compare efficiency-wise?
>>
>>Yes, well, we're talking about MySQL specifically ;-)
> 
> Well, with reference to Zope we shouldn't be...

Huh? the original poster was talking about MySQL, why should he care 
about any other rdb?

>>Not so. Think of batches:
>>
>>"Now showing Results 5 - 10 of 25"
>>
>>But why not just return all the rows and only show 5 of them?
>>
>>"Now showing Results 5 - 10 of 250000"
> 
> Yes, let's talk about batches - ZSQL doesn't implement batching so it 
> collects the whole set of results available so len() is available. 

How would you implement batching in a way that's agnostic of the rdb used?

> Result sets aren't supported directly 

by what?

> so unless the DA provides a method to 
> query on the connection or cursor you will also have to run a separate query 
> with count().

*sigh*

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.