Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

One Appfire Support Knowledge Base
Results will update as you type.
  • Unable to apply change 'type: removal, object: JiraCustomField' on JIRA 7.2
  • Unable to apply change 'type: addition, object: JiraConfigurationRoot#root/AgileSprint
  • The ID of a configuration object "X" deployed with CMJ is differs from the id of the same object on source
  • "Problem/Incident" issue link type duplicated
  • ORA-00955: name is already used by an existing object
  • How to fix Integrity Check violation in reference to missing custom fields from the database [PS]
  • Ranking Jira issues does not work after a deployment because of unreleased Lexorank locks
  • Snapshot deployment fails with: IllegalArgumentException: Passed List had more than one value
  • Cannot change feature 'isSubtask' for Issue Type
  • Capability CUSTOMER_INVITE_EMAIL_SUPPRESSED is set more than once for service desk project
  • ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory not found from bundle
  • CMJ Field layout scheme entity - DB misconfiguration
  • Missing board filter with id 'xxxxx'
  • License update failed. License is malformed!
  • java.lang.OutOfMemoryError: GC overhead limit exceeded
  • Jira Agile is required when deploying project(s) with no usages of Jira Agile/Software objects
  • java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  • Migrating a JSM Project when JSM is not installed in Target Instance
  • New custom field IDs are different after deploying a snapshot
  • Issue comment is not visible to the admin
  • Custom Field Context in CMJ
  • Project deployment using the Configuration Manager for Jira app fails with the error "Creation failed for email channel"
  • Due to Insight app dependency with CMJ UPM disables and enables all core system plugins while upgrading the CMJ app
  • CMJ: SQL exception thrown during a snapshot deployment
  • Missing watchers in the target instance after deployment
  • Configuration Manager for Jira - Snapshot cannot be deployed because of a disabled plugin
  • How to rebuild an index after node failure due to failed Import
  • Custom events of a notification scheme are not migrated with Configuration Manager for Jira (CMJ)
  • Configuration Manager for Jira - Request Terminated
  • Configuration Manager for Jira - browser closed during a deployment unexpectedly
  • Scriptrunner's Single Custom Picker is not working in JSM form after snapshot deployment
  • Incorrect resolution ID mapping during post-function migration
  • Optimizing Migration Time for Large Jira Instances Using Configuration Manager for Jira (CMJ)
  • Integrity Check Error: Object refers to a missing user
  • How to troubleshoot broken version sequences Error while deploying snapshot through Configuration Manager for Jira.
  • Best practices for when an instance is locked up during a migration with Project Configurator for Jira
    • How-to articles [PS]
      • Configuration Manager for Jira | Jira Sprint behavior during migrations
      • Best practices when statuses mismatch during Jira project migrations using CMJ
      • How parallel sprints are managed by the Configuration Manager for Jira app on instances with different configurations
      • How to fine tune an SQL Query
      • How to configure PostgreSQL data source profile in the SQL for Confluence app.
      • Configure Gmail as SMTP profile for outgoing emails in Jira and Confluence.
      • How to make REST API call to create and deploy snapshot using Postman [SUPPORTS]
      • How to fix missing lingo ID error when exporting a project in Configuration Manager for Jira
      • How to solve NullPointerException: null keys are not permitted error using Configuration Manager for Jira
      • How to resolve zip END header not found error
      • How to fix an issue when custom fields are getting locked
      • Selecting multiple projects via REST API when creating snapshot
      • How to address Duplicate object Event 'Issue Archived' has duplicates error
      • How to capture JavaScript console logs for Botron apps
      • How to fix a sprint's activated date which is not exported as part of a migration [PS]
      • How to make REST API call to create and deploy snapshot using Postman
      • Deploying on Jira instance with different language
      • Implicit addition of boards and filters in snapshot
      • Configuration Manager for Jira - Difference between the Select Apps page and the Missing Plugins page
      • How to migrate newly created comments in the source instance when the snapshot is already deployed in the target instance
      • "Edge would induce a cycle" error during snapshot deployment
      • Performance issues during the Configuration Manager for Jira deployment
      • How to check the progress of a running deployment if the window is closed
      • Using Configuration Manager for Jira while behind a firewall
      • Handling Automation for Jira during Server-to-Server Migrations
      • Configuration Manager for Jira - Data Center VS Cloud Versions
      • Handling Advanced Roadmaps for Jira issue links during DC to DC migrations
      • How to create a CMJ snapshot that contains Filters and Dashboards only.
      • Missing Service Project sidebar bar after succesfully deploying a snapshot
      • CMJ: migrate a required group of issues only
      • How to avoid creating a new context when the same snapshot is deployed multiple times.
      • FAQ on why "Export All Users to CSV" returns a 403 Error in Delegated Group Management for Jira App in Data Center?
      • How to fix No FieldLayoutScheme found for id XXXXX during deployment
      • How to split snapshots for large instances
  • Sprint Column Layout issues when deploying a snapshot
  • Configuration Manager for Jira - Xray exports all custom fields, issue types and statuses from the Jira instance
  • Integrity Check - Request type permissions not found for request type ID
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    How to fine tune an SQL Query
    Updated Oct 31, 2023

    How to fine tune an SQL Query

    This article provides guidance to help you resolve issues encountered during SQL queries and offers insights on fine-tuning SQL queries effectively.

    1. Aliasing Issue in Query

    At times, when executing SQL queries containing aliases in an SQL Integrated Development Environment (IDE), users may encounter challenges. This often occurs as depicted in the example below:

    In such instances, the recommended approach is to run the query without aliasing, as illustrated below. Removing the aliases can enhance the query's compatibility and ensure smooth execution.

    SELECT pp.username , pp.pagename , pp.id, COUNT(pc.portalpage) AS dataplane_gadgets FROM portletconfiguration pc LEFT JOIN portalpage pp ON pc.portalpage = pp.id WHERE pc.gadget_xml LIKE '%dataplane%' GROUP BY pp.username, pp.pagename, pp.id ORDER BY pp.username, dataplane_gadgets DESC;

    2. Query not executing in a database or taking longer time to execute

    When faced with issues related to SQL queries not executing or taking significantly longer to execute than usual, employing the 'Explain Analyze' keyword before the query can provide invaluable insights. This method offers detailed runtime statistics, including the total elapsed time spent within each plan node (in milliseconds) and the total number of rows returned.

    Additionally, optimizing query execution often involves creating appropriate indexes, especially for tables or columns housing millions of records. Proper indexing significantly improves the efficiency of query processing, ultimately enhancing overall database performance

    2.1. Indexing

    You have the option to create the index manually or utilize the 'REINDEX' command to automatically generate the index on the specified table.

    CREATE INDEX index_name ON table_name (column_name);
    REINDEX TABLE <table> ;

    The distinction between the two operations lies in their core functionalities. The REINDEX command is employed to rebuild existing indexes, a process designed to eliminate fragmentation or corruption within the database. Although this procedure can be resource-intensive, it significantly enhances query performance on the reconstructed index. On the other hand, the CREATE INDEX command is utilized to establish new indexes tailored for specific search conditions. While the creation of an index demands resources during its initialization, it offers a lasting improvement in query performance for the designated columns, optimizing database operations in the long term.

    2.2. Dead Tuple

    Another factor that can contribute to prolonged query execution in a database is the presence of a significant number of dead tuples, particularly when dealing with tables containing millions of records. You can assess the ratio of live to dead tuples using the following query.

    SELECT schemaname,relname,n_live_tup,n_dead_tup FROM pg_stat_user_tables ORDER BY n_dead_tup DESC limit 10;

    To eliminate dead tuples from tables and optimize the database, it is advisable to perform database vacuuming. This can be accomplished using the following commands, which can be applied to individual tables or the entire database.

    VACUUM (VERBOSE, ANALYZE) <table_name>;
    \c <database_name> VACUUM (VERBOSE, ANALYZE);

     

    • This article is tailored for PostgreSQL databases.

    • While the specific query syntax may vary for other database systems, the underlying concept remains consistent across different platforms.

    {"serverDuration": 14, "requestCorrelationId": "3ee6036edfbd466eaee84adb4c1d161b"}