X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4F7ABD1B1BE for ; Sat, 17 Jul 2004 21:02:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24483-04 for ; Sun, 18 Jul 2004 00:02:07 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id 157CCD1B18A for ; Sat, 17 Jul 2004 21:02:03 -0300 (ADT) Received: from [64.81.245.111] (HELO temoku.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 5791976; Sat, 17 Jul 2004 17:03:17 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: fred@redhotpenguin.com, pgsql-performance@postgresql.org Subject: Re: Scaling with lazy index updates Date: Sat, 17 Jul 2004 17:02:20 -0700 User-Agent: KMail/1.5.4 References: <33721.67.116.52.35.1090035034.squirrel@mail.redhotpenguin.com> In-Reply-To: <33721.67.116.52.35.1090035034.squirrel@mail.redhotpenguin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200407171702.20997.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/115 X-Sequence-Number: 7506 Howdy Fred, > This might be a out of the ordinary question, or perhaps I have been out > of the loop for a while but does PostgreSQL (or any other database) have > support for lazy index updates. What I mean by lazy index updates is > index updating which occur at a regular interval rather than per > transaction. In a word: No. The issue with "asynchronous index updates" (which is what you asked about) is that they don't work with the way PostgreSQL uses indexes. If the index hasn't been updated, then when a query uses an index scan the row simply wouldn't show up. If that's acceptable behavior for you, then perhaps you could consider asynchronous *table* updates, done at the application layer, which would be much easier to implement. We do as much as we can by offloading b-tree "cleanup" for indexes until VACUUM/REINDEX, which is called manually. Hmmm. Can you think of an example of an RDBMS which does *not* update indexes immediately (and transactionally)? I can't. -- -Josh Berkus Aglio Database Solutions San Francisco