IP Library Granted Patent US 12,511,313
Granted Patent B2
US 12,511,313 · App. 18/806,986 · Granted Dec 30, 2025

Materialized view sub-database replication

Inventors: Pui Kei Johnston Chu (Richmond Hill, CA); Shreyas Narendra Desai (Bellevue, WA); German Alberto Gil Echeverri (San Francisco, CA); Prasanna Krishnan (Palo Alto, CA); Nithin Mahesh (Redmond, WA); Subramanian Muralidhar (Mercer Island, WA); Eric Robinson (Sammamish, WA); Sahaj Saini (Seattle, WA)
Assignee: Snowflake Inc.
G06F16/275G06F16/2282G06F16/2379G06Q30/0185G06Q30/0205
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,511,313
App. No.
18/806,986
Granted
Dec 30, 2025
Kind
B2
Abstract

A system for sub-table replication within a materialized view of a source data table. A materialized view of a source data table is generated based on a query, the source data table having a plurality of data table rows associated with a plurality of client identifiers and including an entitlements column and data content, the entitlements column including a plurality of provider account identifiers and a plurality of consumer account identifiers. An update to an entitlements table of the source data table is detected where the entitlements table includes a plurality of entitlements table rows and where the entitlements table rows are associated with the client identifiers, the consumer account identifiers, and the provider account identifiers. An update to the source data table based on the first update to the entitlements table is detected, and an incremental replication of the materialized view of the source data table is performed.

Claims (71)

1 . A computer-implemented method for sub-database replication, the method comprising:

receiving, by one or more processors, from a database user, an identification of a column in a data table of a first database for filtering;

clustering, by the one or more processors, the data table based on the column to generate one or more partitions sorted in the column;

accessing, by the one or more processors, metadata for the one or more partitions of the data table, the metadata indicating a minimum value and a maximum value for the column in each partition;

performing, by the one or more processors, file-level filtering of the one or more partitions based on the metadata without opening the one or more partitions;

selecting, by the one or more processors, a subset of table rows of the data table based on the file-level filtering;

performing, by the one or more processors, sub-database replication of filtered micro-partitions from the first database to a second database in a different region using the subset of table rows replication policy;

in response to determining, by the one or more processors, a new partition is being inserted during the sub-database replication, refreshing a materialized view of the second database by inserting the new partition into the materialized view; and

in response to determining, by the one or more processors, a deleted partition is being deleted during the sub-database replication, compacting the materialized view by removing the deleted partition from the materialized view.

2 . The computer-implemented method of claim 1 , wherein the data table comprises a plurality of data table rows associated with a plurality of client identifiers including data content.

3 . The computer-implemented method of claim 1 , wherein performing the file-level filtering comprises determining whether to replicate a partition based on the minimum value and the maximum value of the column in the metadata.

4 . The computer-implemented method of claim 1 , further comprising:

receiving, from the database user, a filtering behavior to be applied to the column.

5 . The computer-implemented method of claim 1 , wherein the first database is a primary database of the database user, and the second database is a secondary database of the database user.

6 . The computer-implemented method of claim 1 , wherein the sub-database replication further uses a replication policy to define objects to replicate to the second database.

7 . The computer-implemented method of claim 1 , wherein the sub-database replication is performed for a plurality of target accounts associated with a plurality of data consumers.

8 . The computer-implemented method of claim 1 , wherein the column is a customer identification column.

9 . The computer-implemented method of claim 1 , further comprising:

detecting an update to an entitlements table associated with the data table, wherein the entitlements table includes a plurality of entitlements table rows associated with client identifiers, consumer account identifiers, and provider account identifiers; and

performing incremental replication of the data table based on the update to the entitlements table.

10 . The computer-implemented method of claim 1 , further comprising:

detecting a change to the data table; and

updating the metadata for the one or more partitions affected by the change.

11 . A machine comprising:

at least one processor; and

at least one memory storing instructions that, when executed by the at least one processor, cause the machine to perform operations comprising:

receiving, by one or more processors, from a database user, an identification of a column in a data table of a first database for filtering;

