taking python enterprise level?...
steve at holdenweb.com
Wed Mar 3 19:14:18 CET 2010
> D'Arcy J.M. Cain wrote:
>> I keep seeing this statement but nothing to back it up. I have created
>> many apps that run on Python with a PostgreSQL database with a fully
>> normalized schema and I can assure you that database joins were never
>> my problem unless I made a badly constructed query or left off a
>> critical index.
> I too have done that (Python/PGSQL), even adding a complicated layer of
> SQLAlchemy on top of it and have not had issue with this: when I
> profiled one of my apps, it turned out that it spent most of its
> computation time... rendering HTML. Completely unexpected: I expected DB
> to be bottleneck (although it might be that with huge datasets this
> might change).
> Having said that, re evidence that joins are bad: from what I've *heard*
> about Hibernate in Java from people who used it (I haven't used
> Hibernate apart from "hello world"), in case of complicated object
> hierarchies it supposedly generates a lot of JOINs and that supposedly
> kills DB performance.
> So there *may* be some evidence that joins are indeed bad in practice.
> If someone has smth specific/interesting on the subject, please post.
I suspect that this myth is propagated from the distributed database
world: joining tables across two different servers can indeed be
problematic from a performance point of view.
However, the classic advice in database design is to start with a
normalized design and then vary it only if you need to for performance
reasons (which will also involve taking a hit on the coding side,
especially if updates are involved).
Steve Holden +1 571 484 6266 +1 800 494 3119
PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/
More information about the Python-list