forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
206 lines
26 KiB
HTML
206 lines
26 KiB
HTML
<a name="EN-US_TOPIC_0000001811515613"></a><a name="EN-US_TOPIC_0000001811515613"></a>
|
|
|
|
<h1 class="topictitle1">Database Object Size Functions</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_aaee277591227423fb6bbcb7e402014ac">Database object size functions calculate the actual disk space used by database objects.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section87122010201418"><h4 class="sectiontitle">pg_column_size(any)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_aac6e660f56764ccbbfa16111eda556d3">Description: Specifies the number of bytes used to store a particular value (possibly compressed).</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a31a1e8dd2eb548ddbff14e082d879016">Return type: integer</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a975d7c142da24eae93a5bb72908b6df8">Note: <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b5988509179423">pg_column_size</strong> displays the space for storing an independent data value.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_s0e44c94b77fe44e89fcf92089e5ccf68"><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="n">postgres</span><span class="o">=#</span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_column_size</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="n">pg_column_size</span><span class="w"> </span>
|
|
<span class="c1">----------------</span>
|
|
<span class="w"> </span><span class="mi">4</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>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section2720324181411"><h4 class="sectiontitle">pg_database_size(oid)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a468b89ddea2e433a86aac31fd9b9ad0b">Description: Specifies the disk space used by the database with the specified OID.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a02a1a82df63944138cb6e43fca5ab96b">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section13317538101414"><h4 class="sectiontitle">pg_database_size(name)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ad90e375c29bd4294acac9ef273920641">Description: Specifies the disk space used by the database with the specified name.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ab6fe1ec740994329aaaa6f69312c8651">Return type: bigint</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a745e30b874114f2abbbd3df9ac8feca2">Note: <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b2970672819423">pg_database_size</strong> receives the OID or name of a database and returns the disk space used by the corresponding object.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ad25fe4c172c9471da2a5ce7e48ca46b8">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_sed0d9ecf8c7246f49210581dfd6f9266"><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="n">postgres</span><span class="o">=#</span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_database_size</span><span class="p">(</span><span class="s1">'gaussdb'</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="n">pg_database_size</span><span class="w"> </span>
|
|
<span class="c1">------------------</span>
|
|
<span class="w"> </span><span class="mi">51590112</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>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section48933529144"><h4 class="sectiontitle">pg_relation_size(oid)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a294766ef27b748888330492d6f45bdb6">Description: Specifies the disk space used by the table with a specified OID or index.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a6e5262617ab84a9fbcedbc8241900205">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section1388726131510"><h4 class="sectiontitle">get_db_source_datasize()</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_p210912510197">Description: Estimates the total size of non-compressed data in the current database.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_p21096258193">Return type: bigint</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_p9109102510191">Note: (1) <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b4076816859423">ANALYZE</strong> must be performed before this function is called. (2) Calculate the total size of non-compressed data by estimating the compression rate of column-store tables.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_p1810952531919">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_screen14971319192417"><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>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">postgres</span><span class="o">=#</span><span class="k">analyze</span><span class="p">;</span>
|
|
<span class="k">ANALYZE</span>
|
|
<span class="n">postgres</span><span class="o">=#</span><span class="k">SELECT</span><span class="w"> </span><span class="n">get_db_source_datasize</span><span class="p">();</span>
|
|
<span class="w"> </span><span class="n">get_db_source_datasize</span>
|
|
<span class="c1">------------------------</span>
|
|
<span class="w"> </span><span class="mi">35384925667</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>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section122251041171514"><h4 class="sectiontitle">pg_relation_size(text)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a090f49da938349e088e9693bdb593658">Description: Specifies the disk space used by the table with a specified name or index. The table name can be schema-qualified.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_acce0ad5bc0e1489999be91de754d4ac2">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section13222656191513"><h4 class="sectiontitle">pg_relation_size(relation regclass, fork text)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ad87008d13de5492a9b99f60c12e21469">Description: Specifies the disk space used by the specified bifurcating tree ('main', 'fsm', or 'vm') of a certain table or index.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a448f438f84014df8b2e2cd681be1c4f1">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section36072815167"><h4 class="sectiontitle">pg_relation_size(relation regclass)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a8c104e0320c945c391a126d7b74e9f5c">Description: Is an abbreviation of <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b12394139529423">pg_relation_size(..., 'main')</strong>.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a8cae5a23799c4085a49fbad40eab4b84">Return type: bigint</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ae66fd4876a744ed1892bd2e805fe481e">Note: <strong id="EN-US_TOPIC_0000001811515613__b10483185514">pg_relation_size</strong> returns the size in bytes of the table, index, or compressed table with the specified OID or name.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section482353051613"><h4 class="sectiontitle">pg_partition_size(oid,oid)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_aad83715f59604f28b2654c27acc2774b">Description: Specifies the disk space used by the partition with a specified OID. The first <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b11908738759423">oid</strong> is the OID of the table and the second <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b14822113609423">oid</strong> is the OID of the partition.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_aff2154382b854625ada1e49d966c7f13">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section17721345191615"><h4 class="sectiontitle">pg_partition_size(text, text)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_aabe8e7db6f704ee6a6f64be8519bdefb">Description: Specifies the disk space used by the partition with a specified name. The first <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b20433346929423">text</strong> is the table name and the second <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b15090163579423">text</strong> is the partition name.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ab69479fd3f544e07893c783b0d37683b">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section72869234181"><h4 class="sectiontitle">pg_partition_indexes_size(oid,oid)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a3f60855c70ab46a9a34c03deb6eecd10">Description: Specifies the disk space used by the index of the partition with a specified OID. The first <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b12392682629423">oid</strong> is the OID of the table and the second <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b93724519423">oid</strong> is the OID of the partition.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a16f80c96d5ed4e7abb1980aacfb7fd59">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section16116642111817"><h4 class="sectiontitle">pg_partition_indexes_size(text,text)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a989d7095a3a0408aa50bcc6a8fc6b509">Description: Specifies the disk space used by the index of the partition with a specified name. The first <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b11639664659423">text</strong> is the table name and the second <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b4247420139423">text</strong> is the partition name.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a4170ff92660246fdba03cacc6b02bc2b">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section1794640142012"><h4 class="sectiontitle">pg_indexes_size(regclass)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a54aa4a7bbee54e7aada7afc8092dbb37">Description: Specifies the total disk space used by the index appended to the specified table.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a3a6a4e3b35454b0bbeaae78bd7f4554f">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section1363210555206"><h4 class="sectiontitle">pg_size_pretty(bigint)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a2891d6c3b88b4a4c8dffbc6f2b8c78d3">Description: Converts the calculated byte size into a size readable to human beings.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a4f13374133ac4050834cb0768c5b3fa3">Return type: text</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section196986122112"><h4 class="sectiontitle">pg_size_pretty(numeric)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a67978263329444b8a010e41a88938279">Description: Converts the calculated byte size indicated by a numeral into a size readable to human beings.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ac2e566935c8b409597d4a5c9db6c27f2">Return type: text</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_aaa358b6179194e1384089ff9a26a8a10">Note: <strong id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_b15215688319423">pg_size_pretty</strong> formats the results of other functions into a human-readable format. KB/MB/GB/TB can be used.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section79241433102120"><h4 class="sectiontitle">pg_table_size(regclass)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ad046ecbdb22942f6ba79661d280fd286">Description: Specifies the disk space used by the specified table, excluding indexes (but including TOAST, free space mapping, and visibility mapping).</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a019f9f9f5b664624b9d3f6ba112e048d">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section1197517366230"><h4 class="sectiontitle">pg_total_relation_size(oid)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a1cb0f0b0e65949aeb760a5d84fd96dd5">Description: Specifies the disk space used by the table with a specified OID, including the index and the compressed data.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a3ddf029c502143da8f4b9884047aebf9">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section103282047142310"><h4 class="sectiontitle">pg_total_relation_size(regclass)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a7560858b96fc4be0bea566e8f0c6dcfd">Description: Specifies the total disk space used by the specified table, including all indexes and TOAST data.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ade7c6651990d48898077a6983ebb1cbf">Return type: bigint</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_section435495717236"><h4 class="sectiontitle">pg_total_relation_size(text)</h4><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a7e4e36f9265242ab9c4b36191120ef44">Description: This function specifies the disk space used by the table with the specified name, including the index and compressed data. The table name can be schema-qualified.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_a193de2485a834bd782d45f015c927c76">Return type: bigint</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001445318666_ab15fff7915324bbabcc889b2368a36bc">Note: <strong id="EN-US_TOPIC_0000001811515613__b161241217277">pg_total_relation_size</strong> can specify the OID or name of a table or compressed table, and then return the data in bytes and the sizes of all related indexes and compressed tables.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__section785818894117"><h4 class="sectiontitle">pg_obs_file_size(regclass)</h4><p id="EN-US_TOPIC_0000001811515613__p1817101017411">Description: This function obtains the CU file size, file name, and bucket ID stored on OBS by specifying the OID or name of a V3 column-store table. This function is supported only by clusters of version 9.1.0 or later.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__p152721644210">Parameter: The input parameter can be the table OID or table name.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__p4171181019414">Return type: record</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_table1593921104918" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Return fields</caption><thead align="left"><tr id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_row1593971115495"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.21.5.2.4.1.1"><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p13939151144911"><strong id="EN-US_TOPIC_0000001811515613__b5565192514514">Field</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.21.5.2.4.1.2"><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p8939611194910"><strong id="EN-US_TOPIC_0000001811515613__b69347268510">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.21.5.2.4.1.3"><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p1939121174915"><strong id="EN-US_TOPIC_0000001811515613__b45061728852">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_row1693941144915"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p1328815568490">bucketid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p1828895614911">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p20288956154918">ID of the bucket for storing CU files.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_row209402114497"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p102881356124911">filename</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p5288165619493">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p32887563496">CU file name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_row994071119495"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.1 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p9288165618492">size</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.2 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p13288125611490">bigint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.21.5.2.4.1.3 "><p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p3289656134916">CU file size, in bytes.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_p1386383319537">Example:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811515613__en-us_topic_0000001444979614_screen1341474613537"><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>
|
|
<span class="normal">6</span>
|
|
<span class="normal">7</span>
|
|
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_obs_file_size</span><span class="p">(</span><span class="s1">'t3_col_part_dif_partition'</span><span class="p">);</span>
|
|
<span class="w"> </span><span class="n">bucketid</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">filename</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">size</span>
|
|
<span class="c1">----------+------------------+------</span>
|
|
<span class="w"> </span><span class="mi">9</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">23488119324673</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">512</span>
|
|
<span class="w"> </span><span class="mi">22</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">23488102760449</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">512</span>
|
|
<span class="w"> </span><span class="mi">21</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">23488119521281</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">512</span>
|
|
<span class="w"> </span><span class="mi">16</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">23488102662145</span><span class="p">.</span><span class="mi">0</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="mi">512</span>
|
|
<span class="p">(</span><span class="mi">4</span><span class="w"> </span><span class="k">rows</span><span class="p">)</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811515613__section1376313205533"><h4 class="sectiontitle">pg_obs_file_size(text, text)</h4><p id="EN-US_TOPIC_0000001811515613__p18763102055314">Description: This function specifies a partition of a column-store V3 table (primary table name or partitioned table) and returns the size, file name, and bucket ID of the CU file stored on OBS. This function is supported only by clusters of version 9.1.0 or later.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__p93151211920">Parameter: The input parameter can be the table OID or table name. The partition name is used as the partition name.</p>
|
|
<p id="EN-US_TOPIC_0000001811515613__p776318202538">Return type: record</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001811515613__table179384615559" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001811515613__row189354618555"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.22.5.1.4.1.1"><p id="EN-US_TOPIC_0000001811515613__p19948461557"><strong id="EN-US_TOPIC_0000001811515613__b17299181615">Field</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.22.5.1.4.1.2"><p id="EN-US_TOPIC_0000001811515613__p119417468554"><strong id="EN-US_TOPIC_0000001811515613__b876181110617">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.22.5.1.4.1.3"><p id="EN-US_TOPIC_0000001811515613__p6941046135517"><strong id="EN-US_TOPIC_0000001811515613__b8767413063">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001811515613__row199434685515"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.1 "><p id="EN-US_TOPIC_0000001811515613__p169474675512">bucketid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.2 "><p id="EN-US_TOPIC_0000001811515613__p69484685511">integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.3 "><p id="EN-US_TOPIC_0000001811515613__p1094184615554">ID of the bucket for storing CU files.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811515613__row4941462552"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.1 "><p id="EN-US_TOPIC_0000001811515613__p5941463551">filename</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.2 "><p id="EN-US_TOPIC_0000001811515613__p139424665511">text</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.3 "><p id="EN-US_TOPIC_0000001811515613__p14943464558">CU file name.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811515613__row09417467553"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.1 "><p id="EN-US_TOPIC_0000001811515613__p18942468558">size</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.2 "><p id="EN-US_TOPIC_0000001811515613__p129424645519">bigint</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.22.5.1.4.1.3 "><p id="EN-US_TOPIC_0000001811515613__p594746125516">CU file size, in bytes.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0058.html">Database Object Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|