Behavior of Queries Without sysparm_query_categorySummary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } This article explains what happens when a REST API, SOAP API, GlideRecord, or other query does not include the parametersysparm_query_category (or sysparm_read_replica_category).This complements the existing “Introduction to Read Replica Databases” documentation by explicitly covering the default behavior. Important Note If a query does not specify a database category (such as sysparm_query_category or sysparm_read_replica_category), the query will always be routed to the primary database. This is true for: Table API (GET)Aggregate APIAttachment API (GET)Custom REST API scripts that use GlideRecordScripted GlideRecord calls in Business Rules, Script Includes, Flow Actions, etc.SOAP APIs Details 1. Default Query Routing ServiceNow uses database categories to decide whether a SQL query should run on: The primary database, orA read replica (when available) If no category is provided, the platform uses the default routing rules, which always prioritize the primary database. Default Behavior:Queries without a sysparm_query_category always go to the primary database. 2. When a Read Replica Will Not Be Used A query will not use a read replica if any of the following are true: sysparm_query_category is not included in the requestThe provided category name does not existThe category exists but is inactiveReplication lag is above the threshold for that categoryCustomer does not have read replicas provisionedThe query includes an insert, update, delete, or replace operation (writes always go to the primary)Category exist and enabled, But not mapped to Secondary DB pool. 3. How to Confirm Which Database Was Used You can confirm which database serviced a SQL query by checking the application node localhost logs. If the log line shows a connection like: glide.[x] → The query was serviced by the primary database. If it shows: pool_member.[x]read-replica.[x] → The query ran on a read replica. If no category was provided, you should always see glide.[x]. 4. Example Query without category GET /api/now/table/change_request?sys_id=... No sysparm_query_category → routed to primary database. Query with category GET /api/now/table/change_request?sys_id=...&sysparm_query_category=reporting If the “reporting” category is active and lag is within threshold → routed to read replica. Why This Matters If an integration expects immediate consistency, it should not use a read replica and should avoid specifying sysparm_query_category. On the other hand, analytics or reporting integrations that tolerate slight replication delay can improve performance by explicitly using the category parameter. Key Takeaway If sysparm_query_category is not included in a query, the query always uses the primary database. This ensures consistent and up-to-date data for all default and business-critical operations. Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Introduction to Read Replica Databases https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0824441