Merge lp:~camptocamp/openobject-addons/6.1-fix_1311004_account_move_line_index-afe into lp:openobject-addons/6.1

Proposed by Alexandre Fayolle - camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/openobject-addons/6.1-fix_1311004_account_move_line_index-afe
Merge into: lp:openobject-addons/6.1
Diff against target: 13 lines (+3/-0)
1 file modified
account/ (+3/-0)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/6.1-fix_1311004_account_move_line_index-afe
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp (community) code review, no test Approve
Guewen Baconnier @ Camptocamp (community) code review Approve
OpenERP Core Team Pending
Review via email:

Description of the change

improve reading account_move_lines by using an index on date, id matching _order

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :


review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) :
review: Approve (code review, no test)

Unmerged revisions

7316. By Alexandre Fayolle - camptocamp on 2014-04-22

[IMP] add an index on account_move_line(date, id)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/'
2--- account/ 2014-01-10 15:40:23 +0000
3+++ account/ 2014-04-22 10:02:25 +0000
4@@ -567,6 +567,9 @@
5 cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
6 if not cr.fetchone():
7 cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
8+ cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = %s', ('account_move_line_date_id_index',))
9+ if not cr.fetchone():
10+ cr.execute('CREATE INDEX account_move_line_date_id_index ON account_move_line (date DESC, id desc)')
12 def _check_no_view(self, cr, uid, ids, context=None):
13 lines = self.browse(cr, uid, ids, context=context)