← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 771941] Re: project_task_work needs some more indices

 

On Thursday 28 April 2011, you wrote:
> well if you have some 1000 or 10000 lines in
> class project_work(osv.osv):
> postgress will have to make full table scans if no index on task/user etc
> exists.
> 
> example
> task list has to calculate progress
> def _hours_get ...

Just a humble note:
 if we find ourselves having more than 3-4 column indices for a table, we might 
better consider a combined index. They are much more efficient.

At some point, I'd also like to add framework support for table indices, sth 
like:
 _indices = [ ( <name>, <column expr>, <...> ), ...]

.. so that we don't need to override orm._auto_init() any more.

-- 
Say NO to spam and viruses. Stop using Microsoft Windows!

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/771941

Title:
  project_task_work needs some more indices

Status in OpenERP Modules (addons):
  Confirmed

Bug description:
  things are a bit slow without indices , it's likely to be a big table

  class project_work(osv.osv):
      
       _columns = {
          'date': fields.datetime('Date', select="1"),
          'task_id': fields.many2one('project.task', 'Task', ondelete='cascade', required=True, select="1"),
          'user_id': fields.many2one('res.users', 'Done by', required=True, select="1"),


References