
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
Patrick K. O'Brien wrote:Right, but who is the guy that is going to write an optimiser for code like this:
As I've said before, I haven't focused on optimization yet. But I
remain convinced that an ODBMS with the proper object model can be
optimized as you describe. Does that make me an optimist? ;-)
The proof is trivial:
If you back up your object database system with a parallel fast relational system (or write that yourself), you should be able to achieve the same performance for relational queries as any relational database. :-)
def prod_cust_totals():
"""Return order summary information."""
db = _database
group = {}
for od in db.root['OrderDetail']:
key = (od.order.customer.name, od.product.name)
subtotal = od.quantity * od.product.price
group[key] = group.get(key, 0) + subtotal
totals = [(t, c, p) for ((c, p), t) in group.items()]
totals.sort()
pprint.pprint(totals)Granted, you can convert the refereces into simple SQL-queries "under the cover" but how are you going to automatically transform this code into, say, code that starts navigation from the customer table. You will have to use some declarative approach instead so, in effect, you are just writing "another SQL". I understand that there are some query languages (OQL?) available for object databases. Are these actually used in applications? If not, why?
best regards, Lauri Pietarinen
| <-- __Chronological__ --> | <-- __Thread__ --> |