this is not so much about the database models as it is about the queries being emitted and what kinds of data are being returned.
I would go through the section at https://docs.sqlalchemy.org/en/20/faq/performance.html#how-can-i-profile-a-sqlalchemy-powered-application and identify where the issue exists. On Thu, Mar 30, 2023, at 1:14 AM, Kaan Baha Sever wrote: > Hello! I have three post type and inherit from post table. And this post have > comment and like table foreign key. But I am using this method my performance > very very low. One page loading 3-4 sec. How can I do? > My Tables > Post(Model): > id > name > > PostType1(Post): > id > content > > PostType2(Post): > id > body > PostTyp1.id foreign key > > PostType3(Post): > id > body > PostTyp2.id foreign key > > Comment(Model) > Post.id > > Like(Model) > Post.id and I want to comment ID > > > > > > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/3bfb5d25-b017-473d-9e19-73d5e723d323n%40googlegroups.com > > <https://groups.google.com/d/msgid/sqlalchemy/3bfb5d25-b017-473d-9e19-73d5e723d323n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/af4c5429-9032-47e9-96c8-3fa0d1a804f9%40app.fastmail.com.