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?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'essentially': 0.04; 'root': 0.05; 'tree': 0.05; '(so': 0.07; 'attribute': 0.07; 'subject:query': 0.07; 'indexes': 0.09; 'objects:': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'storage,': 0.09; 'python': 0.11; '"object': 0.16; '(however,': 0.16; '(it': 0.16; 'accesses': 0.16; 'caches': 0.16; 'caveats': 0.16; 'nodes': 0.16; "object's": 0.16; 'objects.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'storing': 0.16; 'subject:run': 0.16; 'subject:search': 0.16; 'appropriate': 0.16; 'all,': 0.19; 'header:User-Agent:1': 0.23; 'accommodate': 0.24; 'skip:" 20': 0.27; 'header:X-Complaints- To:1': 0.27; 'fixed': 0.29; 'node': 0.31; 'writes:': 0.31; 'objects': 0.35; 'but': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'level': 0.37; 'to:addr:python-list': 0.38; 'expect': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'received:org': 0.40; 'called': 0.40; 'most': 0.60; 'mentioned': 0.61; 'providing': 0.61; 'you.': 0.62; 'received:217': 0.63; 'email addr:gmail.com': 0.63; 'provide': 0.64; 'feeling': 0.68; 'transparent': 0.68; 'respect': 0.70; 'persistent': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From dieter <dieter@handshake.de>
Subject Re: so if zodb has no index or search, how run fast query?
Date Fri, 17 May 2013 08:47:46 +0200
References <a827dd9f-1389-4d7d-9c1e-a15639225648@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Gmane-NNTP-Posting-Host pd9e0b04c.dip0.t-ipconnect.de
User-Agent Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux)
Cancel-Lock sha1:VtZMNqpk/loZ0QxcF+osJB8AogE=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1781.1368773285.3114.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1368773285 news.xs4all.nl 15957 [2001:888:2000:d::a6]:45616
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:45470

Show key headers only | 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