diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2006-08-29 13:57:11 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2006-08-29 13:57:11 +0000 |
commit | 60a25e6f6f0596208ce83b46a0d79ca666817deb (patch) | |
tree | 171dc17a576447495591e5a0e9d0430a344d53b1 | |
parent | 3538b740f375d7cc9ae75f4bdc44593f5e5aef77 (diff) | |
download | postgresql-60a25e6f6f0596208ce83b46a0d79ca666817deb.tar.gz postgresql-60a25e6f6f0596208ce83b46a0d79ca666817deb.zip |
Add description of tsvector type layout
-rw-r--r-- | contrib/tsearch2/tsvector.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/tsearch2/tsvector.h b/contrib/tsearch2/tsvector.h index b30d3239f39..df03436a0a9 100644 --- a/contrib/tsearch2/tsvector.h +++ b/contrib/tsearch2/tsvector.h @@ -47,6 +47,20 @@ typedef uint16 WordEntryPos; #define MAXNUMPOS 256 #define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) ) +/* + * Structure of tsvector datatype: + * 1) int4 len - varlena's length + * 2) int4 size - number of lexemes or WordEntry array, which is the same + * 3) Array of WordEntry - sorted array, comparison based on word's length + * and strncmp(). WordEntry->pos points number of + * bytes from end of WordEntry array to start of + * corresponding lexeme. + * 4) Lexeme's storage: + * SHORTALIGNED(lexeme) and position information if it exists + * Position information: first int2 - is a number of positions and it + * follows array of WordEntryPos + */ + typedef struct { int4 len; |