X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id AB321D1B4E3 for ; Mon, 8 Sep 2003 18:50:03 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 05037-01 for ; Mon, 8 Sep 2003 15:49:33 -0300 (ADT) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id B14C8D1B4EB for ; Mon, 8 Sep 2003 15:49:31 -0300 (ADT) Received: from 6-allhosts (d226-85-166.home.cgocable.net [24.226.85.166]) by bob.samurai.com (Postfix) with ESMTP id 62F261D96; Mon, 8 Sep 2003 14:49:32 -0400 (EDT) Subject: Re: slow plan for min/max From: Neil Conway To: "scott.marlowe" Cc: Pailloncy =?ISO-8859-1?Q?Jean-G=E9rard?= , PostgreSQL Performance In-Reply-To: References: Content-Type: text/plain Message-Id: <1063046951.9051.68.camel@tokyo> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 08 Sep 2003 14:49:12 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/125 X-Sequence-Number: 3491 On Mon, 2003-09-08 at 11:56, scott.marlowe wrote: > Basically, Postgresql uses an MVCC locking system that makes massively > parallel operation possible, but costs in certain areas, and one of those > areas is aggregate performance over large sets. MVCC makes it very hard > to optimize all but the simplest of aggregates, and even those > optimzations which are possible would wind up being quite ugly at the > parser level. As was pointed out in a thread a couple days ago, MIN/MAX() optimization has absolutely nothing to do with MVCC. It does, however, make optimizing COUNT() more difficult. -Neil