Re: index / sequential scan problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
Cc: Fabian Kreitner <fabian(dot)kreitner(at)ainea-ag(dot)de>, "pgsql-performance (at) postgresql (dot) org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: index / sequential scan problem
Date: 2003-07-17 18:03:00
Message-ID: 5494.1058464980@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk> writes:
> 2) enable_seqscan = false
>> Seq Scan on notiz_objekt a (cost=100000000.00..100111719.36 rows=15561
>> width=12) (actual time=0.25..535.75 rows=31122 loops=1)

> I've just noticed this. Something is not right here. Look at the crazy
> cost estimation for the second query.

No, that's exactly what it's supposed to do. enable_seqscan cannot
simply suppress generation of a seqscan plan (because that might be
the only way to do the query, if there's no applicable index). So it
generates the plan, but sticks a large penalty into the cost estimate
to keep the planner from choosing that alternative if there is any
other. The "100000000.00" is that artificial penalty.

We could probably hide this implementation detail from you if we tried
hard enough, but it hasn't bothered anyone enough to try.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-07-17 18:12:55 Re: index / sequential scan problem
Previous Message Jord Tanner 2003-07-17 16:54:26 Re: Hardware performance