Re: trouble with (lack of) indexing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: Søren Boll Overgaard <postgres(at)fork(dot)dk>, pgsql-general(at)postgresql(dot)org
Subject: Re: trouble with (lack of) indexing
Date: 2002-05-10 00:25:15
Message-ID: 24619.1020990315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Nigel J. Andrews" <nandrews(at)investsystems(dot)co(dot)uk> writes:
> Or am I just barking up a dead horse here since I'm now thinking it
> might be nice to include information about potential indexes and at
> what row count from them it's decided a seqscan is better.

There is no "row count at which it's decided a seqscan is better".
The planner does cost estimates and picks the plan with the lowest
estimated cost, so all the behavior is emergent from the cost
estimation equations.

I have not been able to think of any output format that would show
rejected plan estimates without being so verbose as to be unreadable
--- except in the most trivial cases, there are a *lot* of rejected
plans, and the planner has no idea which of them might be interesting
to a human. (You can try defining OPTIMIZER_DEBUG if you want to see
it in action, but I don't think the output is very useful in practice.)
What's worse is that (a) the only reason why you'd care is if the
estimates are wrong, but (b) there is no way to tell anything about the
actual cost that might be associated with a rejected plan fragment.
To compare estimates to reality you really have to arrange for the plan
to be the selected one, so that you can run it.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-05-10 00:42:37 Re: trouble with (lack of) indexing
Previous Message McCaffity, Ray (Contractor) 2002-05-10 00:21:37 newbie - syntax question