From: Josh Berkus <josh@agliodbs.com>
To: Jeremiah Jahn <jeremiah@cs.earlham.edu>
To: Hannu Krosing <hannu@tm.ee>
Cc: postgres performance <pgsql-performance@postgresql.org>
Subject: Re: cross table indexes or something?
Date: Mon, 1 Dec 2003 11:47:51 -0800
Message-ID: <200312011147.51359.josh@agliodbs.com> (raw)
In-Reply-To: <1070288942.22346.27.camel@bluejay.goodinassociates.com>
References: <1069877651.22346.13.camel@bluejay.goodinassociates.com>
<1069885949.3176.57.camel@fuji.krosing.net>
<1070288942.22346.27.camel@bluejay.goodinassociates.com>
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.
--
Josh Berkus
Aglio Database Solutions
San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: josh@agliodbs.com, jeremiah@cs.earlham.edu, hannu@tm.ee
Subject: Re: cross table indexes or something?
In-Reply-To: <200312011147.51359.josh@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox