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

Commit246be30

Browse files
committed
Add mention of performance impact on LIKE of non-C locales.
1 parenta2a5526 commit246be30

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

‎doc/src/sgml/charset.sgml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.47 2004/12/27 22:30:10 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.48 2005/01/04 00:05:44 momjian Exp $ -->
22

33
<chapter id="charset">
44
<title>Localization</>
@@ -189,10 +189,10 @@ initdb --locale=sv_SE
189189
</sect2>
190190

191191
<sect2>
192-
<title>Benefits</>
192+
<title>Behavior</>
193193

194194
<para>
195-
Locale support influencesin particularthe following features:
195+
Locale support influences the following features:
196196

197197
<itemizedlist>
198198
<listitem>
@@ -202,6 +202,13 @@ initdb --locale=sv_SE
202202
</para>
203203
</listitem>
204204

205+
<listitem>
206+
<para>
207+
The ability to use indexes with <literal>LIKE</> clauses
208+
<indexterm><primary>LIKE</><secondary>and locales</></indexterm>
209+
</para>
210+
</listitem>
211+
205212
<listitem>
206213
<para>
207214
The <function>to_char</> family of functions
@@ -211,9 +218,11 @@ initdb --locale=sv_SE
211218
</para>
212219

213220
<para>
214-
The only severe drawback of using the locale support in
215-
<productname>PostgreSQL</> is its speed. So use locales only if
216-
you actually need them.
221+
The drawback of using locales other than <literal>C</> or
222+
<literal>POSIX</> in <productname>PostgreSQL</> is its performance
223+
impact. It slows character handling and prevents ordinary indexes
224+
from being used by <literal>LIKE</>. For this reason use locales
225+
only if you actually need them.
217226
</para>
218227
</sect2>
219228

‎doc/src/sgml/ref/initdb.sgml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.32 2004/08/01 06:19:18 momjian Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/initdb.sgml,v 1.33 2005/01/04 00:05:45 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -54,21 +54,22 @@ PostgreSQL documentation
5454
</para>
5555

5656
<para>
57-
<command>initdb</command> initializes the database cluster's
58-
default locale and character set encoding. Some locale categories
59-
are fixed for the lifetime of the cluster, so it is important to
60-
make the right choice when running <command>initdb</command>.
61-
Other locale categories can be changed later when the server is
62-
started. <command>initdb</command> will write those locale
63-
settings into the <filename>postgresql.conf</filename>
64-
configuration file so they are the default, but they can be changed
65-
by editing that file. To set the locale that
66-
<command>initdb</command> uses, see the description of the
67-
<option>--locale</option> option. The character set encoding can
57+
<command>initdb</command> initializes the database cluster's default
58+
locale and character set encoding. Some locale categories are fixed
59+
for the lifetime of the cluster. There is also a performance impact
60+
in using locales other than <literal>C</> or <literal>POSIX</>.
61+
Therefore it is important to make the right choice when running
62+
<command>initdb</command>. Other locale categories can be changed
63+
later when the server is started. <command>initdb</command> will
64+
write those locale settings into the
65+
<filename>postgresql.conf</filename> configuration file so they are
66+
the default, but they can be changed by editing that file. To set the
67+
locale that <command>initdb</command> uses, see the description of
68+
the <option>--locale</option> option. The character set encoding can
6869
be set separately for each database as it is created.
6970
<command>initdb</command> determines the encoding for the
7071
<literal>template1</literal> database, which will serve as the
71-
default for all other databases.To alter the default encoding use
72+
default for all other databases. To alter the default encoding use
7273
the <option>--encoding</option> option.
7374
</para>
7475

‎doc/src/sgml/runtime.sgml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.299 2004/12/26 23:06:56 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.300 2005/01/04 00:05:44 momjian Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -144,9 +144,10 @@ postgres$ <userinput>initdb -D /usr/local/pgsql/data</userinput>
144144
that can be found in <xref linkend="locale">. The sort order used
145145
within a particular database cluster is set by
146146
<command>initdb</command> and cannot be changed later, short of
147-
dumping all data, rerunning <command>initdb</command>, and
148-
reloading the data. So it's important to make this choice correctly
149-
the first time.
147+
dumping all data, rerunning <command>initdb</command>, and reloading
148+
the data. There is also a performance impact for using locales
149+
other than <literal>C</> or <literal>POSIX</>. Therefore, it is
150+
important to make this choice correctly the first time.
150151
</para>
151152
</sect1>
152153

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp