That would be the simplest. Having something so inefficient just bugs me. :)
I'm using MSSQL, so limit() works. Would yield_per() help here, or is
that for something different? Even if it didn't help local memory, but
just kept the load on the DB server down, that would be good.
On 3/16/16,
We all inherit less-than-ideal situations.
If this is running once a day and isn't impacting performance or other
work, I wouldn't really worry about the huge join matrix. It sounds like
the current solution is "good enough". In a few weeks or months you'll be
better acquainted with
> On Mar 16, 2016, at 03:23, Jonathan Vanasco wrote:
>
> The database design you have is less than perfect.
I didn't make it, I came in long after it had been set up and now have to work
with it. I can't re-do anything. They did it this way so that, for instance, a
The database design you have is less than perfect.
The goal of having to reformat the relational DB into a CSV is less than
perfect.
If I were you, I would think about 3 questions:
1. How often do you have to run this?
2. Does it take too long?
3. Does it use up too much DB/Python memory?
If
Thanks guys. I'm using automap, but I'm not completely sure how much
that gives me for free. Yes, these tables are big, and the resulting
set would be worrying large (potentially 5*20, and that's without
the attributes and attachments, plus their assignment and values
tables). I've switched to
Note that if your items have a lot of attributes and attachments, an
outer-join will return a multiplicatively-large result set. That will get
boiled down into a sane number of objects by the SqlAlchemy ORM, but your
performance might be ugly in terms of I/O to your database, or the
processing
The ORM has an `outerjoin` method on queries:
http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query.outerjoin
You can also pass "isouter=True" to `join`
http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query.join
The core supports an
After some experimenting I am able to generate the correct query
by two methods
(1) build query from ORM classes with ORM session.query()
(2) build query from underlying tables with sql expressions
I like the ORM based method better, because the code does not need
to know which columns
outerjoin() will bridge between multiple tables if you specify a list
to a single outerjoin() call (see the examples in the reference
documentation). However for joined table inheritance with the ORM no
explicit joining is necessary, see the documenation on using
with_polymorphic in the
Oops, the description should say
Inputs are stored in a single table with column kind as a
discriminator.
On Feb 1, 10:58 pm, MikeCo mconl...@gmail.com wrote:
I can't figure out how to write this outer join query in ORM-speak.
Jobs have Steps; Steps have optional inputs of type SRC1, SRC2, or
10 matches
Mail list logo