Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8087446

Browse files
committed
> That's a fairly useless place to put it, though, since someone would
> only think to look at sort_mem if they already had a clue. It should> be mentioned under bulk data load (in performance tips chapter)Attached is a doc patch that does this. The way I've worded it may notbe the best, though.Neil Conway
1 parentea079e2 commit8087446

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

‎doc/src/sgml/perform.sgml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.33 2003/09/11 18:30:38 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.34 2003/10/10 02:08:42 momjian Exp $
33
-->
44

55
<chapter id="performance-tips">
@@ -751,11 +751,10 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
751751

752752
<para>
753753
Use <command>COPY FROM STDIN</command> to load all the rows in one
754-
command, instead of using
755-
a series of <command>INSERT</command> commands. This reduces parsing,
756-
planning, etc.
757-
overhead a great deal. If you do this then it is not necessary to turn
758-
off autocommit, since it is only one command anyway.
754+
command, instead of using a series of <command>INSERT</command>
755+
commands. This reduces parsing, planning, etc. overhead a great
756+
deal. If you do this then it is not necessary to turn off
757+
autocommit, since it is only one command anyway.
759758
</para>
760759
</sect2>
761760

@@ -764,9 +763,9 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
764763

765764
<para>
766765
If you are loading a freshly created table, the fastest way is to
767-
create the table, bulk-loadwith <command>COPY</command>, then create any
768-
indexes needed
769-
for thetable. Creating an index on pre-existing data is quicker than
766+
create the table, bulkloadthe table's data using
767+
<command>COPY</command>, then create anyindexes neededfor the
768+
table. Creating an index on pre-existing data is quicker than
770769
updating it incrementally as each row is loaded.
771770
</para>
772771

@@ -780,6 +779,19 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
780779
</para>
781780
</sect2>
782781

782+
<sect2 id="populate-sort-mem">
783+
<title>Increase <varname>sort_mem</varname></title>
784+
785+
<para>
786+
Temporarily increasing the <varname>sort_mem</varname>
787+
configuration variable when restoring large amounts of data can
788+
lead to improved performance. This is because when a B-tree index
789+
is created from scratch, the existing content of the table needs
790+
to be sorted. Allowing the merge sort to use more buffer pages
791+
means that fewer merge passes will be required.
792+
</para>
793+
</sect2>
794+
783795
<sect2 id="populate-analyze">
784796
<title>Run <command>ANALYZE</command> Afterwards</title>
785797

‎doc/src/sgml/runtime.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.212 2003/10/09 19:05:09 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.213 2003/10/10 02:08:42 momjian Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -928,8 +928,9 @@ SET ENABLE_SEQSCAN TO OFF;
928928
by <literal>ORDER BY</>, merge joins, and <command>CREATE INDEX</>.
929929
Hash tables are used in hash joins, hash-based aggregation, and
930930
hash-based processing of <literal>IN</> subqueries. Because
931-
<command>CREATE INDEX</> is used when restoring a database, it might
932-
be good to temporarily increase this value during a restore.
931+
<command>CREATE INDEX</> is used when restoring a database,
932+
increasing <varname>sort_mem</varname> before doing a large
933+
restore operation can improve performance.
933934
</para>
934935
</listitem>
935936
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp