Hi, what PostgreSQL version is this? That's the first thing we need to know. On 29.11.2011 22:28, Tyler Hains wrote: > Yes, I'm pretty sure autovacuum is enabled. Changing the query as shown > there uses the sub-optimal index. That doesn't mean > I haven't had a chance to experiment with the SET STATISTICS, but that > got me going on something interesting... If you execute this SELECT count(*) FROM cards WHERE card_set_id=2850; what number do you get? How far is that from 27616, expected by the planner? > Do these statistics look right? No idea, that depends on your data set. And you've missed the most_common_freqs so it's almost impossible to analyze the stats. Tomas -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general