pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Thomas <paul@tmsl.demon.co.uk>
Cc: Fabian Kreitner <fabian.kreitner@ainea-ag.de>
Cc: pgsql-performance @ postgresql . org <pgsql-performance@postgresql.org>
Subject: Re: index / sequential scan problem
Date: Thu, 17 Jul 2003 14:03:00 -0400
Message-ID: <5494.1058464980@sss.pgh.pa.us> (raw)
In-Reply-To: <20030717153825.C27991@bacon>
References: <5.1.0.14.0.20030717131157.03957fa0@195.145.148.245>
	<5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245>
	<5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245>
	<20030717111248.C27264@bacon>
	<5.1.0.14.0.20030717131157.03957fa0@195.145.148.245>
	<20030717133445.A27991@bacon>
	<5.1.0.14.0.20030717144625.039c4a10@195.145.148.245>
	<20030717153825.C27991@bacon>

Paul Thomas <paul@tmsl.demon.co.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



view thread (19+ messages)  latest in thread

Message-ID: <5494.1058464980@sss.pgh.pa.us>
Permalink:  ../5494.1058464980@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5494.1058464980@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, paul@tmsl.demon.co.uk, fabian.kreitner@ainea-ag.de
  Subject: Re: index / sequential scan problem
  In-Reply-To: <5494.1058464980@sss.pgh.pa.us>
  References: <5.1.0.14.0.20030717131157.03957fa0@195.145.148.245> <5.1.0.14.0.20030717105203.03d2b5c0@195.145.148.245> <20030717111248.C27264@bacon> <20030717133445.A27991@bacon> <5.1.0.14.0.20030717144625.039c4a10@195.145.148.245> <20030717153825.C27991@bacon> <5494.1058464980@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox