page303
391
Figure 10-9.
View v_client_info object dependencies
Object dependencies may exist across more than one database in an account.
Snowflake maintains object dependency metadata in the Account Usage Store view
object_dependencies
. Note that latency of up to three hours may be experienced.
SELECT referenced_database||'.'||
referenced_schema||'.'||
referenced_object_name AS path_to_object,
dependency_type
FROM snowflake.account_usage.object_dependencies
WHERE referencing_database = 'TPC'
AND referencing_schema = 'TPC_OWNER'
AND referencing_object_name = 'V_CLIENT_INFO'
ORDER BY 1;
A more sophisticated method for deriving object dependencies involves the use of a
“tree walk” where a top-level object is named, and all child dependencies are resolved.
Note the inclusion of both parent and child attributes.
SELECT referenced_database||'.'||
referenced_schema||'.'||
referenced_object_name AS path_to_object,
referencing_database||'.'||
referencing_schema||'.'||
referencing_object_name AS path_to_parent,
dependency_type
ChapTer 10
OpTimizing perfOrmanCe