pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Rob Sargent <robjsargent@gmail.com>
To: PostgreSQL <pgsql-sql@postgresql.org>
Subject: Re: 'cost' and 'rows' for volitile function
Date: Mon, 08 Jun 2009 18:34:03 +0100
Message-ID: <4A2D4B8B.1080501@archonet.com> (raw)
In-Reply-To: <4A2D476B.5030404@gmail.com>
References: <4A2D3B9D.1040909@gmail.com>
	<4A2D44EB.7030108@archonet.com>
	<4A2D476B.5030404@gmail.com>

Rob Sargent wrote:
> Richard Huxton wrote:
>> Rob Sargent wrote:
>>> pg-admin is showing 'COST 100' and 'ROWS 1000' for my explicitly 
>>> VOLATILE functions. 

> Thanks for the pointer back to CREATE FUNCTION docs.  That would have 
> told me that those value are indeed the defaults.  I guess I'm somewhat 
> surprised that they are in fact defautled.  "COST" is too arbitrary for 
> me to comment on, but my functions' results sets fall on both sides of 
> 1000 rows, so I'm not sure giving this value to the planner does a lot 
> of good.  Luckily, my functions are typically pretty much stand-alone 
> calls, and not part of some larger query.

If your functions are all called at the top-level then indeed it doesn't 
matter. At a low level though, telling the planner function F1 costs 
1000 times more than F2 is useful.

-- 
   Richard Huxton
   Archonet Ltd



view thread (4+ messages)  latest in thread

Message-ID: <4A2D4B8B.1080501@archonet.com>
Permalink:  ../4A2D4B8B.1080501@archonet.com/
Also on:    postgresql.org/message-id/4A2D4B8B.1080501@archonet.com

 · 

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-sql@postgresql.org
  Cc: dev@archonet.com, robjsargent@gmail.com
  Subject: Re: 'cost' and 'rows' for volitile function
  In-Reply-To: <4A2D4B8B.1080501@archonet.com>

* 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