circular dependencies - again

7 views
Skip to first unread message

Diez B. Roggisch

unread,
Oct 22, 2009, 1:48:53 PM10/22/09
to sqle...@googlegroups.com
Hi,

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

test.py

Gaetan de Menten

unread,
Oct 22, 2009, 2:44:26 PM10/22/09
to sqle...@googlegroups.com

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

Marko Springfeldt

unread,
Oct 23, 2009, 2:07:24 AM10/23/09
to sqle...@googlegroups.com
Gaetan de Menten schrieb:
Elixir has build in versioning system.
http://elixir.ematia.de/apidocs/elixir.ext.versioned.html
Here are some nice slides containing also some examples on other
extensions in elixir.
http://cleverdevil.org/elixirtalk/slides.pdf

Regards
Marko

Diez B. Roggisch

unread,
Oct 23, 2009, 7:42:31 AM10/23/09
to sqle...@googlegroups.com


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

Diez B. Roggisch

unread,
Oct 23, 2009, 7:44:20 AM10/23/09
to sqle...@googlegroups.com

Cool, and certainly interesting - but not really applying to our actual
problem (which the example was a strip-down of)

Thanks,

Diez

Gaetan de Menten

unread,
Oct 23, 2009, 9:10:37 AM10/23/09
to sqle...@googlegroups.com
On Fri, Oct 23, 2009 at 13:42, Diez B. Roggisch <de...@web.de> wrote:

>> 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.

Reply all
Reply to author
Forward
0 new messages