Re: [SQL] Partition tables to improve select speed?

2013-01-31 Thread Jonathan S. Katz
On Jan 31, 2013, at 4:43 AM, Bert wrote: > Hello, > > We are using postgres as a datawarehouse. > We typically use very complex queries, and they seem to work very well. > > We have several BIG tables. we chose to partition those tables on a specific > key. > > We also adapted our selects,

Re: [SQL] How to put multiples results in just one column

2013-01-31 Thread Pavel Stehule
2013/1/31 Nei Rauni Santos : > Thank you Pavel, > > I could do that like this: > > > select p.id, > > ( select array_accum (( > room_name, room_id, room_group_name, room_group_id, room_order, > availability_min, price_amount, price_min, price_avg, price_balcony_amount, > price_balcony_avg, capacity

Re: [SQL] How to put multiples results in just one column

2013-01-31 Thread Nei Rauni Santos
Thank you Pavel, I could do that like this: select p.id, ( select array_accum (( room_name, room_id, room_group_name, room_group_id, room_order, availability_min, price_amount, price_min, price_avg, price_balcony_amount, price_balcony_avg, capacity, deposit_required, breakfast_included, room_mi

Re: [SQL] How to put multiples results in just one column

2013-01-31 Thread Pavel Stehule
Hello select (fce(..)).column from ... or select column from fce() Regards Pavel Stehule 2013/1/31 Nei Rauni Santos : > Hi, > > The problem is, I'm working in a list of hotels which should have > availability of rooms and list the hotel and its rooms on the application. > > I have this functio

[SQL] How to put multiples results in just one column

2013-01-31 Thread Nei Rauni Santos
Hi, The problem is, I'm working in a list of hotels which should have availability of rooms and list the hotel and its rooms on the application. I have this function which already is used to get the rooms available select cms.sp_get_supplier_availability(2, '2013-02-01', '2013-02-02', 'pt_BR', 1

[SQL] Partition tables to improve select speed?

2013-01-31 Thread Bert
Hello, We are using postgres as a datawarehouse. We typically use very complex queries, and they seem to work very well. We have several BIG tables. we chose to partition those tables on a specific key. We also adapted our selects, and added a 'where' clause which helps postgres's query planner,