[Zope] Zope catalog query...

Casey Duncan casey@zope.com
Fri, 24 Jan 2003 15:25:58 -0500


On Friday 24 January 2003 06:47 am, Thierry Florac wrote:
>   Hi,
>=20
> I want to make a "very frequent" query on a ZCatalog.
> Each object in my Zope site is identified with a globally unique ID
> (called oid) which is indexed in my catalog ; sometimes, I can also kno=
w
> that the object that I'm looking for is stored in a given path.
>=20
> So my question is simple : if I know the subpath in which the object is
> stored, is it faster to :
>  - make a query only on the oid
>  - make a query on the oid and path

If you know the oid then it is a waste to also specify the path. That mak=
es=20
the catalog do more work. A lookup of a single unique value should be ver=
y=20
cheap. The only additional expense is instantiating the metadata record=20
(brain), and doing the traversal to the actual object when you call=20
getObject.

I suspect the latter will take mre time then the actual index lookups.

-Casey