1 comment

[ 2.8 ms ] story [ 9.8 ms ] thread
One thing to keep in mind when using materialized views is that a refresh will recompute the complete view and discard the old one. If at a certain size you might want to make sure your database server doesn't drown in rebuilds.

The alternative to building a materialized view may be to build an index with a tsvector instead, though the that might not work since the document is not trivial; it certainly would have a problem with tags, though those can be treated separately. The huge advantage of an index is that it's automatically refreshed for you.

Realistically though, you'll probably never run into performance problems building a materialized view due to too many submitted recipes. ;)