X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 624DC9FA5BE for ; Thu, 15 Jun 2006 16:22:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 40653-06 for ; Thu, 15 Jun 2006 16:21:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by postgresql.org (Postfix) with ESMTP id 09FD49FA13E for ; Thu, 15 Jun 2006 16:21:51 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so372125ugf for ; Thu, 15 Jun 2006 12:21:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=BHxyoH3NR8e2SQ2ZwSIjdYTJk+so8W/9aFsyo/bYUx8jTFZKzzrXwEpHgZUGr7lR4V7/VsRAbmDhxC5BP3/shM58K/lBpl0LQvO3SQwJnP03zliS8FZ4/SAU53ylEiilSElQch6S7jD2BrIIZVd1YHHl18Sg3CoqpeQyj5qK1ZA= Received: by 10.67.96.14 with SMTP id y14mr2022890ugl; Thu, 15 Jun 2006 12:21:50 -0700 (PDT) Received: by 10.66.216.11 with HTTP; Thu, 15 Jun 2006 12:21:50 -0700 (PDT) Message-ID: Date: Thu, 15 Jun 2006 15:21:50 -0400 From: "John Vincent" Reply-To: pgsql-performance@lusis.org To: "Mark Lewis" Subject: Re: Optimizer internals Cc: "PGSQL Performance" In-Reply-To: <1150398064.31200.76.camel@archimedes> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9935_17630756.1150399310686" References: <1150396425.31200.66.camel@archimedes> <1150398064.31200.76.camel@archimedes> X-Google-Sender-Auth: c17534f664536b88 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/324 X-Sequence-Number: 19681 ------=_Part_9935_17630756.1150399310686 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/15/06, Mark Lewis wrote: > > > Unfortunately SUM is in the same boat as COUNT; in order for it to > return a meaningful result it must inspect visibility information for > all of the rows. > > -- Mark > We'll this is interesting news to say the least. We went with PostgreSQL for our warehouse because we needed the advanced features that MySQL didn't have at the time (views/sprocs). It sounds like we almost need another fact table for the places that we do SUM (which is not a problem just an additional map. If I'm interpreting this all correctly, we can't force PG to bypass a sequence scan even if we know our data is stable because of the MVCC aspect. In our case, as with most warehouses (except those that do rolling loads during the day), we only write data to it for about 5 hours at night in batch. Any suggestions? FYI the original question wasn't meant as a poke at comparing PG to MySQL to DB2. I'm not making an yvalue judgements either way. I'm just trying to understand how we can use it the best way possible. If anyone from the bizgres team is watching, have they done any work in this area? Thanks. John ------=_Part_9935_17630756.1150399310686 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/15/06, Mark Lewis <mark.lewis@mir3.com> wrote:

Unfortunately SUM is in the same boat as COUNT; in order for it to
return a meaningful result it must inspect visibility information for
all of the rows.

-- Mark

We'll this is interesting news to say the least. We went with PostgreSQL for our warehouse because we needed the advanced features that MySQL didn't have at the time (views/sprocs).

It sounds like we almost need another fact table for the places that we do SUM (which is not a problem just an additional map. If I'm interpreting this all correctly, we can't force PG to bypass a sequence scan even if we know our data is stable because of the MVCC aspect. In our case, as with most warehouses (except those that do rolling loads during the day), we only write data to it for about 5 hours at night in batch.

Any suggestions? FYI the original question wasn't meant as a poke at comparing PG to MySQL to DB2. I'm not making an yvalue judgements either way. I'm just trying to understand how we can use it the best way possible.

If anyone from the bizgres team is watching, have they done any work in this area?

Thanks.
John
------=_Part_9935_17630756.1150399310686--