Query History
Query History is a record of the database queries that have been run, capturing details about what was requested, by whom, and when. In platforms such as Snowflake, it is made available as a view or function that lets authorized users look back at past activity across dimensions like time, user, session, or compute resource. It is primarily an operational and auditing aid rather than a regulatory instrument in itself.
Query History refers to system-generated metadata describing executed queries against a data platform, typically exposed for retrospective analysis by dimensions such as time range, session, user, and warehouse. In the Snowflake platform specifically, it is surfaced through the Account Usage QUERY_HISTORY view and through table functions including QUERY_HISTORY and QUERY_HISTORY_BY_SESSION, which return queries within a specified time range (or a specified session and time range) subject to platform-defined retention windows and access privileges. From a governance perspective, query history can support data lineage understanding, access auditing, and demonstrable accountability, and it overlaps with information security monitoring where it informs access review and anomaly detection; the two domains should not be collapsed, as the record itself is a governance and observability artifact rather than a security control. This definition is scoped to the general concept and its Snowflake implementation as described in the evidence; it does not address the specific retention duration, the precise privileges required to access these objects, cross-platform equivalents, or whether captured query text may itself constitute personal data. Where query text or bound parameters contain personal or special category data, the history record may fall within data protection obligations, and such treatment depends on jurisdiction and implementation and is out of scope here.
Why it matters
Query History provides a retrospective record of what was asked of a data platform, by whom, and when, which underpins several governance functions at once. It supports data lineage understanding by showing how data was accessed and transformed, it enables access auditing by attributing queries to specific users and sessions, and it contributes to demonstrable accountability. That last point matters because accountability under most governance frameworks requires evidence of what actually happened rather than a stated intent to control access; a query history record is one form of such evidence, though it is not sufficient on its own.
Query History also sits at the boundary between data governance and information security without belonging entirely to either. The record itself is a governance and observability artifact, but it can feed security processes such as access reviews and anomaly detection. These domains overlap here, yet they should not be collapsed: query history informs security monitoring, but it is not itself a security control. Treating a passive record as though it enforced anything would misstate its function.
One further consideration deserves care. Where query text or bound parameters contain personal or special category data, the history record may itself fall within data protection obligations. Whether it does depends on jurisdiction and implementation, and that question is out of scope for this concept. Practitioners should not assume that query history is neutral metadata in every case; the content of the captured queries can change its regulatory treatment.
Who it's relevant to
Inside Query History
Common questions
Answers to the questions practitioners most commonly ask about Query History.