Skip to main content
Version: v12

View Relationships

Overview

The consumption views are already pre-joined for the common cases: v_findings carries asset, owner, and definition context directly, so most questions need no join at all (see Joining views in the query cookbook). This page is for the rest: BI tools that model relationships explicitly (Looker Studio, Tableau, Power BI) and any query that needs to reach a directory view or association not already flattened onto a core view.

Two things to keep in mind while reading the tables below:

  • Target PK is id for most views. A few views rename their primary key, for example v_owner_details.owner_id and v_request_details.request_id. Every FK column named *owner_id (risk_owner_id, remediation_owner_id, plain owner_id) joins to v_owner_details.owner_id.
  • Fact-like views don't fan out on their own. v_findings and v_assets are pre-aggregated to one row per entity. Fan-out only shows up when you join to a bridge view (for example v_asset_owner, v_ticket_finding) or unnest an array column. See Numeric id joins, never uid for the sentinel-row and skeleton-row rules that make these joins safe.

Core join graph

The most common analytical path: findings resolve to their asset and owners, and separately to their definition and CVE intelligence.

Every edge above is a foreign key documented in the tables below, except the v_finding_definitions-to-v_cve edge, which is many-to-many and goes through the v_definition_cve bridge view rather than a scalar FK column. The optional (o|) cardinality on the target side reflects that a foreign key can be absent (NULL) or resolve to a hidden internal placeholder row: a real target row isn't guaranteed, so use a LEFT JOIN and check for a missing match. See Sentinel rows in Core concepts.

Foreign keys on the core views

v_findings

FK columnTarget viewTarget PK
asset_idv_assetsid
definition_idv_finding_definitionsid
environment_idv_environmentsid
finding_type_idv_finding_typesid
risk_owner_idv_owner_detailsowner_id
remediation_owner_idv_owner_detailsowner_id
risk_scoring_model_idv_risk_scoring_modelsid
status_config_model_idv_status_config_modelsid
sla_definition_idv_sla_definitionsid

asset_id and environment_id are each a single pick (the first asset, the first environment) for a finding that could technically span more than one. environment_ids (array) carries the full set; unnest it if you need every environment a finding touches.

v_assets

FK columnTarget viewTarget PKNotes
asset_type_idv_asset_typesid
os_family_idv_os_familiesid
owner_idv_owner_detailsowner_idFirst confirmed owner only. Join v_asset_owner for the full owner set.
risk_owner_idv_owner_detailsowner_id
remediation_owner_idv_owner_detailsowner_id
risk_scoring_model_idv_risk_scoring_modelsid
status_config_model_idv_status_config_modelsid
sla_definition_idv_sla_definitionsid
environment_idv_environmentsidFirst environment only. Join v_asset_environment for the full set.
host_idv_assetsidSelf-join: parent Host asset.
package_idv_assetsidSelf-join: parent Package catalog entry (populated on InstalledPackage rows).
host_image_idv_assetsidSelf-join: parent HostImage.
image_idv_assetsidSelf-join: parent ContainerImage (populated on Container rows).

v_tickets

FK columnTarget viewTarget PK
sprint_idv_sprintsid
environment_idv_environmentsid

Foreign keys on context and threat-intel views

Source viewFK columnTarget viewTarget PK
v_business_servicesowner_idv_owner_detailsowner_id
v_cloud_accountsowner_idv_owner_detailsowner_id
v_finding_definitionsfinding_type_idv_finding_typesid
v_cve_detailscve_idv_cveid
v_cve_detailsfinding_idv_findingsid
v_cve_productscve_idv_cveid
v_cve_productscpe_idv_cpeid
v_threat_intelfinding_idv_findingsid
v_threat_inteldefinition_idv_finding_definitionsid
v_personsasset_type_idv_asset_typesid

Foreign keys on history and snapshot views

The change-history and snapshot views (see the Core concepts glossary for Event Table / State-Snapshot View definitions) carry the same foreign keys as their current-state counterparts:

