Skip to content

Extra query for empty query result #507

Open
@nosedova

Description

@nosedova

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();

            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions