Re: An unwanted seqscan

From: Brian Herlihy <btherl(at)yahoo(dot)com(dot)au>
To: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: An unwanted seqscan
Date: 2007-02-15 01:30:46
Message-ID: 20070215013046.64730.qmail@web52310.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Tom,

Sorry, I didn't ask the right question. I meant to ask "Why does it estimate a smaller cost for the seqscan?"

With some further staring I was able to find the bad estimate and fix it by increasing the relevant statistics target.

Thanks,
Brian

----- Original Message ----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian Herlihy <btherl(at)yahoo(dot)com(dot)au>
Cc: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Sent: Wednesday, 14 February, 2007 4:53:54 PM
Subject: Re: [PERFORM] An unwanted seqscan

Brian Herlihy <btherl(at)yahoo(dot)com(dot)au> writes:
> I am having trouble understanding why a seqscan is chosen for this query.

As far as anyone can see from this output, the planner's decisions are
correct: it prefers the plans with the smaller estimated cost. If you
want us to take an interest, provide some more context --- EXPLAIN
ANALYZE output for starters.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Browse pgsql-performance by date

  From Date Subject
Next Message Konstantinos Krikellas 2007-02-15 12:58:33 Problem with joining queries.
Previous Message Josh Berkus 2007-02-14 23:42:55 Re: Benchmarking PGSQL?