Hi, 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 know that the object that I'm looking for is stored in a given path. 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 Thanks for any advise... Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
What about making some benchmarks? -aj --On Freitag, 24. Januar 2003 12:47 +0100 Thierry Florac <thierry.florac@onf.fr> wrote:
Hi,
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 know that the object that I'm looking for is stored in a given path.
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
Thanks for any advise...
Thierry
-- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - ---------------------------------------------------------------------
On Friday 24 January 2003 06:47 am, Thierry Florac wrote:
Hi,
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 know that the object that I'm looking for is stored in a given path.
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 makes the catalog do more work. A lookup of a single unique value should be very cheap. The only additional expense is instantiating the metadata record (brain), and doing the traversal to the actual object when you call getObject. I suspect the latter will take mre time then the actual index lookups. -Casey
Thierry Florac wrote at 2003-1-24 12:47 +0100:
Hi,
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 know that the object that I'm looking for is stored in a given path.
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
This is much faster, because it is a simple lookup in the index.
- make a query on the oid and path This is much slower because path searches are quite complicated.
Dieter
participants (4)
-
Andreas Jung -
Casey Duncan -
Dieter Maurer -
Thierry Florac