[GENERAL] how to avoid repeating expensive computation in select

2011-02-03 Thread Bob Price
I have been searching through the docs and mailing list and haven't found a way to do this, so I thought I would ask the community. I would like to know if there is a way in PostgreSQL to avoid repeating an expensive computation in a SELECT where the result is needed both as a returned value an

[GENERAL] how to avoid repeating expensive computation in select

2011-02-03 Thread Bob Price
I have been searching through the docs and mailing list and haven't found a way to do this, so I thought I would ask the community. I would like to know if there is a way in PostgreSQL to avoid repeating an expensive computation in a SELECT where the result is needed both as a returned value an

Re: [GENERAL] how to avoid repeating expensive computation in select

2011-02-03 Thread Bob Price
ime use function that declared a variable with this 'constantdata...'::X value, and then pass this variable in both calls. Would this work? Thanks again! Bob --- On Thu, 2/3/11, Bill Moran wrote: > From: Bill Moran > Subject: Re: [GENERAL] how to avoid repeating expensive com

Re: [GENERAL] how to avoid repeating expensive computation in select

2011-02-04 Thread Bob Price
avoid repeating expensive computation in select > To: "Bob Price" > Cc: "Bill Moran" , pgsql-general@postgresql.org > Date: Thursday, February 3, 2011, 5:33 PM > Bob Price > writes: > > If I set the COST of expensivefunc high, and label it > IMMUTABLE, will the