You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/08/08 20:31:06 UTC

[GitHub] [superset] bkyryliuk commented on pull request #20974: perf: Implement model specific lookups by id to improve performance

bkyryliuk commented on PR #20974:
URL: https://github.com/apache/superset/pull/20974#issuecomment-1208580643

   > I wonder if the slowness in your check permission query is because postgres did not automatically create indexes on the `sqlatable_user` table ([ref](https://stackoverflow.com/questions/970562/postgres-and-indexes-on-foreign-keys-and-primary-keys)).
   > 
   > ```
   > superset_test=> \d sqlatable_user;
   >                              Table "public.sqlatable_user"
   >   Column  |  Type   | Collation | Nullable |                  Default                   
   > ----------+---------+-----------+----------+--------------------------------------------
   >  id       | integer |           | not null | nextval('sqlatable_user_id_seq'::regclass)
   >  user_id  | integer |           |          | 
   >  table_id | integer |           |          | 
   > Indexes:
   >     "sqlatable_user_pkey" PRIMARY KEY, btree (id)
   > Foreign-key constraints:
   >     "sqlatable_user_table_id_fkey" FOREIGN KEY (table_id) REFERENCES tables(id)
   >     "sqlatable_user_user_id_fkey" FOREIGN KEY (user_id) REFERENCES ab_user(id)
   > ```
   
   
   
   
   > sqlatable_user
   
   Yeah - we have both indexes: 
   <img width="463" alt="image" src="https://user-images.githubusercontent.com/5727938/183508691-c334fd78-5381-406f-9894-69b2b041462a.png">
   new relic states that a lot of time is spent in python code, not sql execution. I have 2 more places I want to optimized for better perf: https://apache-superset.slack.com/archives/G013HAE6Y0K/p1659722615103529?thread_ts=1659395755.971919&cid=G013HAE6Y0K and will have PRs coming up soon


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org