Skip to content

Commit b309f6f

Browse files
Update counter_cache.md
1 parent c5aa574 commit b309f6f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

counter_cache.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,11 @@ alter table ratings add constraint check_rating check(rating between 0 and 5);
174174
## Count Estimate
175175

176176
https://wiki.postgresql.org/wiki/Count_estimate
177+
178+
179+
counter cache is useful for caching computed single row data.
180+
181+
but what if we want to cache bulk data, e,g product ranks, stock quantity or other derived values?
182+
183+
we can either create a new table, or use materialized view.
184+
the latter has an option to just refresh the view, useful if your logic seldom chsnges

0 commit comments

Comments
 (0)