Skip to content

Possible slow query #2958

Open
Open
@colins

Description

@colins

We (the MySQL team) have received a customer support query about a slow query. The query is taking 18 seconds.
JIRA
The query is doing a large join.

SELECT count(*) AS `count` FROM (SELECT DISTINCT `service_instances`.* FROM `service_instances` INNER JOIN `spaces` ON (`spaces`.`id` = `service_instances`.`space_id`) LEFT JOIN `service_instance_shares` ON (`service_instance_shares`.`service_instance_guid` = `service_instances`.`guid`)) AS `t1` LIMIT 1;
# Time: 2022-09-01T09:04:11.389209Z
# Schema: ccdb  Last_errno: 0  Killed: 0
# Query_time: 18.541919  Lock_time: 0.000479  Rows_sent: 1  Rows_examined: 144329  Rows_affected: 0  Bytes_sent: 60

This appears to be the corresponding model

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions