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

Commit951750b

Browse files
committed
Add LAZY messages.
1 parent04a92ff commit951750b

File tree

1 file changed

+173
-3
lines changed

1 file changed

+173
-3
lines changed

‎doc/TODO.detail/performance

Lines changed: 173 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ From owner-pgsql-hackers@hub.org Tue Oct 19 10:31:10 1999
345345
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
346346
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id KAA29087
347347
for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 10:31:08 -0400 (EDT)
348-
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.9 $) with ESMTP id KAA27535 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 10:19:47 -0400 (EDT)
348+
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.10 $) with ESMTP id KAA27535 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 10:19:47 -0400 (EDT)
349349
Received: from localhost (majordom@localhost)
350350
by hub.org (8.9.3/8.9.3) with SMTP id KAA30328;
351351
Tue, 19 Oct 1999 10:12:10 -0400 (EDT)
@@ -454,7 +454,7 @@ From owner-pgsql-hackers@hub.org Tue Oct 19 21:25:30 1999
454454
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
455455
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA28130
456456
for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 21:25:26 -0400 (EDT)
457-
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.9 $) with ESMTP id VAA10512 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 21:15:28 -0400 (EDT)
457+
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.10 $) with ESMTP id VAA10512 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 21:15:28 -0400 (EDT)
458458
Received: from localhost (majordom@localhost)
459459
by hub.org (8.9.3/8.9.3) with SMTP id VAA50745;
460460
Tue, 19 Oct 1999 21:07:23 -0400 (EDT)
@@ -1006,7 +1006,7 @@ From pgsql-general-owner+M2497@hub.org Fri Jun 16 18:31:03 2000
10061006
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
10071007
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id RAA04165
10081008
for <pgman@candle.pha.pa.us>; Fri, 16 Jun 2000 17:31:01 -0400 (EDT)
1009-
Received: from hub.org (root@hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.9 $) with ESMTP id RAA13110 for <pgman@candle.pha.pa.us>; Fri, 16 Jun 2000 17:20:12 -0400 (EDT)
1009+
Received: from hub.org (root@hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.10 $) with ESMTP id RAA13110 for <pgman@candle.pha.pa.us>; Fri, 16 Jun 2000 17:20:12 -0400 (EDT)
10101010
Received: from hub.org (majordom@localhost [127.0.0.1])
10111011
by hub.org (8.10.1/8.10.1) with SMTP id e5GLDaM14477;
10121012
Fri, 16 Jun 2000 17:13:36 -0400 (EDT)
@@ -1113,3 +1113,173 @@ Giles
11131113

11141114

11151115

