plpgsql functions and the planner - Mailing list pgsql-general

From Matthew Dennis
Subject plpgsql functions and the planner
Date
Msg-id e94d85500804262306k877a3b7gc22f05734a05fdeb@mail.gmail.com
Whole thread Raw
Responses Re: plpgsql functions and the planner
Re: plpgsql functions and the planner
List pgsql-general
Do SQL statements inside of plpgsql functions get planned upon every execution, only when the function is first executed/defined, or something else entirely? 

For example, suppose I have a table foo and a function bar.  Function bar executes some SQL statements (select/insert/update) against table foo using various indexed columns.  When the function is created and first executed, table foo is near empty so the statements in function bar use seqscans.  Then table foo is filled with many rows.  Now, when bar is executed again, will PG (8.3.1) know that a seqscan is no longer reasonable?

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: taking actions on rollback (PHP)
Next
From: Ivan Sergio Borgonovo
Date:
Subject: Re: taking actions on rollback (PHP)