doc-exports/docs/ddm/umn/ddm_08_0015.html
Ru, Li Yi 4b09a03a51 ddm_umn
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-04-11 11:39:26 +00:00

33 lines
4.0 KiB
HTML

<a name="ddm_08_0015"></a><a name="ddm_08_0015"></a>
<h1 class="topictitle1">SHOW RULE</h1>
<div id="body1599640064069"><p id="ddm_08_0015__p17329111808"><strong id="ddm_08_0015__b174541916461">Command Format 1:</strong></p>
<p id="ddm_08_0015__p4717115171317"><strong id="ddm_08_0015__b122140235135">show rule</strong>;</p>
<p id="ddm_08_0015__p1914614161357">It is used to view the sharding rule of each logical table in a certain schema.</p>
<p id="ddm_08_0015__p33291011607">Command output:</p>
<p id="ddm_08_0015__p1296332641613"><span><img id="ddm_08_0015__image86454510116" src="en-us_image_0000001733146413.png"></span></p>
<p id="ddm_08_0015__p457218521611"><strong id="ddm_08_0015__b14701443862">Command Format 2:</strong></p>
<p id="ddm_08_0015__p111111916137"><strong id="ddm_08_0015__b14610326137">show rule from </strong><em id="ddm_08_0015__i17843251312">&lt;table_name&gt;</em>;</p>
<p id="ddm_08_0015__p6146171610511">It is used to view the sharding rule of a specific logical table in a certain schema.</p>
<p id="ddm_08_0015__p161401112419">Command output:</p>
<p id="ddm_08_0015__p815911513412"><span><img id="ddm_08_0015__image111598519414" src="en-us_image_0000001733266529.png"></span></p>
<p id="ddm_08_0015__p11143132210419"><strong id="ddm_08_0015__b15476133325519">Output Details:</strong></p>
<p id="ddm_08_0015__p1414332212420"><strong id="ddm_08_0015__b9425205613">TABLE_NAME</strong>: indicates the name of the logical table.</p>
<p id="ddm_08_0015__p142881856440"><strong id="ddm_08_0015__b12430457203516">BROADCAST</strong>: specifies whether the table is a broadcast table. <strong id="ddm_08_0015__b243165710358">0</strong> indicates that the table is not a broadcast table. <strong id="ddm_08_0015__b44322576359">1</strong> indicates the table is a broadcast table.</p>
<p id="ddm_08_0015__p192881256446"><strong id="ddm_08_0015__b39883487314">DB_PARTITION_KEY</strong>: indicates the database sharding key. Leave this field blank if database sharding is not required.</p>
<p id="ddm_08_0015__p8288175611414"><strong id="ddm_08_0015__b128071322257">DB_PARTITION_POLICY</strong>: indicates the database sharding algorithm. The value can be <strong id="ddm_08_0015__b1314422518450">HASH</strong>, <strong id="ddm_08_0015__b1699116414403">YYYYMM</strong>, <strong id="ddm_08_0015__b14508184444013">YYYYDD</strong>, and <strong id="ddm_08_0015__b162001646134013">YYYYWEEK</strong>.</p>
<p id="ddm_08_0015__p628817561242"><strong id="ddm_08_0015__b6492257154015">DB_PARTITION_COUNT</strong>: indicates the number of database shards.</p>
<p id="ddm_08_0015__p42880561443"><strong id="ddm_08_0015__b168871140370">DB_PARTITION_OFFSET</strong>: indicates where a new database shard starts from.</p>
<p id="ddm_08_0015__p14177305304"><strong id="ddm_08_0015__b954013450424">PARTITION_RANGE</strong>: indicates the sharding range when the database sharding algorithm is range.</p>
<p id="ddm_08_0015__p112871556346"><strong id="ddm_08_0015__b1536611135431">TB_PARTITION_KEY</strong>: indicates the table sharding key. Leave this field blank if table sharding is not required.</p>
<p id="ddm_08_0015__p5287155612414"><strong id="ddm_08_0015__b15041145445">TB_PARTITION_POLICY</strong>: indicates the table sharding algorithm. The value can be <strong id="ddm_08_0015__b1294954154515">HASH</strong>, <strong id="ddm_08_0015__b17410056184515">MM</strong>, <strong id="ddm_08_0015__b18989518463">DD</strong>, <strong id="ddm_08_0015__b19429664616">MMDD</strong>, or <strong id="ddm_08_0015__b2558414154616">WEEK</strong>.</p>
<p id="ddm_08_0015__p61449221743"><strong id="ddm_08_0015__b17202944617">TB_PARTITION_COUNT</strong>: indicates the number of physical tables in each database shard.</p>
<p id="ddm_08_0015__p614418227417"><strong id="ddm_08_0015__b133341913153817">TB_PARTITION_OFFSET</strong>: indicates where a new physical table starts from.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ddm_08_0002.html">Supported SQL Statements</a></div>
</div>
</div>