cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <Giacomo.P...@pwr.ch>
Subject Re: COUNT in sql taglib
Date Sat, 20 May 2000 09:08:28 GMT
Donald Ball wrote:
> 

<snip/>

> Man, that's tricky. I hadn't thought that it would be this complicated.
> Guess my SQL knowledge has more holes in it than I thought. I'm sending
> this on to the cocoon developers list in hopes of expanding the noosphere.
> 
> > Now we have several opportunities:
> > 1. we don't offer the count attribute anymore
> > 2. we insert the count attribute after the result set is produced (and
> > counted) [could/should not be portable to cocoon 2 because of SAX]
> > 3. we analyse the sql statement and decide if a count could be reliable
> > produced depending on some keywords like HAVING and maybe more.
> 
> count attribute is very very helpful when you want to generate pages that
> iterate through a resultset. maybe we should make it an element instead so
> that we don't have to worry about problems when porting to SAX and
> cocoon2? Hmm...

Yes, I think this could help even to increase the performance because
you have to run the query only once. You know, a heavy query which scans
the hole tablespace without being able to use an index because of a
complex WHERE clause need almost the same time even if the DBMS only
have to count the rows.
 
> 
> I'd say we should analyze the statement first to see if we can generate a
> reliable count query and do that if possible. If not, we'll iterate
> through the whole resultset (if the author wants a count attribute).
> Although... it just occured to me - I've never used cursors, but do they
> provide any special functionality we could use to help overcome this
> problem?
> 
> Any thoughts from interested users?
> 
> - donald

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

Mime
View raw message