[Zope-dev] Strange loop with ZCatalog
Pascal Samuzeau
samuzeau at oreka.com
Fri Feb 13 07:01:35 EST 2004
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
More information about the Zope-Dev
mailing list