hasura / hasura/graphql-engine

query too slow

Open
#9,614 2 comments 1 reaction 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

version hasura/graphql-engine:v1.3.3.cli-migrations-v2

```
{
"operationName": "user_activity_logs",
"query": "query user_activity_logs($distinct_on: [user_activity_logs_select_column!], $limit: Int, $offset: Int, $order_by: [user_activity_logs_order_by!], $where: user_activity_logs_bool_exp) {\n items: user_activity_logs(limit: $limit, distinct_on: $distinct_on, offset: $offset, order_by: $order_by, where: $where) {\n id\n user_id\n action\n created_at\n project_id\n specific_name\n details\n module\n sub_module\n type\n updated_at\n user {\n name\n email\n __typename\n }\n moduleByModuleId {\n module\n __typename\n }\n moduleBySubModuleId {\n module\n __typename\n }\n __typename\n }\n items_aggregate: user_activity_logs_aggregate(where: $where) {\n aggregate {\n count\n __typename\n }\n __typename\n }\n}\n",
"variables": {
"limit": 5,
"offset": 0,
"order_by": [
{
"created_at": "desc"
}
],
"where": {
"_and": [
{},
{},
{},
{},
{}
]
}
}
}
```
that query took 53 sec to execute, if i execute `select * from user_activity_logs order by created_at desc limit 5` directly in the database takes no more than 1sec, how can i track the problem?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied user_activity_logs GraphQL operation and comparing its execution with the direct PostgreSQL query shown in the report. Trace the request and its generated database work to explain the 53-second delay; done means the cause is identified and a targeted fix or actionable diagnosis is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgres, typescript
Domain
api, backend, databases, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.