X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1091F9FA30C for ; Fri, 2 Jun 2006 19:59:36 -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 31898-10 for ; Fri, 2 Jun 2006 19:59:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by postgresql.org (Postfix) with ESMTP id 9FFD99FA2C7 for ; Fri, 2 Jun 2006 19:59:28 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1FmIbu-0002f8-00; Fri, 02 Jun 2006 18:59:18 -0400 To: josh@agliodbs.com Cc: Greg Stark , Tom Lane , David Fetter , pgsql-hackers@postgresql.org Subject: Re: More thoughts about planner's cost estimates References: <14821.1149104747@sss.pgh.pa.us> <10464.1149281016@sss.pgh.pa.us> <87k67zdymk.fsf@stark.xeocode.com> <200606021515.44174.josh@agliodbs.com> In-Reply-To: <200606021515.44174.josh@agliodbs.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 02 Jun 2006 18:59:18 -0400 Message-ID: <873bendv09.fsf@stark.xeocode.com> Lines: 44 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/96 X-Sequence-Number: 84329 Josh Berkus writes: > Greg, Tom, > > > But for most users analyze doesn't really have to run as often as > > vacuum. One sequential scan per night doesn't seem like that big a deal > > to me. > > Clearly you don't have any 0.5 TB databases. Actually I did not so long ago. Sequential scans in an OLTP query would be a disaster. But a single sequential scan run at a controlled time wouldn't concern me as long as *all* of the following constraints are met: a) You can run them at your leisure at off-peak times when your i/o bandwidth isn't in short supply. b) You don't need the results urgently so you don't care if it takes a while to run. c) You don't need many of them at the same time. Even on your production system surely you occasionally, say, take a full backup or run "select count(*)" or other sanity checks on the data? > > > I'd still be worried about the CPU pain though. ANALYZE can afford to > > > expend a pretty fair number of cycles per sampled tuple, but with a > > > whole-table sample that's going to add up. > > Agreed. Despite conventional wisdom, most PostgreSQL databases ... even > those with high level OLTP or very large DW ... are CPU-bound. We > really don't want an ANALYZE which is an order-of-magnitude increase in > CPU activity. I don't think Tom was actually expressing concern about ANALYZE becoming more expensive, but about tying ANALYZE and VACUUM together and making VACUUM more expensive. VACUUM is something we want to encourage people to think they can run all day long, not just occasionally. -- greg