-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#10510] YSQL: Improve performance of concurrent refreshes for matviews
Summary: In YB mode, we restrict matviews from having rows with all null values when performing concurrent refreshes. Previously, we performed a full scan of the data to check for completely null rows, which leads to a performance hit. This diff performs the check for completely null rows on the computed diff table instead (which is a much smaller table). Performance test: Tested on centOS 7 machine with Intel Broadwell CPU. ``` CREATE TABLE base ... ; // 100 MB dataset CREATE MATERIALIZED VIEW test AS SELECT * FROM base; CREATE UNIQUE INDEX ON test ... // Unique index required for concurrent refreshes INSERT a few rows INTO base; REFRESH MATERIALIZED VIEW CONCURRENTLY base; ``` The above snippet gets stuck on the scan of the temporary table with the new data for at least 25 minutes in the current version of the code. With this diff, it takes about 3 minutes for the refresh to execute. Test Plan: Run yb_feature_matview in TestPgRegressFeature Jenkins: urgent Reviewers: mihnea Reviewed By: mihnea Subscribers: zyu, smishra, yql Differential Revision: https://phabricator.dev.yugabyte.com/D14596
- Loading branch information
Fizaa Luthra
authored and
Fizaa Luthra
committed
Jan 6, 2022
1 parent
a5e2d82
commit 67e0467
Showing
2 changed files
with
65 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters