pgsql: Modify MoveOfflineLogs/InstallXLogFileSegment to avoid O(N^2)

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Modify MoveOfflineLogs/InstallXLogFileSegment to avoid O(N^2)
Date: 2005-04-15 18:48:10
Message-ID: 20050415184810.BED5F53663@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Modify MoveOfflineLogs/InstallXLogFileSegment to avoid O(N^2) behavior
when recycling a large number of xlog segments during checkpoint.
The former behavior searched from the same start point each time,
requiring O(checkpoint_segments^2) stat() calls to relocate all the
segments. Instead keep track of where we stopped last time through.

Modified Files:
--------------
pgsql/src/backend/access/transam:
xlog.c (r1.184 -> r1.185)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c.diff?r1=1.184&r2=1.185)

Browse pgsql-committers by date

  From Date Subject
Next Message User Jwp 2005-04-15 21:45:45 python - ex: Fix logic(again) to allow all any exception with .code =
Previous Message Tom Lane 2005-04-15 16:40:59 pgsql: Revert addition of poorly-thought-out DUMP TIMESTAMP archive