mirror of
https://github.com/postgres/postgres.git
synced 2025-05-21 15:54:08 +03:00
Add description of tsvector type layout
This commit is contained in:
parent
3538b740f3
commit
60a25e6f6f
@ -47,6 +47,20 @@ typedef uint16 WordEntryPos;
|
|||||||
#define MAXNUMPOS 256
|
#define MAXNUMPOS 256
|
||||||
#define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) )
|
#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
|
typedef struct
|
||||||
{
|
{
|
||||||
int4 len;
|
int4 len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user