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

DMP-4550: Performance Testing - Automated Tasks - UnstructuredToArmDataStore - 28K Batch Size - SELECT darts taking 12.5 minutes #2495

Merged
merged 18 commits into from
Feb 3, 2025

Conversation

Ben-Edwards-cgi
Copy link
Contributor

Links

Jira

Change description

Summary of Git Diff

This Git diff reflects changes made to the ExternalObjectDirectoryRepository.java file, focusing on the query definitions for retrieving external object directory entities and their IDs. The queries have been optimized and converted from JPQL to native SQL syntax, enhancing performance and readability.

Highlights

  • Query Optimization:

    • Original JPQL queries were replaced with native SQL queries, which can result in better performance and efficiency.
  • Media Handling:

    • Queries now specifically handle media checks with med_id instead of media, improving clarity on what is being checked.
  • Removed Redundant Code:

    • The updated queries eliminate the use of the ORDER BY clause in favor of using fetch first :limitRecords rows only, streamlining the logic.
  • Consistent Naming:

    • Entity fields have been renamed for better readability, aligning with the database schema (e.g., elt_id, med_id, trd_id, ado_id, cad_id).
  • Overall Structure:

    • The overall structure of method signatures remains consistent, ensuring that functionality is preserved while improving underlying code quality.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

Copy link
Contributor

Plan Result (stg)

Plan: 0 to add, 2 to change, 0 to destroy.
  • Update
    • module.postgresql_flexible.azurerm_log_analytics_workspace.pgsql_log_analytics_workspace[0]
    • module.postgresql_flexible.azurerm_monitor_diagnostic_setting.pgsql_diag[0]
Change Result (Click me)
  # module.postgresql_flexible.azurerm_log_analytics_workspace.pgsql_log_analytics_workspace[0] will be updated in-place
  ~ resource "azurerm_log_analytics_workspace" "pgsql_log_analytics_workspace" {
        id                                      = "/subscriptions/74dacd4f-a248-45bb-a2f0-af700dc4cf68/resourceGroups/darts-stg-rg/providers/Microsoft.OperationalInsights/workspaces/darts-api-stg-workspace"
        name                                    = "darts-api-stg-workspace"
      ~ tags                                    = {
          - "application"  = "darts" -> null
          - "builtFrom"    = "https://github.com/HMCTS/darts-shared-infrastructure.git" -> null
          - "businessArea" = "Cross-Cutting" -> null
          - "environment"  = "staging" -> null
        }
        # (15 unchanged attributes hidden)
    }

  # module.postgresql_flexible.azurerm_monitor_diagnostic_setting.pgsql_diag[0] will be updated in-place
  ~ resource "azurerm_monitor_diagnostic_setting" "pgsql_diag" {
        id                             = "/subscriptions/74dacd4f-a248-45bb-a2f0-af700dc4cf68/resourceGroups/darts-stg-rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/darts-api-stg|darts-api-stg-to-log-analytics"
        name                           = "darts-api-stg-to-log-analytics"
        # (5 unchanged attributes hidden)

      - metric {
          - category = "AllMetrics" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }

        # (6 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

Copy link
Contributor

Plan Result (prod)

Plan: 0 to add, 2 to change, 0 to destroy.
  • Update
    • module.postgresql_flexible.azurerm_log_analytics_workspace.pgsql_log_analytics_workspace[0]
    • module.postgresql_flexible.azurerm_monitor_diagnostic_setting.pgsql_diag[0]
Change Result (Click me)
  # module.postgresql_flexible.azurerm_log_analytics_workspace.pgsql_log_analytics_workspace[0] will be updated in-place
  ~ resource "azurerm_log_analytics_workspace" "pgsql_log_analytics_workspace" {
        id                                      = "/subscriptions/5ca62022-6aa2-4cee-aaa7-e7536c8d566c/resourceGroups/darts-prod-rg/providers/Microsoft.OperationalInsights/workspaces/darts-api-prod-workspace"
        name                                    = "darts-api-prod-workspace"
      ~ tags                                    = {
          - "application"  = "darts" -> null
          - "builtFrom"    = "https://github.com/HMCTS/darts-shared-infrastructure.git" -> null
          - "businessArea" = "Cross-Cutting" -> null
          - "environment"  = "production" -> null
        }
        # (15 unchanged attributes hidden)
    }

  # module.postgresql_flexible.azurerm_monitor_diagnostic_setting.pgsql_diag[0] will be updated in-place
  ~ resource "azurerm_monitor_diagnostic_setting" "pgsql_diag" {
        id                             = "/subscriptions/5ca62022-6aa2-4cee-aaa7-e7536c8d566c/resourceGroups/darts-prod-rg/providers/Microsoft.DBforPostgreSQL/flexibleServers/darts-api-prod|darts-api-prod-to-log-analytics"
        name                           = "darts-api-prod-to-log-analytics"
        # (5 unchanged attributes hidden)

      - metric {
          - category = "AllMetrics" -> null
          - enabled  = false -> null

          - retention_policy {
              - days    = 0 -> null
              - enabled = false -> null
            }
        }

        # (6 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

@Ben-Edwards-cgi Ben-Edwards-cgi merged commit 06e0940 into master Feb 3, 2025
10 checks passed
@Ben-Edwards-cgi Ben-Edwards-cgi deleted the DMP-4550 branch February 3, 2025 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants