Skip site navigation (1) Skip section navigation (2)

Re: index scan cost

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: index scan cost
Date: 2008-07-18 04:37:31
Message-ID: 9919.1216355851@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Jeff Frost <jeff(at)frostconsultingllc(dot)com> writes:
> I have two postgresql servers.  One runs 8.3.1, the other 8.3.3.  On the 8.3.1 
> machine, the index scans are being planned extremely low cost:

>   Index Scan using ix_email_entity_thread on email_entity  (cost=0.00..4.59 
> rows=1 width=1031) (actual time=0.095..0.120 rows=4 loops=1)
>     Index Cond: (email_thread = 375629157)

>   Index Scan using ix_email_entity_thread on email_entity  (cost=0.00..2218.61 
> rows=1151 width=931) (actual time=0.094..0.111 rows=4 loops=1)
>     Index Cond: (email_thread = 375629157)

This isn't a "cost" problem, this is a "stats" problem.  Why does the
second server think 1151 rows will be returned?  Try comparing the
pg_stats entries for the email_thread column on both servers ... seems
like they must be significantly different.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: System/IJS - JokoDate: 2008-07-18 05:48:10
Subject: Re: log_statement at postgres.conf
Previous:From: Jeff FrostDate: 2008-07-17 23:12:44
Subject: Re: index scan cost

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group