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

we need a function to show the real query SQL and which step that cost . #1120

Closed
pandaxxt opened this issue Jun 30, 2020 · 2 comments
Closed
Labels
area/gateway Regarding the gateway p/high Candidate for being included in the upcoming release
Milestone

Comments

@pandaxxt
Copy link

The problem faced currently?

I run the GraphQL and use the sort to filter the result, for example: server( where: { pool: {_in: ["test"]}, decommission: {_eq: 0} }, sort: ["host_name"] ), this will cost almost 11s to get the result, but if i remove the sort: ["host_name"] ), the return will only 600ms.

How can we solve it?

when there is the performance issue , we want to know the detail query in the graphQL. we need a function to show the real query and which step that cost .

@YourTechBud YourTechBud added this to the v0.20.0 milestone Jun 30, 2020
@HeyItsJs HeyItsJs added the p/high Candidate for being included in the upcoming release label Aug 1, 2020
@YourTechBud YourTechBud removed this from the v0.20.0 milestone Sep 4, 2020
@YourTechBud YourTechBud added this to the v0.21.0 milestone Dec 5, 2020
@YourTechBud
Copy link
Collaborator

This is the SQL query analyzer we have been talking about

@YourTechBud YourTechBud added the area/gateway Regarding the gateway label Dec 12, 2020
@sharadregoti
Copy link
Contributor

Graphql query

query {
  users(debug:true) @mysql {
    id
    name
  }
  _query
}

Result

{
  "data": {
    "_query": [
      {
        "args": [
          1000
        ],
        "col": "users",
        "db": "mysql",
        "queryTime": "210.42µs",
        "sql": "SELECT * FROM users LIMIT ?"
      }
    ],
    "users": [
      {
        "id": "0bbacb5891c544f1b",
        "name": "Sharad Regoti"
      },
      {
        "id": "1mVhiUUFCXgjPX0PRgIifIxGKqB",
        "name": "SHARAD REGOTI"
      },
      {
        "id": "8989e865f4d841858",
        "name": "sharad regoti"
      }
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway Regarding the gateway p/high Candidate for being included in the upcoming release
Projects
None yet
Development

No branches or pull requests

4 participants