Using Persisted Query Results¶ When a query is executed, the result is persisted (i.e. Cached) for a period of time (currently 24 hours). At the end of the time period, the result is purged from the system. Snowflake uses persisted query results to avoid re-generating results when nothing has changed (i.e. “retrieval optimization”). The user executing the query has the necessary access privileges for all the tables used in the query. The new query syntactically matches the previously-executed query. The table data contributing to the query result has not changed. The persisted result for the previous query is still available. Using Persisted Query Results¶ When a query is executed, the result is persisted (i.e. Cached) for a period of time (currently 24 hours). At the end of the time period, the result is purged from the system. Snowflake uses persisted query results to avoid re-generating results when nothing has changed (i.e. “retrieval optimization”).
When a query is executed, the result is persisted (i.e. cached) for a period of time (currently 24 hours). At the end of the time period, the result is purged from the system.
Snowflake uses persisted query results to avoid re-generating results when nothing has changed (i.e. “retrieval optimization”).
Red.fuel.jump.starter.sl161.user.manual.pdf. In addition, you can use persisted query results to post-process the results (e.g. layering a new query on top of the results already calculated).
In this Topic: 1918426 anet a6 3d desktop printer english user manual.rar.
Retrieval Optimization¶
If a user repeats a query that has already been run, and the data in the table(s) hasn’t changed since the last time that the query was run, then the result of the query is the same.Instead of running the query again, Snowflake simply returns the same result that it returned previously. This can substantially reduce query time because Snowflake bypasses queryexecution and, instead, retrieves the result directly from the cache.
Typically, query results are reused if all of the following conditions are met:
Note
Meeting all these conditions does not guarantee that Snowflake reuses the query results.
By default, result reuse is enabled, but can be overridden at the account, user, and session level using the USE_CACHED_RESULT session parameter.
Note
Each time the persisted result for a query is reused, Snowflake resets the 24-hour retention period for the result, up to a maximum of 31 days from the date and time that the query was firstexecuted. After 31 days, the result is purged and the next time the query is submitted, a new result is generated and persisted.
Post-processing Query Results¶
In some cases, you might want to perform further processing on the result of a query that you’ve already run. For example:
Docs.snowflake.net Manuals User Guide Querying Persisted Results.html Pdf![]()
Post-processing can be performed using the RESULT_SCAN table function. The function returns the results of the previous query as a “table” and a new query can thenbe run on the tabular data.
Examples¶
Process the result of a SHOW TABLES command and extract the following columns and rows from the result:
Docs.snowflake.net Manuals User Guide Querying Persisted Results.html Review
Docs.snowflake.net Manuals User Guide Querying Persisted Results.html System
Additional examples are provided in RESULT_SCAN.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |