← Back to team overview

openerp-expert-framework team mailing list archive

Database indexes for foreign keys

 

Hello,

I came across this while analyzing pg logs with pgbadger : postgreSQL
does not automatically create indexes for foreign key columns, and I was
surprised when I noticed that the ORM in OpenERP does not do this by
default. Has anyone been doing some analysis on this and concluded that
manual creation of such indexes was the correct thing to do because the
read-time gains were nullified by the write-time costs ?

My gut feeling is that in most cases we want such index to be created,
and that select should default to True for m2o fields (and then we could
always explicitely disable index creation for the few fields for which
this would cause harm).

-- 
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 79 26 57 94

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com
F



Follow ups