Re: Dreaming About Redesigning SQL
Date: Mon, 20 Oct 2003 19:09:33 +0300
Message-ID: <3F9408BD.4030202_at_atbusiness.com>
Carl Rosenberger wrote:
>Patrick K. O'Brien wrote:
>
>
>>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. :-)
>
>
>
Right, but who is the guy that is going to write an optimiser for code
like this:
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
Received on Mon Oct 20 2003 - 18:09:33 CEST
