relationships between inheritance tables

15 views
Skip to first unread message

Kaan Baha Sever

unread,
Mar 30, 2023, 1:14:17 AM3/30/23
to sqlalchemy
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




Mike Bayer

unread,
Mar 31, 2023, 7:44:36 PM3/31/23
to noreply-spamdigest via sqlalchemy
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.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
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+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages