You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/TODO.detail/optimizer
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1059,7 +1059,7 @@ From owner-pgsql-hackers@hub.org Thu Jan 20 18:45:32 2000
1059
1059
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
1060
1060
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id TAA00672
1061
1061
for <pgman@candle.pha.pa.us>; Thu, 20 Jan 2000 19:45:30 -0500 (EST)
1062
-
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.17 $) with ESMTP id TAA01989 for <pgman@candle.pha.pa.us>; Thu, 20 Jan 2000 19:39:15 -0500 (EST)
1062
+
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.18 $) with ESMTP id TAA01989 for <pgman@candle.pha.pa.us>; Thu, 20 Jan 2000 19:39:15 -0500 (EST)
1063
1063
Received: from localhost (majordom@localhost)
1064
1064
by hub.org (8.9.3/8.9.3) with SMTP id TAA00957;
1065
1065
Thu, 20 Jan 2000 19:35:19 -0500 (EST)
@@ -1919,4 +1919,3 @@ Best Regards,
1919
1919
Tiago
1920
1920
PS - again: I'm starting, so, some of my comments can be completly dumb.
Copy file name to clipboardExpand all lines: doc/TODO.detail/performance
+145-2Lines changed: 145 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -345,7 +345,7 @@ From owner-pgsql-hackers@hub.org Tue Oct 19 10:31:10 1999
345
345
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
346
346
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id KAA29087
347
347
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.2 $) 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.3 $) with ESMTP id KAA27535 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 10:19:47 -0400 (EDT)
349
349
Received: from localhost (majordom@localhost)
350
350
by hub.org (8.9.3/8.9.3) with SMTP id KAA30328;
351
351
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
454
454
Received: from renoir.op.net (root@renoir.op.net [209.152.193.4])
455
455
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA28130
456
456
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.2 $) 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.3 $) with ESMTP id VAA10512 for <maillist@candle.pha.pa.us>; Tue, 19 Oct 1999 21:15:28 -0400 (EDT)
458
458
Received: from localhost (majordom@localhost)
459
459
by hub.org (8.9.3/8.9.3) with SMTP id VAA50745;
460
460
Tue, 19 Oct 1999 21:07:23 -0400 (EDT)
@@ -552,3 +552,146 @@ Inoue@tpf.co.jp
552
552
553
553
************
554
554
555
+
From pgsql-hackers-owner+M6267@hub.org Sun Aug 27 21:46:37 2000
556
+
Received: from hub.org (root@hub.org [216.126.84.1])
557
+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA07972
558
+
for <pgman@candle.pha.pa.us>; Sun, 27 Aug 2000 20:46:36 -0400 (EDT)
559
+
Received: from hub.org (majordom@localhost [127.0.0.1])
560
+
by hub.org (8.10.1/8.10.1) with SMTP id e7S0kaL27996;
561
+
Sun, 27 Aug 2000 20:46:36 -0400 (EDT)
562
+
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
563
+
by hub.org (8.10.1/8.10.1) with ESMTP id e7S05aL24107
564
+
for <pgsql-hackers@postgreSQL.org>; Sun, 27 Aug 2000 20:05:36 -0400 (EDT)
565
+
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
566
+
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id UAA01604
567
+
for <pgsql-hackers@postgreSQL.org>; Sun, 27 Aug 2000 20:05:29 -0400 (EDT)
568
+
To: pgsql-hackers@postgreSQL.org
569
+
Subject: [HACKERS] Possible performance improvement: buffer replacement policy
570
+
Date: Sun, 27 Aug 2000 20:05:29 -0400
571
+
Message-ID: <1601.967421129@sss.pgh.pa.us>
572
+
From: Tom Lane <tgl@sss.pgh.pa.us>
573
+
X-Mailing-List: pgsql-hackers@postgresql.org
574
+
Precedence: bulk
575
+
Sender: pgsql-hackers-owner@hub.org
576
+
Status: ORr
577
+
578
+
Those of you with long memories may recall a benchmark that Edmund Mergl
579
+
drew our attention to back in May '99. That test showed extremely slow
580
+
performance for updating a table with many indexes (about 20). At the
581
+
time, it seemed the problem was due to bad performance of btree with
582
+
many equal keys, so I thought I'd go back and retry the benchmark after
583
+
this latest round of btree hackery.
584
+
585
+
The good news is that btree itself seems to be pretty well fixed; the
586
+
bad news is that the benchmark is still slow for large numbers of rows.
587
+
The problem is I/O: the CPU mostly sits idle waiting for the disk.
588
+
As best I can tell, the difficulty is that the working set of pages
589
+
needed to update this many indexes is too large compared to the number
590
+
of disk buffers Postgres is using. (I was running with -B 1000 and
591
+
looking at behavior for a 100000-row test table. This gave me a table
592
+
size of 3876 pages, plus 11526 pages in 20 indexes.)
593
+
594
+
Of course, there's only so much we can do when the number of buffers
595
+
is too small, but I still started to wonder if we are using the buffers
596
+
as effectively as we can. Some tracing showed that most of the pages
597
+
of the indexes were being read and written multiple times within a
598
+
single UPDATE query, while most of the pages of the table proper were
599
+
fetched and written only once. That says we're not using the buffers
600
+
as well as we could; the index pages are not being kept in memory when
601
+
they should be. In a query like this, we should displace main-table
602
+
pages sooner to allow keeping more index pages in cache --- but with
603
+
the simple LRU replacement method we use, once a page has been loaded
604
+
it will stay in cache for at least the next NBuffers (-B) page
605
+
references, no matter what. With a large NBuffers that's a long time.
606
+
607
+
I've come across an interesting article:
608
+
The LRU-K Page Replacement Algorithm For Database Disk Buffering
609
+
Elizabeth J. O'Neil, Patrick E. O'Neil, Gerhard Weikum
610
+
Proceedings of the 1993 ACM SIGMOD international conference
611
+
on Management of Data, May 1993
612
+
(If you subscribe to the ACM digital library, you can get a PDF of this
613
+
from there.) This article argues that standard LRU buffer management is
614
+
inherently not great for database caches, and that it's much better to
615
+
replace pages on the basis of time since the K'th most recent reference,
616
+
not just time since the most recent one. K=2 is enough to get most of
617
+
the benefit. The big win is that you are measuring an actual page
618
+
interreference time (between the last two references) and not just
619
+
dealing with a lower-bound guess on the interreference time. Frequently
620
+
used pages are thus much more likely to stay in cache.
621
+
622
+
It looks like it wouldn't take too much work to replace shared buffers
623
+
on the basis of LRU-2 instead of LRU, so I'm thinking about trying it.
624
+
625
+
Has anyone looked into this area? Is there a better method to try?
626
+
627
+
regards, tom lane
628
+
629
+
From prlw1@newn.cam.ac.uk Fri Jan 19 12:54:45 2001
630
+
Received: from henry.newn.cam.ac.uk (henry.newn.cam.ac.uk [131.111.204.130])
631
+
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id MAA29822
632
+
for <pgman@candle.pha.pa.us>; Fri, 19 Jan 2001 12:54:44 -0500 (EST)
633
+
Received: from [131.111.204.180] (helo=quartz.newn.cam.ac.uk)
634
+
by henry.newn.cam.ac.uk with esmtp (Exim 3.13 #1)
635
+
id 14JfkU-0001WA-00; Fri, 19 Jan 2001 17:54:54 +0000
636
+
Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 3.13 #1)
637
+
id 14Jfj6-0001cq-00; Fri, 19 Jan 2001 17:53:28 +0000
638
+
Date: Fri, 19 Jan 2001 17:53:28 +0000
639
+
From: Patrick Welche <prlw1@newn.cam.ac.uk>
640
+
To: Bruce Momjian <pgman@candle.pha.pa.us>
641
+
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@postgreSQL.org
642
+
Subject: Re: [HACKERS] Possible performance improvement: buffer replacement policy
0 commit comments