Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45470

Re: so if zodb has no index or search, how run fast query?

From dieter <dieter@handshake.de>
Subject Re: so if zodb has no index or search, how run fast query?
Date 2013-05-17 08:47 +0200
References <a827dd9f-1389-4d7d-9c1e-a15639225648@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.1781.1368773285.3114.python-list@python.org> (permalink)

Show all headers | View raw


visphatesjava@gmail.com writes:
> ...
The only service of the ZODB is storing (persistent) objects
persistently and providing (almost) transparent acces to them.
Persistent objects have a (usually) implicitely
managed attribute which contains the object's "object id"
and the ZODB can (quite) efficiently access the objects based
on its "object id" (it is using caches and indexes for this).

The objects managed by the ZODB form a (directed) graph with
a distinguished root node - where all nodes are (persistent)
Python objects. You essentially work with those persistent objects
as with normal Python objects: the ZODB transparently accesses
the persistent storage, when necessary, to give you
the feeling as if those objects were normal Python objects.
There are a few caveats with respect to modifications -
but most modifications work as you would expect for
"normal" Python objects (however, you must call "transaction.commit()",
in order to persist the modifications).

That is essentially all, the ZODB does for you.
When you need searches, you must use appropriate datatypes --
in the same way, you would need to do this in a "normal" Python program.

The ZODB comes with a collection of datatypes (so called "BTrees")
which may form the base for searches.
"BTrees" are essentially persistent dicts - however, they
are not build from a fixed number of persistent subobjects but
the persistent substructure is changed automatically to accommodate
efficiently for various tree sizes.

Someone else has already mentioned some higher level packages which 
can provide search capabilities.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

so if zodb has no index or search, how run fast query? visphatesjava@gmail.com - 2013-05-16 11:14 -0700
  Re: so if zodb has no index or search, how run fast query? alex23 <wuwei23@gmail.com> - 2013-05-16 17:08 -0700
  Re: so if zodb has no index or search, how run fast query? dieter <dieter@handshake.de> - 2013-05-17 08:47 +0200

csiph-web