[Zope] Re: Catalog query time

Kevin Carlson khcarlso at bellsouth.net
Thu Mar 18 17:10:48 EST 2004


Casey Duncan wrote:

The folder containing the objects is a BTreeFolder2.

>The query you mention (against two field indexes) should be pretty
>cheap, however it's unclear how many times it gets executed in the loop.
>It would be cheaper to do this instead of querying in the loop.
>
>query = context.getDBSubjectForUser(userID=userID)
>subjects = [q.subject for q in query]
>docResults = context.portal_catalog(
>    {'Subject' : subjects, 'Type' : 'Template'})
>
>  
>


OK.  I can try that.  My only issue is that each docResult is going to 
have to be correlated to an individual user so this may not work well in 
this situation.

>Also, what are you doing with docResults when you get it back? Are you
>calling getObject on the results returned?
>
>  
>
I am not calling getObject.  I am just getting the id of the document 
and passing that to the page displaying the results of the above script.


Thanks for the response.  Any help is greatly appreciated.



More information about the Zope mailing list