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

Extra query for empty query result #507

Open
nosedova opened this issue Sep 25, 2024 · 0 comments
Open

Extra query for empty query result #507

nosedova opened this issue Sep 25, 2024 · 0 comments

Comments

@nosedova
Copy link

Describe the bug

Hello. The bug is about performance reduce when query result is empty.

To Reproduce

Steps to reproduce the behavior:

  1. uncomment https://github.com/introproventures/graphql-jpa-query/blob/m…

  2. Run test https://github.com/introproventures/graphql-jpa-query/blob/m…

  3. See console

There are 2 sql queries in the output. First query didn't return keys and second query select all rows again. When database is large and there is a lot of tables - it take several seconds to execute second query.

Expected behavior

Only one query has been executed

Additional context

This can be fixed by adding to https://github.com/introproventures/graphql-jpa-query/blob/m…

            if (queryKeys.isEmpty()) {

                return pagedResult.build();

            }
@nosedova nosedova changed the title Extra query for empty qury result Extra query for empty query result Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant