pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Giorgio Valoti <giorgio_v@mac.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query Plan choice with timestamps
Date: Thu, 07 Aug 2008 17:01:47 -0400
Message-ID: <27578.1218142907@sss.pgh.pa.us> (raw)
In-Reply-To: <A7C0E4E0-460D-49AB-912B-050E8049B16D@mac.com>
References: <321506D5-4400-470C-909E-C7700D49A540@mac.com>
	<12707.1218124259@sss.pgh.pa.us>
	<A7C0E4E0-460D-49AB-912B-050E8049B16D@mac.com>

Giorgio Valoti <giorgio_v@mac.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



view thread (10+ messages)  latest in thread

Message-ID: <27578.1218142907@sss.pgh.pa.us>
Permalink:  ../27578.1218142907@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27578.1218142907@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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, giorgio_v@mac.com
  Subject: Re: Query Plan choice with timestamps
  In-Reply-To: <27578.1218142907@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