clustering, by the one or more processors, the data table based on the column to generate one or more partitions sorted in the column;

accessing, by the one or more processors, metadata for the one or more partitions of the data table, the metadata indicating a minimum value and a maximum value for the column in each partition;

performing, by the one or more processors, file-level filtering of the one or more partitions based on the metadata without opening the one or more partitions;

selecting, by the one or more processors, a subset of table rows of the data table based on the file-level filtering;

performing, by the one or more processors, sub-database replication of filtered partitions from the first database to a second database in a different region using the subset of table rows;

in response to determining, by the one or more processors, a new partition is being inserted during the sub-database replication, refreshing a materialized view of the second database by inserting the new partition into the materialized view; and

in response to determining, by the one or more processors, a deleted partition is being deleted during the sub-database replication, compacting the materialized view by removing the deleted partition from the materialized view.

12 . The machine of claim 11 , wherein the data table comprises a plurality of data table rows associated with a plurality of client identifiers including data content.

13 . The machine of claim 11 , wherein performing the file-level filtering comprises determining whether to replicate a partition based on the minimum value and the maximum value of the column in the metadata.

14 . The machine of claim 11 , wherein the operations further comprise:

receiving, from the database user, a filtering behavior to be applied to the column.

15 . The machine of claim 11 , wherein the first database is a primary database of the database user, and the second database is a secondary database of the database user.

16 . The machine of claim 11 , wherein the sub-database replication further uses a replication policy to define objects to replicate to the second database.

17 . The machine of claim 11 , wherein the sub-database replication is performed for a plurality of target accounts associated with a plurality of data consumers.

18 . The machine of claim 11 , wherein the column is a customer identification column.

19 . The machine of claim 11 , wherein the operations further comprise:

detecting an update to an entitlements table associated with the data table, wherein the entitlements table includes a plurality of entitlements table rows associated with client identifiers, consumer account identifiers, and provider account identifiers; and

performing incremental replication of the data table based on the update to the entitlements table.

20 . The machine of claim 11 , wherein the operations further comprise:

detecting a change to the data table; and

updating the metadata for the one or more partitions affected by the change.

21 . A machine-storage medium storing instructions that, when executed by a machine, cause the machine to perform operations comprising:

receiving, by one or more processors, from a database user, an identification of a column in a data table of a first database for filtering;

clustering, by the one or more processors, the data table based on the column to generate one or more partitions sorted in the column;

accessing, by the one or more processors, metadata for the one or more partitions of the data table, the metadata indicating a minimum value and a maximum value for the column in each partition;

performing, by the one or more processors, file-level filtering of the one or more partitions based on the metadata without opening the one or more partitions;

selecting, by the one or more processors, a subset of table rows of the data table based on the file-level filtering;

performing, by the one or more processors, sub-database replication of filtered micro-partitions from the first database to a second database in a different region using the subset of table rows replication policy;

in response to determining, by the one or more processors, a new partition is being inserted during the sub-database replication, refreshing a materialized view of the second database by inserting the new partition into the materialized view; and

in response to determining, by the one or more processors, a deleted partition is being deleted during the sub-database replication, compacting the materialized view by removing the deleted partition from the materialized view.

22 . The machine-storage medium of claim 21 , wherein the data table comprises a plurality of data table rows associated with a plurality of client identifiers including data content.

23 . The machine-storage medium of claim 21 , wherein performing the file-level filtering comprises determining whether to replicate a partition based on the minimum value and the maximum value of the column in the metadata.

24 . The machine-storage medium of claim 21 , wherein the operations further comprise:

receiving, from the database user, a filtering behavior to be applied to the column.

25 . The machine-storage medium of claim 21 , wherein the first database is a primary database of the database user, and the second database is a secondary database of the database user.

26 . The machine-storage medium of claim 21 , wherein the sub-database replication further uses a replication policy to define objects to replicate to the second database.

27 . The machine-storage medium of claim 21 , wherein the sub-database replication is performed for a plurality of target accounts associated with a plurality of data consumers.

