1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5
>GIN Tips and Tricks</TITLE
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
12
TITLE="PostgreSQL 9.1beta1 Documentation"
13
HREF="index.html"><LINK
18
TITLE="Implementation"
19
HREF="gin-implementation.html"><LINK
22
HREF="gin-limit.html"><LINK
25
HREF="stylesheet.css"><META
26
HTTP-EQUIV="Content-Type"
27
CONTENT="text/html; charset=ISO-8859-1"><META
29
CONTENT="2011-04-27T21:20:33"></HEAD
35
SUMMARY="Header navigation table"
47
>PostgreSQL 9.1beta1 Documentation</A
56
TITLE="Implementation"
57
HREF="gin-implementation.html"
74
>Chapter 54. GIN Indexes</TD
105
>54.4. GIN Tips and Tricks</A
113
>Create vs. insert</DT
116
> Insertion into a <ACRONYM
120
due to the likelihood of many keys being inserted for each item.
121
So, for bulk insertions into a table it is advisable to drop the GIN
122
index and recreate it after finishing bulk insertion.
128
> 8.4, this advice is less
129
necessary since delayed indexing is used (see <A
130
HREF="gin-implementation.html#GIN-FAST-UPDATE"
132
> for details). But for very large updates
133
it may still be best to drop and recreate the index.
138
HREF="runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM"
139
>maintenance_work_mem</A
143
> Build time for a <ACRONYM
146
> index is very sensitive to
149
>maintenance_work_mem</TT
150
> setting; it doesn't pay to
151
skimp on work memory during index creation.
156
HREF="runtime-config-resource.html#GUC-WORK-MEM"
161
> During a series of insertions into an existing <ACRONYM
168
> enabled, the system will clean up
169
the pending-entry list whenever the list grows larger than
173
>. To avoid fluctuations in observed response time,
174
it's desirable to have pending-list cleanup occur in the background
175
(i.e., via autovacuum). Foreground cleanup operations can be avoided by
179
> or making autovacuum more aggressive.
180
However, enlarging <TT
183
> means that if a foreground
184
cleanup does occur, it will take even longer.
189
HREF="runtime-config-client.html#GUC-GIN-FUZZY-SEARCH-LIMIT"
190
>gin_fuzzy_search_limit</A
194
> The primary goal of developing <ACRONYM
198
to create support for highly scalable full-text search in
202
>, and there are often situations when
203
a full-text search returns a very large set of results. Moreover, this
204
often happens when the query contains very frequent words, so that the
205
large result set is not even useful. Since reading many
206
tuples from the disk and sorting them could take a lot of time, this is
207
unacceptable for production. (Note that the index search itself is very
211
> To facilitate controlled execution of such queries,
215
> has a configurable soft upper limit on the
216
number of rows returned: the
219
>gin_fuzzy_search_limit</TT
220
> configuration parameter.
221
It is set to 0 (meaning no limit) by default.
222
If a non-zero limit is set, then the returned set is a subset of
223
the whole result set, chosen at random.
229
> means that the actual number of returned results
230
could differ somewhat from the specified limit, depending on the query
231
and the quality of the system's random number generator.
234
> From experience, values in the thousands (e.g., 5000 — 20000)
246
SUMMARY="Footer navigation table"
257
HREF="gin-implementation.html"
275
HREF="gin-limit.html"
b'\\ No newline at end of file'