Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow DB Query optimization #4727

Closed
3 of 4 tasks
majian159 opened this issue May 28, 2024 · 1 comment · Fixed by #4737
Closed
3 of 4 tasks

Slow DB Query optimization #4727

majian159 opened this issue May 28, 2024 · 1 comment · Fixed by #4737
Assignees
Labels
💪 enhancement New feature or request

Comments

@majian159
Copy link
Contributor

majian159 commented May 28, 2024

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing?

I hope to optimize this issue to improve concurrency performance.

2. Describe the feature you'd like to see

I hope to optimize this issue to improve concurrency performance.

3. How will this feature improve your workflow or experience?

I hope to optimize this issue to improve concurrency performance.

4. Additional context or comments

SELECT max(workflow_runs.sequence_number) AS max_1
FROM workflow_runs
WHERE workflow_runs.tenant_id = %(tenant_id_1)s::UUID AND workflow_runs.app_id = %(app_id_1)s::UUID

Currently, the workflow_runs table has 620,000 records, and executing this SQL query takes approximately 400ms.

My PostgreSQL database configuration is as follows:

CPU: 2
Memory: 8Gi
Disk: HDD

I noticed that the index has already been processed. Should we consider using Redis Seq?

5. Can you help us with this feature?

  • I am interested in contributing to this feature.
@dosubot dosubot bot added the 💪 enhancement New feature or request label May 28, 2024
@AndyMik90
Copy link

Same issue, also when you start to get a lot of apps, with /console/api/installed-apps

SELECT apps.id AS apps_id, apps.tenant_id AS apps_tenant_id, apps.name AS apps_name, apps.description
   AS apps_description, apps.mode AS apps_mode, apps.icon AS apps_icon, apps.icon_background AS
  apps_icon_background, apps.app_model_config_id AS apps_app_model_config_id, apps.workflow_id AS
  apps_workflow_id, apps.status AS apps_status, apps.enable_site AS apps_enable_site, apps.enable_api
  AS apps_enable_api, apps.api_rpm AS apps_api_rpm, apps.api_rph AS apps_api_rph, apps.is_demo AS
  apps_is_demo, apps.is_public AS apps_is_public, apps.is_universal AS apps_is_universal,
  apps.created_at AS apps_created_at, apps.updated_at AS apps_updated_at
FROM apps
WHERE apps.id = %(id_1)s::UUID
LIMIT %(param_1)s```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants