X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DF2CED1B445 for ; Tue, 2 Dec 2003 19:08:53 +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 79577-05 for ; Tue, 2 Dec 2003 15:08:28 -0400 (AST) Received: from penguin.goodinassociates.com (unknown [63.150.225.202]) by svr1.postgresql.org (Postfix) with ESMTP id 5F920D1B437 for ; Tue, 2 Dec 2003 15:08:22 -0400 (AST) Received: from [192.168.14.183] (bluejay.goodinassociates.com [192.168.14.183]) by penguin.goodinassociates.com (8.12.8/linuxconf) with ESMTP id hB2J8Dna011647 for ; Tue, 2 Dec 2003 13:08:13 -0600 Subject: Re: cross table indexes or something? From: Jeremiah Jahn To: postgres performance In-Reply-To: <200312011147.51359.josh@agliodbs.com> References: <1069877651.22346.13.camel@bluejay.goodinassociates.com> <1069885949.3176.57.camel@fuji.krosing.net> <1070288942.22346.27.camel@bluejay.goodinassociates.com> <200312011147.51359.josh@agliodbs.com> Content-Type: text/plain Message-Id: <1070392092.22346.43.camel@bluejay.goodinassociates.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-7) Date: Tue, 02 Dec 2003 13:08:13 -0600 Content-Transfer-Encoding: 7bit X-RAVMilter-Version: 8.4.4(snapshot 20030410) (penguin.goodinassociates.com) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/29 X-Sequence-Number: 4889 Thanks to all, I had already run analyze. But the STATISTICS setting seems to have worked. I'm just not sure what it did..? Would anyone care to explain. On Mon, 2003-12-01 at 13:47, Josh Berkus wrote: > Jeremiah, > > > I've attached the Analyze below. I have no idea why the db thinks there > > is only 1 judge named simth. Is there some what I can inform the DB > > about this. In actuality, there aren't any judges named smith at the > > moment, but there are 22K people named smith. > > No, Hannu meant that you may need to run the following command: > > ANALYZE actor; > > ... to update the database statistics on the actors table. That is a > maintainence task that needs to be run periodically. > > If that doesn't fix the bad plan, then the granularity of statistics on the > full_name column needs updating; I suggest: > > ALTER TABLE actor ALTER COLUMN full_name SET STATISTICS 100; > ANALYZE actor; > > And if it's still choosing a slow nested loop, up the stats to 250. -- Jeremiah Jahn