Re: Query Plan choice with timestamps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Giorgio Valoti <giorgio_v(at)mac(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Plan choice with timestamps
Date: 2008-08-07 21:01:47
Message-ID: 27578.1218142907@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Giorgio Valoti <giorgio_v(at)mac(dot)com> writes:
> On 07/ago/08, at 17:50, Tom Lane wrote:
>> These numbers seem pretty bogus: there is hardly any scenario in
>> which a
>> full-table indexscan should be costed as significantly cheaper than a
>> seqscan. Have you put in silly values for random_page_cost?

> No,

I looked at it more closely and realized that the cost discrepancy is
from the evaluation of the function: having to evaluate a SQL or plpgsql
function 247736 times more than explains the cost estimate differential
compared to a query that involves no function call. Some experiments
here suggest that it hardly matters whether the query uses indexscan or
seqscan because the time is dominated by the function calls anyway.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-08-07 21:12:40 Re: query planner not using the correct index
Previous Message Andrej Ricnik-Bay 2008-08-07 20:59:40 Re: file system and raid performance