Source viewFK columnTarget viewTarget PK
v_finding_historyidv_findingsid
v_finding_historyasset_idv_assetsid
v_finding_historydefinition_idv_finding_definitionsid
v_finding_historyrisk_owner_idv_owner_detailsowner_id
v_finding_historyremediation_owner_idv_owner_detailsowner_id
v_finding_historyenvironment_idv_environmentsid
v_asset_historyidv_assetsid
v_asset_historyrisk_owner_idv_owner_detailsowner_id
v_asset_historyremediation_owner_idv_owner_detailsowner_id
v_asset_historyenvironment_idv_environmentsid
v_asset_owner_historyasset_idv_assetsid
v_asset_owner_historyowner_idv_owner_detailsowner_id
v_finding_asset_historyfinding_idv_findingsid
v_finding_asset_historyasset_idv_assetsid
v_finding_asset_historydefinition_idv_finding_definitionsid
v_coverage_gapsenvironment_idv_environmentsid
v_mttr_slasla_definition_idv_sla_definitionsid
v_mttr_sla_by_envsla_definition_idv_sla_definitionsid
v_mttr_sla_by_envenvironment_idv_environmentsid

Many-to-many bridge views

Bridge views resolve a many-to-many relationship between two entity views. Both endpoint columns are join keys, and a bridge view has one row per confirmed pair. There are no sentinel rows, since an unresolved endpoint is dropped rather than pointed at "Unknown." See Bridge Table in the Core concepts glossary.

Asset bridges

Bridge viewLeft endpointLeft viewRight endpointRight viewNotes
v_asset_applicationasset_idv_assetsapplication_idv_assetsApplication is an asset subtype, so both endpoints resolve against v_assets.
v_asset_business_serviceasset_idv_assetsbusiness_service_idv_business_services
v_asset_domainasset_idv_assetsasset_domain_idv_asset_domains
v_asset_environmentasset_idv_assetsenvironment_idv_environmentsLatest snapshot only.
v_asset_informed_userasset_idv_assetsowner_idv_owner_details
v_asset_ownerasset_idv_assetsowner_idv_owner_detailsLatest snapshot, all confirmed owners (v_assets.owner_id is a single pick).
v_asset_profileasset_idv_assetsasset_profile_idv_asset_profiles
v_asset_installed_packageinstalled_package_idv_assetsasset_idv_assetsInstalledPackage and its target asset are both asset subtypes.
v_asset_subnetasset_idv_assetssubnet_idv_assetsSubnet is an asset subtype.
v_asset_technologyasset_idv_assetsasset_technology_idv_asset_technologies

Finding bridges

Bridge viewLeft endpointLeft viewRight endpointRight view
v_finding_risk_factorfinding_idv_findingsrisk_factor_idv_risk_factors
v_finding_informed_userfinding_idv_findingsowner_idv_owner_details
v_finding_definition_profilefinding_definition_idv_finding_definitionsfinding_profile_idv_finding_profiles
v_finding_definition_technologyfinding_definition_idv_finding_definitionsaffected_technology_idv_affected_technologies

Ticket, owner, and request bridges

Bridge viewLeft endpointLeft viewRight endpointRight viewNotes
v_ticket_findingticket_idv_ticketsfinding_idv_findingsLatest snapshot only.
v_ticket_prev_findingticket_idv_ticketsfinding_idv_findingsThe ticket's previous-finding association, not snapshotted.
v_ticket_userticket_idv_ticketsuser_idv_owner_details
v_owner_memberowner_idv_owner_detailsuser_idv_owner_detailsBoth endpoints resolve against v_owner_details.
v_request_findingrequest_idv_request_detailsfinding_idv_findings

Threat-intel bridges

Bridge viewLeft endpointLeft viewRight endpointRight view
v_definition_cvedefinition_idv_finding_definitionscve_record_idv_cve
v_cve_weaknesscve_idv_cveweakness_idv_cwe
v_definition_weaknessdefinition_idv_finding_definitionsweakness_idv_cwe
v_cve_attack_techniquecve_idv_cveattack_technique_idv_attack_techniques
v_cve_attack_patterncve_idv_cveattack_pattern_idv_attack_patterns
v_attack_technique_tacticattack_technique_idv_attack_techniquesattack_tactic_idv_attack_tactics
v_mitigation_techniquemitigation_idv_attack_mitigationsattack_technique_idv_attack_techniques
v_attack_pattern_weaknessattack_pattern_idv_attack_patternsweakness_idv_cwe

Self-referential hierarchy bridges

These three bridges walk a parent/child hierarchy within a single directory view.

Bridge viewChild endpointParent endpointView
v_weakness_parentweakness_idparent_weakness_idv_cwe
v_attack_technique_parentattack_technique_idparent_technique_idv_attack_techniques
v_attack_pattern_parentattack_pattern_idparent_pattern_idv_attack_patterns