Re: What is Cost 100 in stored procedure

From: Rob Wultsch <wultsch(at)gmail(dot)com>
To: Yan Cheng Cheok <yccheok(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is Cost 100 in stored procedure
Date: 2010-01-13 04:22:05
Message-ID: 2c5ef4e31001122022q52cbc7c9t5739c4a1bbe539a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 12, 2010 at 8:06 PM, Yan Cheng Cheok <yccheok(at)yahoo(dot)com> wrote:
> May I know what is the meaning of Cost 100, at the end of stored procedure?
>
> ....
> END;$BODY$
>  LANGUAGE 'plpgsql' VOLATILE
>  COST 100;
> ALTER FUNCTION create_tables() OWNER TO postgres;
>
> Thanks and Regards
> Yan Cheng CHEOK
>

"execution_cost

A positive number giving the estimated execution cost for the
function, in units of cpu_operator_cost. If the function returns a
set, this is the cost per returned row. If the cost is not specified,
1 unit is assumed for C-language and internal functions, and 100 units
for functions in all other languages. Larger values cause the planner
to try to avoid evaluating the function more often than necessary. "

http://www.postgresql.org/docs/8.4/interactive/sql-createfunction.html

--
Rob Wultsch
wultsch(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2010-01-13 05:27:20 Re: Change Hard Disc Drive
Previous Message Yan Cheng Cheok 2010-01-13 03:06:52 What is Cost 100 in stored procedure