Thank you for reply. It's a charity project. The city goverment here decided to help old people who aged 70 above financially every month. There are aid standards here: age range : 70-79 80-89 90-94 95-99 100+ aid money: 30 80 150 300 500 You know, every month some people's ages will changed to the next age range. So I need to calculate monthly every person's age to decide how much money (s)he will get. The fields of the people table: name, gender, birth_date, township_id, community_id.... When the calculating work is done, I need to generate an Excel file by xlwt, a town a worksheet, the rows will be grouped by every community. The aged 70+ people here is 50,000+. Any solutions more efficient than python's "For Loop" on a huge DAL records set?
Thanks 2009/8/7 mdipierro <mdipie...@cs.depaul.edu> > > You can do > > db.executesql('....') > > and pass any sql you want. If you show us what you need to do > specifically perhaps we can suggest a better way. > > Massimo > > On Aug 6, 1:13 pm, 陶艺夫 <artman...@gmail.com> wrote: > > Hi, > > I'm using PostgreSQL, I need to use stored procedure to calculate on more > > than 50000 records -- according to every people's birthday, figure out > how > > much subsidy (s)he will get. Is this a rational idea? > > I have done calculating by a controller, but it has taken more than 50 > > seconds to get the result. Is a stored procedure helpful for this? And > how > > to do it in DAL? > > > > Thanks. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---