gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

31 lines
4.0KB

  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>24.2. Routine Reindexing</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="routine-vacuuming.html" title="24.1. Routine Vacuuming" /><link rel="next" href="logfile-maintenance.html" title="24.3. Log File Maintenance" /></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">24.2. Routine Reindexing</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="routine-vacuuming.html" title="24.1. Routine Vacuuming">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="maintenance.html" title="Chapter 24. Routine Database Maintenance Tasks">Up</a></td><th width="60%" align="center">Chapter 24. Routine Database Maintenance Tasks</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="logfile-maintenance.html" title="24.3. Log File Maintenance">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="ROUTINE-REINDEX"><div class="titlepage"><div><div><h2 class="title" style="clear: both">24.2. Routine Reindexing</h2></div></div></div><a id="id-1.6.11.11.2" class="indexterm"></a><p>
  3. In some situations it is worthwhile to rebuild indexes periodically
  4. with the <a class="xref" href="sql-reindex.html" title="REINDEX"><span class="refentrytitle">REINDEX</span></a> command or a series of individual
  5. rebuilding steps.
  6. </p><p>
  7. B-tree index pages that have become completely empty are reclaimed for
  8. re-use. However, there is still a possibility
  9. of inefficient use of space: if all but a few index keys on a page have
  10. been deleted, the page remains allocated. Therefore, a usage
  11. pattern in which most, but not all, keys in each range are eventually
  12. deleted will see poor use of space. For such usage patterns,
  13. periodic reindexing is recommended.
  14. </p><p>
  15. The potential for bloat in non-B-tree indexes has not been well
  16. researched. It is a good idea to periodically monitor the index's physical
  17. size when using any non-B-tree index type.
  18. </p><p>
  19. Also, for B-tree indexes, a freshly-constructed index is slightly faster to
  20. access than one that has been updated many times because logically
  21. adjacent pages are usually also physically adjacent in a newly built index.
  22. (This consideration does not apply to non-B-tree indexes.) It
  23. might be worthwhile to reindex periodically just to improve access speed.
  24. </p><p>
  25. <a class="xref" href="sql-reindex.html" title="REINDEX"><span class="refentrytitle">REINDEX</span></a> can be used safely and easily in all cases.
  26. This command requires an <code class="literal">ACCESS EXCLUSIVE</code> lock by
  27. default, hence it is often preferable to execute it with its
  28. <code class="literal">CONCURRENTLY</code> option, which requires only a
  29. <code class="literal">SHARE UPDATE EXCLUSIVE</code> lock.
  30. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="routine-vacuuming.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="maintenance.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="logfile-maintenance.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">24.1. Routine Vacuuming </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 24.3. Log File Maintenance</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1