Data Warehouse

Snowflake Query Result Sets Available to Users via History

Snowflake Query Result Sets Available to Users via History

As promised in the previous post from Kent Graziano, here is a deeper dive into one of the top 10 cool features from Snowflake:

#10 Result sets available via History

There are a lot of times when you want to make a small change to your large query, and want to be able to see the effect of a change quickly without rerunning the previous query. This is hard in most systems because you have to rerun the previous query, using up resources and time. Our solution allows users to view the result sets from queries that were executed previously, via history. One benefit users get is that if they had already executed a complex query that took some amount of time to execute, the user doesn’t have to run the query again to access the previous results. They can just go back to the history, and access the result set. This is also beneficial when working on a development project using the data warehouse. Developers can use the result set history to compare the effects of changes to the query or to the data set, without running the previous queries again.

How to access the Result Set History

Once you execute a query, the result set will persist in the history of the user for 24 hours. This even includes queries executed through interfaces outside the Snowflake UI, like BI tools, JDBC, ODBC, etc.

To get to these results, you can go to the History page in the Snowflake web UI:

History

Find the query you want to recall then click on the hyper-linked Query Id. This will then let you see the details about the query plus the data it pulled.

Persitant Result Set

Easy!

How does it work?

Every time a query is run in Snowflake, the query is assigned an ID. This ID along with the resulting data set is typically stored in the same place as the Metadata repository. All data is encrypted at rest and in transit. This is performed as a simultaneous operation to sending the result back to the user. In case of a large resultant data set, the results may be stored in S3. Because of the elasticity of S3 storage, this approach allows Snowflake to retain any size result set. For a query, that was run successfully, the result is kept for 24 hours, after which the results are cleaned up based on a FIFO method.

What does this mean for the user?

It may seem like a minor addition to some but it is very convenient to pull up a resultset from a previous query without having to execute the query a second time. This saves time and processing (and therefore saves $$$), another way in which Snowflake provides significant value over traditional data warehouse solutions, slashing costs, and eliminating complexity.

P.S. Keep an eye on this blog site, our Snowflake Twitter feed (@SnowflakeDB), (@kentgraziano), and (@cloudsommelier) for more Top 10 Cool Things About Snowflake.

- Kent Graziano and Saqib Mustafa

Share Article

Handle Unpredictable or Ad Hoc Queries with the Query Acceleration Service

Our Query Acceleration Service is now generally available—which is great for customers handling mixed workloads, unpredictable query data volumes, and ad hoc queries.

Access PyPI Packages in Snowpark via UDFs and Stored Procedures

Snowflake now allows developers, data engineers and data scientists to use Python packages from PyPI as part of UDFs and stored procedures.

Analyze Your Query Performance Like Never Before with Programmatic Access to Query Profile

The Query Profile has been available in Snowsight, and we are excited to announce the Public Preview of programmatic access to Query Profile. Learn more here.

Industry Benchmarks and Competing with Integrity

TPC-DS at 100TB & 10TB Scale Now Available in Snowflake Samples

100 TB and 10TB versions of TPC-DS data, along with samples of the benchmark's 99 queries, are available now as sample data sets in Snowflake.

Snowflake Ventures Invests in Omni to Empower Self-Service Business Intelligence and Data Modeling

This allows customers to extract more value from their data, faster.

Observability for Telecoms: It's All About the Data

Observability for Telecoms: It's All About the Data Description: Observability in telecom means using new tools and data to gain complete view of complex networks, ensuring reliability and optimal QoS for customers. Read more.

Understanding Snowflake’s Shared Responsibility Model

With the Snowflake Shared Responsibility Model, users have a comprehensive view of security obligations along with measures Snowflake takes to protect user data.

Data Replication into Snowflake with Oracle GoldenGate | Snowflake Blog

There a many different use cases for continuous data replication into Snowflake, including storing all transactional history in a data lake.

Subscribe to our blog newsletter

Get the best, coolest and latest delivered to your inbox each week

Where Data Does More

  • 30-day free trial
  • No credit card required
  • Cancel anytime