multiple sql update w/ major time issues

Поиск
Список
Период
Сортировка
От iu_23@hotmail.com (Dawn)
Тема multiple sql update w/ major time issues
Дата
Msg-id aaac9c0b.0106060723.57cfa53a@posting.google.com
обсуждение исходный текст
Ответы Re: multiple sql update w/ major time issues
Список pgsql-sql
I have a sql update statement that is dealing with hundreds of
thousands of records.  It takes hours and hours to complete (if it
does complete and not take down the server).  Here is how I have it
right now:

update aud_member_ext_attributes b
set EXTVALUE217 = (select a.MTDfrom gl_totals awhere a.category = 'tankrent' and a.CUST_NO = b.EXTVALUE101 and
a.DIST_NO= b.EXTVALUE102 and a.SUB_NO = b.EXTVALUE105 and a.FUEL_TYPE = b.EXTVALUE123);
 

update aud_member_ext_attributes b
set EXTVALUE223 = (select a.YTDfrom gl_totals awhere a.category = 'tankrent' and a.CUST_NO = b.EXTVALUE101 and
a.DIST_NO= b.EXTVALUE102 and a.SUB_NO = b.EXTVALUE105 and a.FUEL_TYPE = b.EXTVALUE123);
 
update aud_member_ext_attributes b
set EXTVALUE229 = (select a.R12from gl_totals awhere a.category = 'tankrent' and a.CUST_NO = b.EXTVALUE101 and
a.DIST_NO= b.EXTVALUE102 and a.SUB_NO = b.EXTVALUE105 and a.FUEL_TYPE = b.EXTVALUE123);    
 

There are 3 "extvaluexxx" that are set for each "category" for a total
of 9 categories.  This makes a grand total of 27 update statements. 
Any suggestions?  It would be much appreciated!!!!!


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Jeff Boes"
Дата:
Сообщение: Re: rpt
Следующее
От: alla@sergey.com (Alla)
Дата:
Сообщение: Please help! Functions passing records between them