28 . The machine-storage medium of claim 21 , wherein the column is a customer identification column.

29 . The machine-storage medium of claim 21 , wherein the operations further comprise:

detecting an update to an entitlements table associated with the data table, wherein the entitlements table includes a plurality of entitlements table rows associated with client identifiers, consumer account identifiers, and provider account identifiers; and

performing incremental replication of the data table based on the update to the entitlements table.

30 . The machine-storage medium of claim 21 , wherein the operations further comprise:

detecting a change to the data table; and

updating the metadata for the one or more partitions affected by the change.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 16, 2024
From: CHU, PUI KEI JOHNSTON; DESAI, SHREYAS NARENDRA; GIL ECHEVERRI, GERMAN ALBERTO; KRISHNAN, PRASANNA; MAHESH, NITHIN; MURALIDHAR, SUBRAMANIAN; ROBINSON, ERIC; SAINI, SAHAJ
To: SNOWFLAKE INC.
Reel/Frame 068308/0131 →
Continuity (6)
Continuation 18295987 · Apr 5, 2023
Continuation 17804753 · May 31, 2022
Continuation 17226141 · Apr 9, 2021
Continuation 16944983 · Jul 31, 2020
Provisional Application 63032163 · May 29, 2020
Related Publication 20240403323A1 · Dec 5, 2024
References Cited (28)
US 6845383B1 · Kraenzel et al. · 2005 [cited by applicant]
US 9251020B1 · Kalekar · 2016 [cited by examiner]
US 20070143372A1 · Martinez et al. · 2007 [cited by applicant]
US 20070192304A1 · Iyer et al. · 2007 [cited by applicant]
US 20090300019A1 · Itkin · 2009 [cited by examiner]
US 20100072640A1 · Rudmann et al. · 2010 [cited by applicant]
US 20100325161A1 · Rutter et al. · 2010 [cited by applicant]
US 20120011096A1 · Aggarwal · 2012 [cited by applicant]
US 20120278282A1 · Lu et al. · 2012 [cited by applicant]
US 20140081950A1 · Rajan · 2014 [cited by examiner]
US 20170149886A1 · Shetty · 2017 [cited by applicant]
US 20180068008A1 · Cruanes · 2018 [cited by examiner]
US 20180137186A1 · Brodt · 2018 [cited by examiner]
US 20210173851A1 · Dorne et al. · 2021 [cited by applicant]
US 20210326359A1 · Upton et al. · 2021 [cited by applicant]
US 20210365446A1 · Srivastava et al. · 2021 [cited by applicant]
CN 105938448 · 2016 [cited by applicant]
CN 106156338 · 2016 [cited by applicant]
CN 108521858 · 2018 [cited by applicant]
“U.S. Appl. No. 18/295,987, Non Final Office Action mailed Dec. 21, 2023”, 15 pgs. [cited by applicant]
“U.S. Appl. No. 18/295,987, Notice of Allowance mailed May 17, 2024”, 8 pgs. [cited by applicant]
“U.S. Appl. No. 18/295,987, Response filed Mar. 21, 2024 to Non Final Office Action mailed Dec. 21, 2023”, 12 pgs. [cited by applicant]
“U.S. Appl. No. 18/494,599, Examiner Interview Summary mailed May 23, 2025”, 2 pgs. [cited by applicant]
“U.S. Appl. No. 18/494,599, Final Office Action mailed Mar. 20, 2025”, 14 pgs. [cited by applicant]
“U.S. Appl. No. 18/494,599, Non Final Office Action mailed Sep. 6, 2024”, 17 pgs. [cited by applicant]
“U.S. Appl. No. 18/494,599, Notice of Allowance mailed Jul. 9, 2025”, 13 pgs. [cited by applicant]
“U.S. Appl. No. 18/494,599, Response filed Jun. 19, 2025 to Final Office Action mailed Mar. 20, 2025”, 11 pgs. [cited by applicant]
“U.S. Appl. No. 18/494,599, Response filed Dec. 5, 2024 to Non Final Office Action mailed Sep. 6, 2024”, 15 pgs. [cited by applicant]