Re: BUG #4462: Adding COUNT to query causes massive slowdown

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Jussi Pakkanen <jpakkane(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4462: Adding COUNT to query causes massive slowdown
Date: 2008-10-09 12:05:10
Message-ID: 48EDF376.80801@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jussi Pakkanen wrote:
> However when I try to count the amount of distinct codes, I get this:
>
>
> EXPLAIN SELECT COUNT(DISTINCT code) FROM log;
> QUERY PLAN
> ----------------------------------------------------------------------------
> -----
> Aggregate (cost=100801488.30..100801488.31 rows=1 width=10)
> -> Seq Scan on log (cost=100000000.00..100721245.24 rows=32097224
> width=10)
> (2 rows)

This looks like you have one of the enable_${plantype} parameters turned
off. 100000000 is the penalty that is added when a plantype if turned off.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2008-10-09 12:06:35 Re: BUG #4461: Should avoid create tblspcs in system location
Previous Message Peter Eisentraut 2008-10-09 12:01:37 Re: Locale (unsupported) bug. uk_UA.KOI8-U