gooderp18绿色标准版
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

70 líneas
5.8KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>F.26. pg_freespacemap</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="pgcrypto.html" title="F.25. pgcrypto" /><link rel="next" href="pgprewarm.html" title="F.27. pg_prewarm" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">F.26. pg_freespacemap</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="pgcrypto.html" title="F.25. pgcrypto">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="contrib.html" title="Appendix F. Additional Supplied Modules">Up</a></td><th width="60%" align="center">Appendix F. Additional Supplied Modules</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="pgprewarm.html" title="F.27. pg_prewarm">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="PGFREESPACEMAP"><div class="titlepage"><div><div><h2 class="title" style="clear: both">F.26. pg_freespacemap</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="pgfreespacemap.html#id-1.11.7.35.5">F.26.1. Functions</a></span></dt><dt><span class="sect2"><a href="pgfreespacemap.html#id-1.11.7.35.6">F.26.2. Sample Output</a></span></dt><dt><span class="sect2"><a href="pgfreespacemap.html#id-1.11.7.35.7">F.26.3. Author</a></span></dt></dl></div><a id="id-1.11.7.35.2" class="indexterm"></a><p>
  3. The <code class="filename">pg_freespacemap</code> module provides a means for examining the
  4. free space map (FSM). It provides a function called
  5. <code class="function">pg_freespace</code>, or two overloaded functions, to be
  6. precise. The functions show the value recorded in the free space map for
  7. a given page, or for all pages in the relation.
  8. </p><p>
  9. By default use is restricted to superusers and members of the
  10. <code class="literal">pg_stat_scan_tables</code> role. Access may be granted to others
  11. using <code class="command">GRANT</code>.
  12. </p><div class="sect2" id="id-1.11.7.35.5"><div class="titlepage"><div><div><h3 class="title">F.26.1. Functions</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">
  13. <code class="function">pg_freespace(rel regclass IN, blkno bigint IN) returns int2</code>
  14. <a id="id-1.11.7.35.5.2.1.1.2" class="indexterm"></a>
  15. </span></dt><dd><p>
  16. Returns the amount of free space on the page of the relation, specified
  17. by <code class="literal">blkno</code>, according to the FSM.
  18. </p></dd><dt><span class="term">
  19. <code class="function">pg_freespace(rel regclass IN, blkno OUT bigint, avail OUT int2)</code>
  20. </span></dt><dd><p>
  21. Displays the amount of free space on each page of the relation,
  22. according to the FSM. A set of <code class="literal">(blkno bigint, avail int2)</code>
  23. tuples is returned, one tuple for each page in the relation.
  24. </p></dd></dl></div><p>
  25. The values stored in the free space map are not exact. They're rounded
  26. to precision of 1/256th of <code class="symbol">BLCKSZ</code> (32 bytes with default <code class="symbol">BLCKSZ</code>), and
  27. they're not kept fully up-to-date as tuples are inserted and updated.
  28. </p><p>
  29. For indexes, what is tracked is entirely-unused pages, rather than free
  30. space within pages. Therefore, the values are not meaningful, just
  31. whether a page is full or empty.
  32. </p><div class="note"><h3 class="title">Note</h3><p>
  33. The interface was changed in version 8.4, to reflect the new FSM
  34. implementation introduced in the same version.
  35. </p></div></div><div class="sect2" id="id-1.11.7.35.6"><div class="titlepage"><div><div><h3 class="title">F.26.2. Sample Output</h3></div></div></div><pre class="screen">
  36. postgres=# SELECT * FROM pg_freespace('foo');
  37. blkno | avail
  38. -------+-------
  39. 0 | 0
  40. 1 | 0
  41. 2 | 0
  42. 3 | 32
  43. 4 | 704
  44. 5 | 704
  45. 6 | 704
  46. 7 | 1216
  47. 8 | 704
  48. 9 | 704
  49. 10 | 704
  50. 11 | 704
  51. 12 | 704
  52. 13 | 704
  53. 14 | 704
  54. 15 | 704
  55. 16 | 704
  56. 17 | 704
  57. 18 | 704
  58. 19 | 3648
  59. (20 rows)
  60. postgres=# SELECT * FROM pg_freespace('foo', 7);
  61. pg_freespace
  62. --------------
  63. 1216
  64. (1 row)
  65. </pre></div><div class="sect2" id="id-1.11.7.35.7"><div class="titlepage"><div><div><h3 class="title">F.26.3. Author</h3></div></div></div><p>
  66. Original version by Mark Kirkwood <code class="email">&lt;<a class="email" href="mailto:markir@paradise.net.nz">markir@paradise.net.nz</a>&gt;</code>.
  67. Rewritten in version 8.4 to suit new FSM implementation by Heikki
  68. Linnakangas <code class="email">&lt;<a class="email" href="mailto:heikki@enterprisedb.com">heikki@enterprisedb.com</a>&gt;</code>
  69. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pgcrypto.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="contrib.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="pgprewarm.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">F.25. pgcrypto </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> F.27. pg_prewarm</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1