Re: [sqlalchemy] schema design feedback

2012-07-01 Thread Wolfgang Keller
Having a single table to store all the customer's logs didn't seem to work because when the device is removed and the logs have to be deleted the table gets locked for a while. Huh? Bad choice of DBMS/OS? Bad application design? My question is, is this a good idea? Am I missing something?

Re: [sqlalchemy] schema design feedback

2012-07-01 Thread Vlad K.
I see two approaches here. The first is partitioning as it has been suggested, except partitions need to be defined upfront, if I'm not mistaken, at least in MySQL (expression + size), whereas in PostgreSQL you need custom triggers on write operations on the main table, so I'm not sure if

[sqlalchemy] Query relationship in order

2012-07-01 Thread Diego
Hi, Say I have two entities A and B, that have a many to many relationship between them. Now I'd like to get all Bs from a given A, ordered by some attribute of B. Something like select B from A order by B.attr desc How do I express that query using the ORM? Thanks in advance, Diego --