Develop > Tailoring Best Practices > Queries > Where are queries used?

Where are queries used?

There are several places within Service Manager where you can tailor queries. You should review any custom queries in these areas to ensure they are as efficient as possible:

  • Background processes
  • Global lists
  • Links
  • Format controls

Service Manager runs these queries frequently because they are either part of a scheduled task or common user actions trigger them.

Queries in background processes

Most background processes issue queries to your RDBMS at regularly scheduled intervals.While these queries already have proper indexes in an out-of-box system, you may consider limiting how often these queries run or eliminating them entirely if your system does not use them. You should review the following background processes to determine how often your system needs to run them:

  • Agent (not started in an out-of-box system)
  • Marquee (not started in an out-of-box system)
  • Lister

You can control how often these background processes run from the Service Manager schedule record. You can set these processes to run infrequently or never run at all if they are not needed. See the Service Manager help for more information.

Queries in global lists

Because Service Manager often builds global lists at startup, the total number of global lists you have determines how long your system spends generating these lists. If you have custom global lists, you should verify that they are still in use and if not clear the Build List at Startup option. Reducing the number of global lists you build reduces the number of queries your system has to run and will result in improved login performance.

In addition, you should verify that your custom global list query returns a useful number of results. The more items there are in a global list the more memory a Service Manager client requires to display them. Consider tuning your global list queries to return a manageable number of results to improve your system's performance.

Queries in links

Because link queries are run frequently, it is essential that you index them correctly and write the queries with the most restrictive fields first in the search order. You can also reduce the amount of computation needed to create links results by minimizing the use of pre- and post-link expressions.

Queries in Format Control

You can use Format Control to specify the conditions that trigger a query to run. It is most efficient if you only run queries when they are needed. For example, if you plan to use query results during the addition or update of a record, then set the Format Control conditions so that the query only during add or update operations. The same suggestion applies to any custom Format Control calculations and subroutines you use. Verify that you need the custom query and that it runs only when it is needed. By restricting the conditions under which a Format Control query runs you minimize unnecessary calls to the RDBMS and keep system resources free for other operations.