[Chicago] benchmarks

Massimo Di Pierro mdipierro at cs.depaul.edu
Wed Apr 2 05:28:44 CEST 2008


I would like to add that those benchmarks do not include web2py  
features that I do not know how to reproduce in SQLAlchemy and Storm.  
I actually took some SQLAlchemy examples and tried to code them in  
web2py. It would be nice to do the opposite as well.

I hope somebody here can help me with some suggestions. For example,  
how do I do in SQLAlchemy and Storm the following?

- joins

    >>> rows=db((db.table1.field1==db.table2.field2)& 
(db.table2.field2.year()<2000)).select()

   which more or less translates in (assuming postgresql):
   "SELECT table1.id, table1.field1 table2.id, table2.field2 FROM  
table1, table2
     WHERE (table1.field1=table2.field2) AND (EXTRACT 
('year',table2.field2)<2000) ;"

- nested selects

    >>> rows=db(db.table1.field1.lower().belongs(db()._select 
(db.table2.field2))).select()

   which more or less translates in (assuming postgresql):
   "SELECT table1.id, table1.field1 FROM table1 WHERE LOWER 
(table1.field1) IN (SELECT table2.field2 FROM table2);"

- storing an manipulating queries without communicating with the  
database

    >>> query1=(db.table1.field1==db.table2.field2)& 
(db.table2.field2.year()<2000)
    >>> query2=query1|(db.table1.field1.upper().like('%a%')
    >>> myset=db(query2)

I would also like to benchmark the Django ORM, anybody up to the task  
of translating the benchmark code in Django?

I could really use some help.

Massimo


More information about the Chicago mailing list