---
sourceDocument: Brazil Platform Analytics
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/now-intelligence

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Platform Analytics

ft:clusterId :

    - par

bundleId :

    - par

workflow :

    - Platform


---

# Manual segment data model and sync behavior

# Manual segment data model and sync behavior {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Manual segment data model and sync behavior

Manual segments in ServiceNow use a two-table data model separating configuration and runtime data to optimize search performance while maintaining a single source of truth.
The configuration table (snquerygensegmenttableconfig) stores manual segment definitions created by administrators, and the runtime table (snquerygensegment) is automatically synchronized for search operations.
Show full answer Show less  

## Configuration Table Details

The **snquerygensegmenttableconfig** table includes key fields to define manual segments:

* **Name:** User-friendly segment name matched by the LLM during semantic search (required).
* **Active:** Indicates if the segment is active; inactive segments are excluded from search (defaults to true).
* **Description:** Optional explanatory text to help the LLM understand segment usage.
* **Filter:** Encoded query defining segment filter conditions using the condition builder (required).
* **Domain:** Specifies domain when domain separation is enabled; segments are filtered by user domain context.
* **Entity:** The table the segment applies to, which must be enabled for semantic generation.

## Runtime Table and Sync Behavior

The runtime table (**snquerygensegment**) is automatically synced with the configuration table and is used during search queries. This table is read-only and inherits fields from the configuration table along with resolved entity references.

Synchronization is triggered by:

* Insert or update of manual segment configuration records (async sync of individual records)
* Insert or update of entities with active status (re-sync all segments for that entity)
* Weekly scheduled job performing full sync and cleanup of orphaned records

Segments are eligible for syncing and activation only if both the manual segment and its entity are active. Deactivated segments are excluded from search results.

## Activation and Deactivation

* Setting a manual segment's active field to false deactivates the synced segment.
* Reactivating the manual segment also reactivates the synced segment if the entity is active.
* Deactivating an entity disables all its related segments.
* Deleting manual segment configs or entities results in removal or cleanup of synced segments.

## Access Control and Best Practices

* The runtime segment table enforces strict ACLs to maintain the configuration table as the single source of truth, blocking direct creation or modification of synced segments.
* Filters in the configuration support up to 4,000 characters, but are truncated to 2,000 characters by default in LLM prompts; keep filters concise for optimal performance.
* Consider splitting complex filters into multiple focused segments rather than one large filter.

## Domain Separation

When domain separation is enabled, segments are assigned to specific domains and filtered by the user's domain context at search time. If domain separation is not enabled on your instance, domain fields can be ignored.  
Manual segments use a two-table data model with automatic synchronization between the configuration table and the runtime table used for search operations.

## Data model overview {#manual-segment-data-model-sync__data-model-overview}

