Efficiently updating database using SQLAlchemy ORM

前端 未结 6 1378
梦毁少年i
梦毁少年i 2020-11-28 01:14

I\'m starting a new application and looking at using an ORM -- in particular, SQLAlchemy.

Say I\'ve got a column \'foo\' in my database and I want to increment it.

6条回答
  •  执念已碎
    2020-11-28 01:42

    If it is because of the overhead in terms of creating objects, then it probably can't be sped up at all with SA.

    If it is because it is loading up related objects, then you might be able to do something with lazy loading. Are there lots of objects being created due to references? (IE, getting a Company object also gets all of the related People objects).

提交回复
热议问题