gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
4.1KB

  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>64.4. Implementation</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="gist-extensibility.html" title="64.3. Extensibility" /><link rel="next" href="gist-examples.html" title="64.5. Examples" /></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">64.4. Implementation</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="gist-extensibility.html" title="64.3. Extensibility">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="gist.html" title="Chapter 64. GiST Indexes">Up</a></td><th width="60%" align="center">Chapter 64. GiST Indexes</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="gist-examples.html" title="64.5. Examples">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="GIST-IMPLEMENTATION"><div class="titlepage"><div><div><h2 class="title" style="clear: both">64.4. Implementation</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="gist-implementation.html#GIST-BUFFERING-BUILD">64.4.1. GiST Buffering Build</a></span></dt></dl></div><div class="sect2" id="GIST-BUFFERING-BUILD"><div class="titlepage"><div><div><h3 class="title">64.4.1. GiST Buffering Build</h3></div></div></div><p>
  3. Building large GiST indexes by simply inserting all the tuples tends to be
  4. slow, because if the index tuples are scattered across the index and the
  5. index is large enough to not fit in cache, the insertions need to perform
  6. a lot of random I/O. Beginning in version 9.2, PostgreSQL supports a more
  7. efficient method to build GiST indexes based on buffering, which can
  8. dramatically reduce the number of random I/Os needed for non-ordered data
  9. sets. For well-ordered data sets the benefit is smaller or non-existent,
  10. because only a small number of pages receive new tuples at a time, and
  11. those pages fit in cache even if the index as whole does not.
  12. </p><p>
  13. However, buffering index build needs to call the <code class="function">penalty</code>
  14. function more often, which consumes some extra CPU resources. Also, the
  15. buffers used in the buffering build need temporary disk space, up to
  16. the size of the resulting index. Buffering can also influence the quality
  17. of the resulting index, in both positive and negative directions. That
  18. influence depends on various factors, like the distribution of the input
  19. data and the operator class implementation.
  20. </p><p>
  21. By default, a GiST index build switches to the buffering method when the
  22. index size reaches <a class="xref" href="runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE">effective_cache_size</a>. It can
  23. be manually turned on or off by the <code class="literal">buffering</code> parameter
  24. to the CREATE INDEX command. The default behavior is good for most cases,
  25. but turning buffering off might speed up the build somewhat if the input
  26. data is ordered.
  27. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gist-extensibility.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gist.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="gist-examples.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">64.3. Extensibility </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 64.5. Examples</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1