Alexandre Fayolle - camptocamp has proposed merging lp:~camptocamp/ocb-addons/ocb-7.0-fix_1311004_account_move_line_index-afe into lp:ocb-addons.
Requested reviews: Guewen Baconnier @ Camptocamp (gbaconnier-c2c): code review Related bugs: Bug #1311004 in OpenERP Community Backports (Addons): "missing database index on account_move_line(date, id)" https://bugs.launchpad.net/ocb-addons/+bug/1311004 For more details, see: https://code.launchpad.net/~camptocamp/ocb-addons/ocb-7.0-fix_1311004_account_move_line_index-afe/+merge/216686 improve reading account_move_lines by using an index on date, id matching _order port of https://code.launchpad.net/~camptocamp/openobject-addons/7.0-fix_1311004_account_move_line_index-afe/+merge/216685 to OCB -- https://code.launchpad.net/~camptocamp/ocb-addons/ocb-7.0-fix_1311004_account_move_line_index-afe/+merge/216686 Your team OpenERP Community Backports Team is subscribed to branch lp:ocb-addons.
=== modified file 'account/account_move_line.py' --- account/account_move_line.py 2014-03-10 08:54:20 +0000 +++ account/account_move_line.py 2014-04-22 10:01:42 +0000 @@ -566,6 +566,9 @@ cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'') if not cr.fetchone(): cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)') + cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',)) + if not cr.fetchone(): + cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)') return res def _check_no_view(self, cr, uid, ids, context=None):
-- Mailing list: https://launchpad.net/~openerp-community-reviewer Post to : openerp-community-reviewer@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-community-reviewer More help : https://help.launchpad.net/ListHelp