[sqlalchemy] Impedance mismatch: too much queries?

2011-10-02 Thread Vlad K.
I have an impedance mismatch problem, namely a model in X categories, each having its own set of fields and all having a set of common fields. I solved that with: 1. master table, contains the sequenced pkey and common fields, as well as category discriminator 2. individual category tables

Re: [sqlalchemy] Impedance mismatch: too much queries?

2011-10-02 Thread Vlad K.
Ah, a solution just came to me. If I had 10 categories and denormalized the user_id into them, I can reverse the queries and do only 10 selects, filtered by user_id and joined with the master table on pkey. I'd end up with equal number of rows selected, but only 10 queries issued. The