Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 38F144758A5 for ; Mon, 22 Apr 2002 12:56:36 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g3MGueF16792; Mon, 22 Apr 2002 12:56:40 -0400 (EDT) To: nickf@ontko.com Cc: "pgsql-admin" Subject: Re: An Analyze question In-reply-to: References: Comments: In-reply-to "Nick Fankhauser" message dated "Mon, 22 Apr 2002 11:05:20 -0500" Date: Mon, 22 Apr 2002 12:56:40 -0400 Message-ID: <16789.1019494600@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/200 X-Sequence-Number: 4088 "Nick Fankhauser" writes: >> Offhand I would think that 7.2 is smart enough to deal with this > We're on 7.1.3. Hmm... I don't see why it would make any difference in 7.1 either. You weren't by any chance selecting on the most common actor_id were you? Really 7.1 only has two possible selectivity estimates for column = 'constant' --- either the constant is the stored most-common-value, or it ain't. What do you get from select attname,attdispersion,s.* from pg_statistic s, pg_attribute a, pg_class c where starelid = c.oid and attrelid = c.oid and staattnum = attnum and relname = 'actor_case_assignment'; in each database? > Here are the before & after explains again: > Before: > monroe=# explain select * from actor_cases where actor_id = '18105A7313 53'; > After: > develop=# explain select * from actor_cases where actor_id = '18105A7313 53'; Are you really comparing apples to apples here? I'd think that a proper comparison of plans would be monroe=# explain select * from actor_cases where actor_id = 'A7313 53'; develop=# explain select * from actor_cases where actor_id = '18105A7313 53'; regards, tom lane