1116+
From pgsql-hackers-owner+M1795@postgresql.org Thu Dec 7 18:47:52 2000
1117+
Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28])
1118+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id SAA09172
1119+
for <pgman@candle.pha.pa.us>; Thu, 7 Dec 2000 18:47:52 -0500 (EST)
1120+
Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28])
1121+
by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB7NjFP10612;
1122+
Thu, 7 Dec 2000 18:45:15 -0500 (EST)
1123+
(envelope-from pgsql-hackers-owner+M1795@postgresql.org)
1124+
Received: from thor.tht.net (thor.tht.net [209.47.145.4])
1125+
by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB7N6BP08233
1126+
for <pgsql-hackers@postgresql.org>; Thu, 7 Dec 2000 18:06:11 -0500 (EST)
1127+
(envelope-from bright@fw.wintelcom.net)
1128+
Received: from fw.wintelcom.net (bright@ns1.wintelcom.net [209.1.153.20])
1129+
by thor.tht.net (8.9.3/8.9.3) with ESMTP id SAA97456
1130+
for <pgsql-hackers@postgresql.org>; Thu, 7 Dec 2000 18:57:32 GMT
1131+
(envelope-from bright@fw.wintelcom.net)
1132+
Received: (from bright@localhost)
1133+
by fw.wintelcom.net (8.10.0/8.10.0) id eB7MvWE21269
1134+
for pgsql-hackers@postgresql.org; Thu, 7 Dec 2000 14:57:32 -0800 (PST)
1135+
Date: Thu, 7 Dec 2000 14:57:32 -0800
1136+
From: Alfred Perlstein <bright@wintelcom.net>
1137+
To: pgsql-hackers@postgresql.org
1138+
Subject: [HACKERS] Patches with vacuum fixes available for 7.0.x
1139+
Message-ID: <20001207145732.X16205@fw.wintelcom.net>
1140+
MIME-Version: 1.0
1141+
Content-Type: text/plain; charset=us-ascii
1142+
Content-Disposition: inline
1143+
User-Agent: Mutt/1.2.5i
1144+
Precedence: bulk
1145+
Sender: pgsql-hackers-owner@postgresql.org
1146+
Status: ORr
1147+
1148+
We recently had a very satisfactory contract completed by
1149+
Vadim.
1150+
1151+
Basically Vadim has been able to reduce the amount of time
1152+
taken by a vacuum from 10-15 minutes down to under 10 seconds.
1153+
1154+
We've been running with these patches under heavy load for
1155+
about a week now without any problems except one:
1156+
don't 'lazy' (new option for vacuum) a table which has just
1157+
had an index created on it, or at least don't expect it to
1158+
take any less time than a normal vacuum would.
1159+
1160+
There's three patchsets and they are available at:
1161+
1162+
http://people.freebsd.org/~alfred/vacfix/
1163+
1164+
complete diff:
1165+
http://people.freebsd.org/~alfred/vacfix/v.diff
1166+
1167+
only lazy vacuum option to speed up index vacuums:
1168+
http://people.freebsd.org/~alfred/vacfix/vlazy.tgz
1169+
1170+
only lazy vacuum option to only scan from start of modified
1171+
data:
1172+
http://people.freebsd.org/~alfred/vacfix/mnmb.tgz
1173+
1174+
Although the patches are for 7.0.x I'm hoping that they
1175+
can be forward ported (if Vadim hasn't done it already)
1176+
to 7.1.
1177+
1178+
enjoy!
1179+
1180+
--
1181+
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
1182+
"I have the heart of a child; I keep it in a jar on my desk."
1183+
1184+
From pgsql-hackers-owner+M1809@postgresql.org Thu Dec 7 20:27:39 2000
1185+
Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28])
1186+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA11827
1187+
for <pgman@candle.pha.pa.us>; Thu, 7 Dec 2000 20:27:38 -0500 (EST)
1188+
Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28])
1189+
by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB81PsP22362;
1190+
Thu, 7 Dec 2000 20:25:54 -0500 (EST)
1191+
(envelope-from pgsql-hackers-owner+M1809@postgresql.org)
1192+
Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20])
1193+
by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB81JkP21783
1194+
for <pgsql-hackers@postgresql.org>; Thu, 7 Dec 2000 20:19:46 -0500 (EST)
1195+
(envelope-from bright@fw.wintelcom.net)
1196+
Received: (from bright@localhost)
1197+
by fw.wintelcom.net (8.10.0/8.10.0) id eB81JwU25447;
1198+
Thu, 7 Dec 2000 17:19:58 -0800 (PST)
1199+
Date: Thu, 7 Dec 2000 17:19:58 -0800
1200+
From: Alfred Perlstein <bright@wintelcom.net>
1201+
To: Tom Lane <tgl@sss.pgh.pa.us>
1202+
cc: pgsql-hackers@postgresql.org
1203+
Subject: Re: [HACKERS] Patches with vacuum fixes available for 7.0.x
1204+
Message-ID: <20001207171958.B16205@fw.wintelcom.net>
1205+
References: <20001207145732.X16205@fw.wintelcom.net> <28791.976236143@sss.pgh.pa.us>
1206+
MIME-Version: 1.0
1207+
Content-Type: text/plain; charset=us-ascii
1208+
Content-Disposition: inline
1209+
User-Agent: Mutt/1.2.5i
1210+
In-Reply-To: <28791.976236143@sss.pgh.pa.us>; from tgl@sss.pgh.pa.us on Thu, Dec 07, 2000 at 07:42:23PM -0500
1211+
Precedence: bulk
1212+
Sender: pgsql-hackers-owner@postgresql.org
1213+
Status: OR
1214+
1215+
* Tom Lane <tgl@sss.pgh.pa.us> [001207 17:10] wrote:
1216+
> Alfred Perlstein <bright@wintelcom.net> writes:
1217+
> > Basically Vadim has been able to reduce the amount of time
1218+
> > taken by a vacuum from 10-15 minutes down to under 10 seconds.
1219+
>
1220+
> Cool. What's it do, exactly?
1221+
1222+
================================================================
1223+
1224+
The first is a bonus that Vadim gave us to speed up index
1225+
vacuums, I'm not sure I understand it completely, but it
1226+
work really well. :)
1227+
1228+
here's the README he gave us:
1229+
1230+
Vacuum LAZY index cleanup option
1231+
1232+
LAZY vacuum option introduces new way of indices cleanup.
1233+
Instead of reading entire index file to remove index tuples
1234+
pointing to deleted table records, with LAZY option vacuum
1235+
performes index scans using keys fetched from table record
1236+
to be deleted. Vacuum checks each result returned by index
1237+
scan if it points to target heap record and removes
1238+
corresponding index tuple.
1239+
This can greatly speed up indices cleaning if not so many
1240+
table records were deleted/modified between vacuum runs.
1241+
Vacuum uses new option on user' demand.
1242+
1243+
New vacuum syntax is:
1244+
1245+
vacuum [verbose] [analyze] [lazy] [table [(columns)]]
1246+
1247+
================================================================
1248+
1249+
The second is one of the suggestions I gave on the lists a while
1250+
back, keeping track of the "last dirtied" block in the data files
1251+
to only scan the tail end of the file for deleted rows, I think
1252+
what he instead did was keep a table that holds all the modified
1253+
blocks and vacuum only scans those:
1254+
1255+
Minimal Number Modified Block (MNMB)
1256+
1257+
This feature is to track MNMB of required tables with triggers
1258+
to avoid reading unmodified table pages by vacuum. Triggers
1259+
store MNMB in per-table files in specified directory
1260+
($LIBDIR/contrib/mnmb by default) and create these files if not
1261+
existed.
1262+
1263+
Vacuum first looks up functions
1264+
1265+
mnmb_getblock(Oid databaseId, Oid tableId)
1266+
mnmb_setblock(Oid databaseId, Oid tableId, Oid block)
1267+
1268+
in catalog. If *both* functions were found *and* there was no
1269+
ANALYZE option specified then vacuum calls mnmb_getblock to obtain
1270+
MNMB for table being vacuumed and starts reading this table from
1271+
block number returned. After table was processed vacuum calls
1272+
mnmb_setblock to update data in file to last table block number.
1273+
Neither mnmb_getblock nor mnmb_setblock try to create file.
1274+
If there was no file for table being vacuumed then mnmb_getblock
1275+
returns 0 and mnmb_setblock does nothing.
1276+
mnmb_setblock() may be used to set in file MNMB to 0 and force
1277+
vacuum to read entire table if required.
1278+
1279+
To compile MNMB you have to add -DMNMB to CUSTOM_COPT
1280+
in src/Makefile.custom.
1281+
1282+
--
1283+
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
1284+
"I have the heart of a child; I keep it in a jar on my desk."
1285+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp