OpenEngSB
  1. OpenEngSB
  2. OPENENGSB-3145

Querying for active models results in n+1 JDBC-Queries

    Details

    • Changelog:
      The query method for models at a specific time now performs 1 query instead of n+1 queries (where n was the number of models in the EDB which are fitting the query criteria and had the highest timestamp before the given time)
    • Sprint:
      Sprint 5, Sprint 6

      Description

      When querying for acitve Models in EDB. For every result, there is an additional query executed resulting in at least n+1 queries (with n being the number of elements in the EDB!).

      This gets very slow when handling 1000+ Elements.

        Gliffy Diagrams

        Error rendering 'com.meetme.plugins.jira.gerrit-plugin:gerritreviewsmodule'. Please contact your JIRA administrators.

          Activity

          Hide
          Felix Mayerhuber added a comment -

          Where did you see that? If querying for the active models, a query is performed which gets all active models. Or have you tested it with models which have sub models?

          Show
          Felix Mayerhuber added a comment - Where did you see that? If querying for the active models, a query is performed which gets all active models. Or have you tested it with models which have sub models?
          Show
          Christoph Gritschenberger added a comment - https://github.com/Arcticwolf/openengsb-framework/blob/23866587e75598938eedf7789e5f3ca61c2a1a3f/components/edb/src/main/java/org/openengsb/core/edb/internal/dao/DefaultJPADao.java#L349 No submodels involved.
          Hide
          Christoph Gritschenberger added a comment -

          First query is at line 377, and then for each result from that, another query is executed at line 395

          Show
          Christoph Gritschenberger added a comment - First query is at line 377, and then for each result from that, another query is executed at line 395
          Hide
          Felix Mayerhuber added a comment -

          ah ok ... need to think about a better query there

          Show
          Felix Mayerhuber added a comment - ah ok ... need to think about a better query there

            People

            • Assignee:
              Felix Mayerhuber
              Reporter:
              Christoph Gritschenberger
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile