Yang, Tong 48706b7552 MRS COMP-LTS 320-lts.1 version
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2024-04-12 12:51:10 +00:00

21 lines
3.9 KiB
HTML

<a name="mrs_01_24546"></a><a name="mrs_01_24546"></a>
<h1 class="topictitle1">Configuring the Validity Period and Data Update of Materialized Views</h1>
<div id="body32001227"><div class="section" id="mrs_01_24546__en-us_topic_0000001470319964_section167772040106"><h4 class="sectiontitle">Validity Period of Materialized Views</h4><p id="mrs_01_24546__en-us_topic_0000001470319964_p165019478013">The <strong id="mrs_01_24546__en-us_topic_0000001470319964_b75305846155937">mv_validity</strong> field for creating a materialized view indicates the validity period of the materialized view. <span id="mrs_01_24546__en-us_topic_0000001470319964_text54220667655937">HetuEngine</span> allows you to rewrite the SQL statements using only the materialized views within the validity period.</p>
</div>
<div class="section" id="mrs_01_24546__en-us_topic_0000001470319964_section1820254301"><h4 class="sectiontitle">Refreshing Materialized View Data</h4><p id="mrs_01_24546__en-us_topic_0000001470319964_p1639612141515">If data needs to be updated periodically, you can use either of the following methods to periodically refresh the materialized views:</p>
<ul id="mrs_01_24546__en-us_topic_0000001470319964_ul173973145114"><li id="mrs_01_24546__en-us_topic_0000001470319964_li939711141414">Manually refreshing a materialized view<p id="mrs_01_24546__en-us_topic_0000001470319964_p339741416119"><a name="mrs_01_24546__en-us_topic_0000001470319964_li939711141414"></a><a name="en-us_topic_0000001470319964_li939711141414"></a>Run the <strong id="mrs_01_24546__en-us_topic_0000001470319964_b18638015322">refresh materialized view </strong><em id="mrs_01_24546__en-us_topic_0000001470319964_i987212017328">&lt;mv name&gt;</em> command on the <span id="mrs_01_24546__en-us_topic_0000001470319964_text17873110133217">HetuEngine</span> client by referring to <span id="mrs_01_24546__en-us_topic_0000001470319964_text1787315073217">HetuEngine</span>, or run the <strong id="mrs_01_24546__en-us_topic_0000001470319964_b7874150123217">refresh materialized view </strong><em id="mrs_01_24546__en-us_topic_0000001470319964_i16874508323">&lt;mv name&gt;</em> command using JDBC in the service program to manually update the database.</p>
</li><li id="mrs_01_24546__en-us_topic_0000001470319964_li039718141212">Automatically refreshing a materialized view<div class="p" id="mrs_01_24546__en-us_topic_0000001470319964_p1139716141511"><a name="mrs_01_24546__en-us_topic_0000001470319964_li039718141212"></a><a name="en-us_topic_0000001470319964_li039718141212"></a>Use <strong id="mrs_01_24546__en-us_topic_0000001470319964_b13808141619326">create materialized view</strong> to create a materialized view that can be automatically refreshed.<div class="note" id="mrs_01_24546__en-us_topic_0000001470319964_note1039714141112"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="mrs_01_24546__en-us_topic_0000001470319964_ul139720141412"><li id="mrs_01_24546__en-us_topic_0000001470319964_li1439713141710">To enable the automatic refresh capability of the materialized views, you must set a computing instance as the maintenance instance must exist. For details, see <a href="mrs_01_24535.html">Configuring a HetuEngine Maintenance Instance</a>.</li><li id="mrs_01_24546__en-us_topic_0000001470319964_li6397161420115">If there are too many materialized views, some materialized views may expire due to too long waiting time.</li><li id="mrs_01_24546__en-us_topic_0000001470319964_li163971014814">The automatic refresh function does not automatically refresh materialized views in the <strong id="mrs_01_24546__en-us_topic_0000001470319964_b47391943144113">disable</strong> status.</li></ul>
</div></div>
</div>
</li></ul>
</div>
<p id="mrs_01_24546__en-us_topic_0000001470319964_p231514261004"></p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_24533.html">Using HetuEngine Materialized Views</a></div>
</div>
</div>