[Zope-dev] Strange loop with ZCatalog

Casey Duncan casey at zope.com
Fri Feb 13 09:45:45 EST 2004


I already replied to this, but I never heard back from you.

What does the following return for a value:

len(list(context.TheCatalog.searchResults(Type='TypeTest')))

??

-Casey

On Fri, 13 Feb 2004 13:01:35 +0100
Pascal Samuzeau <samuzeau at oreka.com> wrote:

> Hi,                                                                   
>                                                                       
> For some tests I have done :                                          
>                                                                       
> - Create about 5000 folders under the Root Zope Site                  
> - Inside those folders, I have created about 30 000 objects ( as      
> document, just an id, title and a Type).                              
> - I've catalogued all inside a catalog named TheCatalog               
>                                                                       
> I have written just this function, in intend to test my CPU ( that why
> I've written it like this):                                           
>                                                                       
> allobject = context.TheCatalog.searchResults(Type='TypeTest')         
> l=len(allobject)                                                      
> i = 0                                                                 
> #for i in range(len(allobject)):                                      
> for object in allobject:                                              
> #path = allobject[i].getPath()                                        
> #course = allobject[i][0]                                             
> path = allobject.getPath()                                            
> course = allobject[0]                                                 
> thepath = string.split(path,'/')                                      
> lepath  = string.join(thepath[:-1],'/')                               
> lieu=context.restrictedTraverse(lepath)                               
> lieu.manage_delObjects(course)                                        
> i+=1                                                                  
> return "Len: %s and Number parsed: %s" %(i,l)                         
>                                                                       
> Phase A:                                                              
> I have 30 000 objects and the message following:                      
> Len: 30000 and Number parsed: 15001                                   
> In my catalog: 15000 object only were destroyed. !!!                  
>                                                                       
> Phase B:                                                              
> I de-comment my comment lines, but I've got the same message.         
>                                                                       
> I try to understand what it happens, but I can't. Anyone has a        
> brillant idea?                                                        
>                                                                       
> Sincerily                                                             
> PS                                                                    
> --------------------------------------------------                    
> Oreka ! Nous sommes l'internet moins cher !                           
> Surfez 25% moins cher avec http://www.oreka.com                       
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )



More information about the Zope-Dev mailing list