[Zope] Z-SQL Method performance
Jens Vagelpohl
jens@zope.com
Thu, 4 Apr 2002 07:50:03 -0500
in a nutshell, the external method will be faster because you can use it to
circumvent security checking.
when a large result from a ZSQL method is coming back to a page that
renders it then zope will do a security check on every single item (not
just every line) of that record to determine if the current user is allowed
to see this item. so if your result set has 10,000 rows and 5 columns in
each row then the security machinery will check 50,000 times.
one exception where the security machinery will not check are simply python
types (the return values from a ZSQL method are objects that contain the
results and not simple types), such as strings, lists, dictionaries etc. so
if you use an external method to get the result set and then convert it
inside the external method to such a simple type and hand that back to DTML
you will see a marked increase in speed.
jens
On Thursday, April 4, 2002, at 04:08 , Luca Manini wrote:
>> It's almost surely not the Z SQL Method but the DTML rendering
>> that makes it slow.
>
>> Use an External Method to generate the HTML from the query
>> result.
>
>> Dieter
>
> Just out of curiosity:
>
> 1 - (technical) why would the external method by faster?
> 2 - (meta) rendering HTML is "the" DTML job, isn't it?
>
> bye, Luca.
>