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

Commiteeb0a98

Browse files
author
Artur Zakirov
committed
Issue#13. Add explain comment.
1 parent6de4605 commiteeb0a98

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/rum_ts_utils.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,14 @@ rum_extract_tsvector_internal(TSVectorvector,
539539
if (we->haspos)
540540
{
541541
posVec=_POSVECPTR(vector,we);
542+
543+
/*
544+
* In some cases compressed positions may take more memory than
545+
* uncompressed positions. So allocate memory with a margin.
546+
*/
542547
posDataSize=VARHDRSZ+2*posVec->npos*sizeof(WordEntryPos);
543548
posData= (bytea*)palloc(posDataSize);
549+
544550
posDataSize=compress_pos(posData->vl_dat,posVec->pos,posVec->npos)+VARHDRSZ;
545551
SET_VARSIZE(posData,posDataSize);
546552

@@ -1579,6 +1585,10 @@ rum_ts_join_pos(PG_FUNCTION_ARGS)
15791585

15801586
Assert(countRes <= (count1+count2));
15811587

1588+
/*
1589+
* In some cases compressed positions may take more memory than
1590+
* uncompressed positions. So allocate memory with a margin.
1591+
*/
15821592
size=VARHDRSZ+2*sizeof(WordEntryPos)*countRes;
15831593
result=palloc(size);
15841594

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp