X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 21864D1CAF6 for ; Tue, 24 Feb 2004 17:02:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 09164-04 for ; Tue, 24 Feb 2004 13:02:01 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id ADC21D1BAC2 for ; Tue, 24 Feb 2004 13:02:00 -0400 (AST) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4484806; Tue, 24 Feb 2004 09:03:06 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Kevin Brown , Postgres Performance Subject: Re: Column correlation drifts, index ignored again Date: Tue, 24 Feb 2004 08:59:32 -0800 User-Agent: KMail/1.4.3 References: <200402221617.27658.josh@agliodbs.com> <20040224035601.GC3090@filer> In-Reply-To: <20040224035601.GC3090@filer> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200402240859.32312.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/280 X-Sequence-Number: 5804 Kevin, > 1. set enable_seqscan = on > 2. set random_page_cost = > 3. EXPLAIN ANALYZE query > 4. record the ratio of estimated to actual scan times. > 5. set enable_seqscan = off > 6. set random_page_cost = > 7. EXPLAIN ANALYZE query > 8. record the actual index scan time(s) > 9. tweak random_page_cost > 10. EXPLAIN query > 11. If ratio of estimate to actual (recorded in step 8) is much > different than that recorded in step 4, then go back to step 9. > Reduce random_page_cost if the random ratio is larger than the > sequential ratio, increase if it's smaller. Nice, we ought to post that somewhere people can find it in the future. I'm also glad that your new job allows you to continue doing PostgreSQL stuff. -- Josh Berkus Aglio Database Solutions San Francisco