Re: query plan worse after analyze

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 6 Oct 2007, Tom Lane wrote:

"Jeff Frost" <jeff@xxxxxxxxxxxxxxxxxxxxxx> writes:
Before analyze it seems to choose Bitmap Heap Scan on episodes
current_episode, but after it chooses Index Scan Backward using
index_episodes_on_publish_on on episodes current_episode.

Have you tried raising the stats target for "episodes"?  Seems like
the problem is a misestimate of the frequency of matches for
season_id = something.

Can you set the stats target for an entire table up?

I tried this:

ALTER TABLE episodes ALTER COLUMN season_id SET STATISTICS 1000;

and got the same plan.

And since I had this on a test server, I set the default stats target up to 100, reran analyze and got the same plan.

Same if I up it to 1000. :-(

--
Jeff Frost, Owner 	<jeff@xxxxxxxxxxxxxxxxxxxxxx>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux