Skip to main content

Resolving Service Portal Slowness Due to Unoptimized sysapproval_approver Queries

Issue

Service Portal pages may become unresponsive or load slowly due to inefficient database queries. In this case, slowness is linked to complex queries against the sysapproval_approver table, particularly in environments with high record volumes or insufficient indexing.

Release

All releases

Resolution

1) Profile slow queries

  • Use the DB Query Profiler or Slow Transaction Logs to identify queries with execution times exceeding 5+ seconds.
  • Look for queries hitting the sysapproval_approver table with high row scan counts.

2) Apply query rewrites (UNION replacement)

  • Rewrite complex OR-based queries using UNION clauses to split conditions.
  • This can improve index utilization and allow more efficient query execution.

3) Create composite indexes

  • Based on slow query analysis, create targeted indexes on the sysapproval_approver table (for example, combining frequently filtered columns like approver, state, or approval).
  • Use Index Advisor to validate performance gains.

The world works with ServiceNow.

View on ServiceNow