a couple of month ago I asked how to create circular dependencies within
Elixir. Eventually, I dropped the issue, as I just created a normal
int-column and some @property-magic around it.
Now it became apparent that this produces *horrible* SQL-query-numbers, as
SA/Elixir isn't aware of the relationship.
We found that by temporarily declaring the relationship the other way round,
and it massively improved the performance.
So I created a minimal example that shows the problems we run into - and it
would be *fabulous* if one could advise us on how to solve that.
Diez
You should use post_update=True on the ManyToOne relationship. See:
http://www.sqlalchemy.org/docs/05/mappers.html#rows-that-point-to-themselves-mutually-dependent-rows
--
Gaëtan de Menten
http://openhex.org
Regards
Marko
We found that short after I posted this. I think putting this into the docs,
or creating a best-practices-example for the tutorial would help
tremendously.
Regards,
Diez
Cool, and certainly interesting - but not really applying to our actual
problem (which the example was a strip-down of)
Thanks,
Diez
>> You should use post_update=True on the ManyToOne relationship. See:
>> http://www.sqlalchemy.org/docs/05/mappers.html#rows-that-point-to-themselve
>>s-mutually-dependent-rows
> We found that short after I posted this. I think putting this into the docs,
> or creating a best-practices-example for the tutorial would help
> tremendously.
I don't want to duplicate the whole SQLAlchemy documentation, so I
will *not* add documentation about this specific feature in Elixir.
On the other hand, if you have a suggestion to make it clearer that
any option/argument that is not explicitly handled by Elixir is
forwarded to SQLAlchemy (and thus available in Elixir), it is very
welcome.