Debugging SQL and slow queries can help you resolve slowness issues in an instance.

When you debug an instance, you can either enable SQL debugging to look for slow queries or you can look for slow queries by checking the Slow Queries [sys_query_pattern] table by navigating to System Diagnostics > Stats > Slow Queries. This table stores all the slow queries in the instance.

When you search the table, look for queries that contain domain_path to determine if any slow queries are due to the domain path in your instance.

If you do find slow queries, try to analyze why they are slow.

Common reasons for slow queries

  • A query has too many OR conditions (for more information, see Contains queries and domain access). In the domain hierarchy, place the user or a domain at a hierarchy level where contains or visibility is not needed.
  • The query method is not the domain path query method (for more information, see Domain paths query method): If you are not using the domain path query method, contact Customer Service and Support.
  • A query needs a database to be indexed so you can see what is in the database quickly. If you can identify the slow query, run the "explain plan" to see if there are options for indexing available. The "explain plan" is a function of SQL that shows the query and what is going on with it.