superset: [Roles Page] page load is very slow

On superset 1.1.0 roles list page loading is slow. It takes approx. 16 seconds to load. From roles listing page if I click edit to edit a role then it takes 18 to 20seconds for the edit page to open up. This makes working with roles very difficult.

Viewing user list takes just 2s in comparison.

Expected results

Roles related pages to load in <5seconds.

Actual results

Roles related pages load in >15seconds.

Screenshots

See developer tools image

How to reproduce the bug

  1. Go to Roles list page
  2. Edit a role

Environment

(please complete the following information):

  • superset version: superset version 1.1.0
  • python version: python --version Python 3.7.9
  • node.js version: node -v NA. docker images does not have node

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I did not upgrade to latest release but I searched latest release notes and there isn’t anything related to slowness
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 26 (6 by maintainers)

Most upvoted comments

@happykust I’m sorry to ear that, can you point to any current/past issue/PR on flask-appbuilder or open a new one please, so we can visit this.

Hey, folks! Have anyone found a workaround to this? I’m facing the same with version 2.0.1 and 2.1.0.

I have the same with the Superset 1.5.1. When go to List Roles Page, it calls Postgres ab_view_menu select 44900 times

image

Query:

SELECT ab_view_menu.name AS ab_view_menu_name FROM ab_view_menu JOIN ab_permission_view ON ab_view_menu.id = ab_permission_view.view_menu_id JOIN ab_permission ON ab_permission.id = ab_permission_view.permission_id JOIN ab_permission_view_role ON ab_permission_view.id = ab_permission_view_role.permission_view_id JOIN ab_role ON ab_role.id = ab_permission_view_role.role_id JOIN ab_user_role ON ab_role.id = ab_user_role.role_id JOIN ab_user ON ab_user.id = ab_user_role.user_id WHERE ab_user.id = %(id_1)s AND ab_permission.name = %(name_1)s

@dpgaspar Thank you very much for the fixes!

np, FAB 4.4.1 is released with the fix, bumping Superset also.

I have the same with the Superset 1.4.2

The UI works. It is just slow. The DB is not slow as I am able to query the same tables (ab_role etc.) very fast via sql lab. There must be something in the code itself which is causing this slowness when the page is being loaded.