[PonyORM-list] Automatic intermediate tables for all optional relationships

Erik Quaeghebeur ponyorm at equaeghe.nospammail.net
Tue Feb 23 13:44:44 UTC 2016

Dear Alexander,

Thank you for your response.

> You are right, currently Pony uses intermediate tables for Many-to-Many
> relationships only. In principle it is possible to implement intermediate
> tables support for other types of relationships.
> As a downside, intermediate table requires additional JOIN, so its
> performance will be worse then the current implementation of One-to-One and
> One-to-Many relationships.
> Could you describe your use case in a bit more detail? Why do you think
> avoiding nullable attributes is a useful goal beside just a theoretical
> purity?

For now, I guess it is just about theoretical purity.

I don't have a specific use case. I'm actually learning about relational modeling & databases, and Pony allowed for focus on the relational database modeling without needing to dive into SQL. (I am familiar with Python.)

I came a across the "null vs. no nulls" discussion and wondered about the practical difference when doing the modeling. It turns out for me that it does have a big impact. I did find that the ‘theoretically pure’ approach forced me to better understand the structure of my data. The downside was that when using this approach, the formulation using Pony became far more verbose (needing to add the intermediate tables).

Were Pony to have the option, it would allow me to use it to discover first-hand what the performance impact is of one or the other approach. (I read conflicting claims: some say that using nullable attributes may degrade performance; I guess this depends on the actual data whether that or the opposite happens.) 

I understand that you cannot just implement any old feature request. I already appreciate the fact that you took the time to look at my question.



More information about the ponyorm-list mailing list