Re: string_to_array eats too much memory?

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: string_to_array eats too much memory?
Date: 2006-11-08 15:50:11
Message-ID: 4551FCB3.7080101@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> tsvector size should not be greater than 1Mb however.
>
> Is this documented somewhere? Also I noticed that tsearch2 treats ":"
> as a special character. Are there any special characters? If so where
> are they documented?
http://www.sai.msu.su/~megera/wiki/Tsearch_V2_in_Brief
Limitations

13.1 2048 bytes for lexems
13.2 ts_vector has limit about 1Mb. Exact value depends on
quantity of position information. If there is no any position
information, then sum of length of lexem must be less than 1Mb,
otherwise, sum of length of and pos. info.
Positional information uses 2 bytes per each
position and 2 bytes per lexem with pos info. The number of
lexems is limited by 4^32, so in practice it's unlimited.
13.3 ts_query:
Number of entries (nodes, i.e sum of lexems and operation)
is limited: internal representation is in polish notation
and position of one operand is pointed by int2, so it's
rather soft limit.
In any case, low range of limit - 32768 nodes.
Notice: ts_query doesn't designed for storing in table and
is optimized for speed, not for size.
13.4 Positional information in ts_vector:
13.4.1 Value of position may not be greater than 2^14 (16384),
any value greater than this limit will be replaced
by 16383.
13.4.2 Only 256 positional info per lexem.

Some useful articles
http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/HOWTO-parser-tsearch2.html
http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/custom-dict.html

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2006-11-08 15:54:28 Re: string_to_array eats too much memory?
Previous Message Tatsuo Ishii 2006-11-08 15:11:34 Re: string_to_array eats too much memory?