Files
doc-exports/docs/dws/dev/dws_06_0383.html
luhuayi 177cd61a57 DWS DEVG 910.211 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: luhuayi <luhuayi@huawei.com>
Co-committed-by: luhuayi <luhuayi@huawei.com>
2025-05-05 07:44:03 +00:00

91 lines
8.0 KiB
HTML

<a name="EN-US_TOPIC_0000001941201064"></a><a name="EN-US_TOPIC_0000001941201064"></a>
<h1 class="topictitle1">Data Sharing Functions</h1>
<div id="body0000001941201064"><div class="section" id="EN-US_TOPIC_0000001941201064__section3606936132915"><h4 class="sectiontitle">pgxc_group_add_subscription(src_vw_name, target_vw_name)</h4><p id="EN-US_TOPIC_0000001941201064__p1448916473292">Description: In a storage-compute decoupling architecture, a KV subscription relationship is established between logical clusters (Virtual Warehouses, VWs). Once established, the KV cache of the consumer VW periodically synchronizes the SST file incrementally from the OBS cudesc snapshot directory of the producer to the local host. This allows tables in the producer VW to be queried across VWs in the consumer VM. The created subscription relationship can be found in the <strong id="EN-US_TOPIC_0000001941201064__b10886151155915">pgxc_group_subscription</strong> table. This function is supported only by clusters of version 9.0.3 or later.</p>
<p id="EN-US_TOPIC_0000001941201064__p64893475298">Return type: void</p>
<p id="EN-US_TOPIC_0000001941201064__p13489134711296">The following information is displayed:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001941201064__table108813410375" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Columns returned by pgxc_group_add_subscription(src_vw_name, target_vw_name)</caption><thead align="left"><tr id="EN-US_TOPIC_0000001941201064__row168834112377"><th align="left" class="cellrowborder" valign="top" width="19.09%" id="mcps1.3.1.5.2.4.1.1"><p id="EN-US_TOPIC_0000001941201064__p1688104110374"><strong id="EN-US_TOPIC_0000001941201064__b108837334592">Column</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.1.5.2.4.1.2"><p id="EN-US_TOPIC_0000001941201064__p1688204173719"><strong id="EN-US_TOPIC_0000001941201064__b49051835155918">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="59.91%" id="mcps1.3.1.5.2.4.1.3"><p id="EN-US_TOPIC_0000001941201064__p108813418377"><strong id="EN-US_TOPIC_0000001941201064__b107722374591">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001941201064__row488641123715"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.1.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001941201064__p6953436173016">src_vw_name</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.1.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001941201064__p59525364303">text</p>
</td>
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.1.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001941201064__p1648219474305">Producer VW name, which is usually used as the VW to which data is written.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001941201064__row118824117371"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.1.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001941201064__p1950836133011">target_vw_name</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.1.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001941201064__p49501036163016">text</p>
</td>
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.1.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001941201064__p694963618306">Consumer VW name, which is usually used as the VW for reading data.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001941201064__p7489144714294">The following is an example:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001941201064__screen67741817123116"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pgxc_group_add_subscription</span><span class="p">(</span><span class="s1">'write_group'</span><span class="p">,</span><span class="w"> </span><span class="s1">'single_read_group'</span><span class="p">);</span>
<span class="n">pgxc_group_add_subscription</span><span class="w"> </span>
<span class="c1">------------------</span>
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001941201064__p17489154711291"></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001941201064__section271679163219"><h4 class="sectiontitle">pgxc_group_drop_subscription(src_vw_name, target_vw_name)</h4><p id="EN-US_TOPIC_0000001941201064__p931616123211">Description: To delete an established KV subscription relationship in a storage and compute separation architecture, remove the records from the <strong id="EN-US_TOPIC_0000001941201064__b38610230595">pgxc_group_subscription</strong> table. After deletion, the consumer VW can no longer query tables in the producer VW across VWs. This function is supported only by clusters of version 9.0.3 or later.</p>
<p id="EN-US_TOPIC_0000001941201064__p73191615322">Return type: void</p>
<p id="EN-US_TOPIC_0000001941201064__p1331111619328">The following information is displayed:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001941201064__table9273111333" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Columns returned by pgxc_group_drop_subscription(src_vw_name, target_vw_name)</caption><thead align="left"><tr id="EN-US_TOPIC_0000001941201064__row1271418335"><th align="left" class="cellrowborder" valign="top" width="19.09%" id="mcps1.3.2.5.2.4.1.1"><p id="EN-US_TOPIC_0000001941201064__p102761163311"><strong id="EN-US_TOPIC_0000001941201064__b2419183211018">Column</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21%" id="mcps1.3.2.5.2.4.1.2"><p id="EN-US_TOPIC_0000001941201064__p1827171103311"><strong id="EN-US_TOPIC_0000001941201064__b1453043419015">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="59.91%" id="mcps1.3.2.5.2.4.1.3"><p id="EN-US_TOPIC_0000001941201064__p927111153315"><strong id="EN-US_TOPIC_0000001941201064__b17418736908">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001941201064__row92716143316"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.2.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001941201064__p42751113315">src_vw_name</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001941201064__p827201183314">text</p>
</td>
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.2.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001941201064__p1527141123310">Producer VW name, which is usually used as the VW to which data is written.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001941201064__row112714112339"><td class="cellrowborder" valign="top" width="19.09%" headers="mcps1.3.2.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001941201064__p15272113319">target_vw_name</p>
</td>
<td class="cellrowborder" valign="top" width="21%" headers="mcps1.3.2.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001941201064__p122713110331">text</p>
</td>
<td class="cellrowborder" valign="top" width="59.91%" headers="mcps1.3.2.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001941201064__p16274115333">Consumer VW name, which is usually used as the VW for reading data.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001941201064__p2725419173210">The following is an example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001941201064__screen1665013431337">SELECT pgxc_group_drop_subscription('write_group', 'single_read_group');
pgxc_group_drop_subscription
------------------------------
(1 row)
</pre>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0382.html">Storage-Compute Decoupling Functions</a></div>
</div>
</div>