[FIX] read_group: remove prohibitive n^2 operations, could freeze the server on large group_by results
[FIX] read_group: remove prohibitive n^2 operations, could freeze the server on large group_by results

This patch replaces two O(n^2) operations, one 
filter and one sort, with O(n) or better operations.
It takes slightly more memory due to the use of
one extra data copy, but takes virtually no time
to process even with 600k result lines, whereas
the previous code would just freeze the server
for a long time.
vnc-biz/openerp-server,splbio/openobject-server,splbio/openobject-server,MarkusTeufelberger/openobject-server,splbio/openobject-server,MarkusTeufelberger/openobject-server,gisce/openobject-server,gisce/openobject-server,gisce/openobject-server,ovnicraft/openerp-server,vnc-biz/openerp-server,ovnicraft/openerp-server,MarkusTeufelberger/openobject-server