Manual segments use a two-table architecture that separates configuration from runtime data. This design ensures that the configuration table remains the single source of truth while the runtime table is optimized for search performance.{#manual-segment-data-model-sync__data-model-intro}

configuration table: sn_query_gen_segment_table_config
:   This is where you define manual segments. Each record represents one segment configuration that administrators create and maintain.

Synced table: sn_query_gen_segment
:   You do not write to this table directly. When a manual segment config is created or updated, a business rule automatically syncs it into this table, which is queried at search time.
{#manual-segment-data-model-sync__table-descriptions}

## Configuration table fields {#manual-segment-data-model-sync__config-table-fields}

The sn_query_gen_segment_table_config table contains the following fields for defining manual segments:{#manual-segment-data-model-sync__config-table-intro}
{#manual-segment-data-model-sync__config-table-structure__entry__5}

| Field | Column Name | Max Length | Required | Purpose |
|-|-|-|-|-|
| Name | name | 255 chars | Yes | User-friendly name that the LLM matches against during semantic search. |
| Active | active | --- | No | Defaults to true. When false, the segment is deactivated and excluded from search. |
| Description | description | 4,000 chars | No | Optional clarification using commonly-used terms. Helps the LLM understand when to apply the segment. |
| Filter | filter | 4,000 chars | Yes | Encoded query defining the segment's filter conditions. Uses the condition builder (v2). |
| Domain | sys_domain | --- | No | On domain-separated instances, specify here the domain to which the segment applies. At search time, segments are filtered by the user's domain context. |
| Entity | table_name | --- | Yes | The table (entity) that the segment applies to. The table must have a record in the Semantic Table Configurations \[sn_query_gen_table_config\] table. The value of Enable Semantic Generation on that record must be <kbd class="ph userinput">true</kbd>. |
[Table 1. Manual segment configuration table fields]

{#manual-segment-data-model-sync__config-table-structure}

## Synced table fields {#manual-segment-data-model-sync__synced-table-fields}

The sn_query_gen_segment table contains the runtime data used for search operations:{#manual-segment-data-model-sync__synced-table-intro}
{#manual-segment-data-model-sync__synced-table-structure__entry__2}

| Field | Source |
|-|-|
| name | Copied from manual segment config |
| description | Copied from manual segment config |
| filter | Copied from manual segment config |
| table | From table_name |
| entity | Resolved reference to sn_query_gen_entity |
| source_table | Always sn_query_gen_segment_table_config |
| source_id | Sys_id of the manual segment config record |
| active | `manual_segment.active AND entity.active` |
[Table 2. Synced segment table fields]

{#manual-segment-data-model-sync__synced-table-structure}

## Sync behavior {#manual-segment-data-model-sync__sync-behavior}

Manual segments are synced automatically between the configuration and runtime tables. You do not need to trigger synchronization manually.{#manual-segment-data-model-sync__sync-intro}
{#manual-segment-data-model-sync__sync-triggers__entry__3}

| Trigger | When | What Happens |
|-|-|-|
| Business rule on config | Insert or update on sn_query_gen_segment_table_config | Syncs the individual record into sn_query_gen_segment (async) |
| Entity insert/update | When an entity is created or updated with active=true | Re-syncs all segments (including manual) for that entity |
| Weekly scheduled job | Saturdays at midnight | Full sync of all 6 segment sources; cleanup of orphaned records |
[Table 3. Sync triggers]

{#manual-segment-data-model-sync__sync-triggers}

During sync, a manual segment is eligible if:{#manual-segment-data-model-sync__eligibility-check}

1. active = true on the config record
2. The referenced table has an active entity in sn_query_gen_entity

{#manual-segment-data-model-sync__eligibility-criteria}

If either condition is not met, the synced segment is deactivated (not deleted).{#manual-segment-data-model-sync__eligibility-result}

## Activation and deactivation {#manual-segment-data-model-sync__activation-deactivation}

A synced segment's active status is: `manual_segment.active AND entity.active`.{#manual-segment-data-model-sync__activation-formula}
{#manual-segment-data-model-sync__activation-events__entry__2}

| Event | Result |
|-|-|
| Manual segment config active → false | Synced segment deactivated |
| Manual segment config active → true | Synced segment reactivated (if entity is also active) |
| Entity active → false | All segments for that entity deactivated |
| Manual segment config deleted | Synced segment deleted |
| Entity deleted | Orphaned segments cleaned up by scheduled job |
[Table 4. Activation and deactivation events]

{#manual-segment-data-model-sync__activation-events}

Deactivated segments are excluded from search results.{#manual-segment-data-model-sync__deactivation-note}

## ACL protections {#manual-segment-data-model-sync__acl-protections}

The synced segment table has strict ACLs so that the configuration table remains the single source of truth:{#manual-segment-data-model-sync__acl-intro}

* **Create:** Blocked (admin_overrides = false) --- segments can only be created via sync
* **Write to name:** Blocked --- must be changed on the config record
* **Write to description:** Blocked --- must be changed on the config record
{#manual-segment-data-model-sync__acl-restrictions}

## Filter length considerations {#manual-segment-data-model-sync__filter-length-considerations}

While the filter field supports up to 4,000 characters, the system property sn_query_gen.segments.max_filter_length defaults to 2,000. Filters longer than this threshold are truncated when included in the LLM prompt.{#manual-segment-data-model-sync__filter-length-intro}  
Tip:  
Keep filters concise for best results. Consider splitting complex segments into multiple focused segments instead of creating one segment with many conditions.

## Domain separation {#manual-segment-data-model-sync__domain-separation}

Manual segments support domain separation. When creating a segment config record with a specific sys_domain, the synced segment inherits that domain. At search time, segments are filtered by the user's domain context.{#manual-segment-data-model-sync__domain-separation-intro}

If domain separation is not enabled on your instance, this field is inactive and can be ignored.{#manual-segment-data-model-sync__domain-separation-note}
**Related concepts**   

* [Guidelines for segments](https://servicenow-prod.fluidtopics.net/zrzfEZ8GeWveVYIP2xo1bg "Follow these suggestions to help you use segments in the semantic layer effectively.")  
**Related tasks**   

* [Create a manual segment](https://servicenow-prod.fluidtopics.net/bCxcKK~4dXP8WP9xrM~bzw "Manual segments are admin-created saved searches with friendly names that bridge natural language questions and database filters for the Query Generation semantic layer.")  
**Related reference**   

* [Query Generation properties](https://servicenow-prod.fluidtopics.net/h9tHOx4wzidQTMJcxnaHuA "The properties included with Query Generation apply to segments. They define whether the record or indicator that is the basis for a segment has been recently used or changed.")

