The materialized view mv_feed_stats is updated in nightly maintenance, but on startup when it does not exist yet, v_feeds_snr is defined to calculate the long way by running a full table scan on fm_items. Rebuilding the materialized view is no slower, so we might as well do it on demand when a query calling v_feeds_snr is executed and mv_feeds_stats does not exist yet.
The materialized view
mv_feed_stats
is updated in nightly maintenance, but on startup when it does not exist yet,v_feeds_snr
is defined to calculate the long way by running a full table scan onfm_items
. Rebuilding the materialized view is no slower, so we might as well do it on demand when a query callingv_feeds_snr
is executed andmv_feeds_stats
does not exist yet.