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

Commit2bddc22

Browse files
committed
remove from tail of filelist on modern postgres
Modern postgres actually uses array as List implementation.Therefore, removing element from head is quite expensive.
1 parent78baca7 commit2bddc22

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎ptrack.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,21 @@ ptrack_filelist_getnext(PtScanCtx * ctx)
402402
if (list_length(ctx->filelist)==0)
403403
return-1;
404404

405+
#ifdefforeach_current_index
406+
/* Get first file from the head */
407+
cell=list_tail(ctx->filelist);
408+
pfl= (PtrackFileList_i*)lfirst(cell);
409+
410+
/* Remove this file from the list */
411+
ctx->filelist=list_delete_last(ctx->filelist);
412+
#else
405413
/* Get first file from the head */
406414
cell=list_head(ctx->filelist);
407415
pfl= (PtrackFileList_i*)lfirst(cell);
408416

409417
/* Remove this file from the list */
410418
ctx->filelist=list_delete_first(ctx->filelist);
419+
#endif
411420

412421
if (pfl->segno>0)
413422
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp