Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Albe Laurenz
Ivan Sergio Borgonovo wrote: [wants to cache query results in a temporary table for use in several functions] > yes... but it is not just a matter of caching the data but rather > being able to exploit them with SQL. Oh, I see, you want to select/join with the cached data. Then neither arrays no

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Apr 2008 14:00:39 +0200 "Albe Laurenz" <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo wrote: > > It doesn't look as I can do the same stuff with array and > > tables/records. > > Many times I use joint or aggregates on the basket. > Sorry, my example was unclear. I was the first

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Albe Laurenz
Ivan Sergio Borgonovo wrote: > > > I've a bunch of functions that operates on the basket (a smaller > > > list of products with their attributes). > > > > > > So many functions ends up in repeating over and over a select > > > similar to: > > > > > > select [list of columns] from baskets b > > >

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
On Tue, 1 Apr 2008 12:01:21 +0200 "Albe Laurenz" <[EMAIL PROTECTED]> wrote: > Ivan Sergio Borgonovo wrote: > > I've a bunch of functions that operates on the basket (a smaller > > list of products with their attributes). > > > > So many functions ends up in repeating over and over a select > > si

Re: [GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Albe Laurenz
Ivan Sergio Borgonovo wrote: > I've a bunch of functions that operates on the basket (a smaller list > of products with their attributes). > > So many functions ends up in repeating over and over a select similar > to: > > select [list of columns] from baskets b > join basket_items bi on b.basket

[GENERAL] HOWTO caching data across function calls: temporary tables, cursor?

2008-04-01 Thread Ivan Sergio Borgonovo
I made a similar question but maybe it was not that clear. I've a large table (items) linked with other tables (attributes). Some product ends into a basket. create table items( item_id serial primary key, attributes... ); create table item_attributes( item_id int references items (item_i