Comment 2 for bug 571610

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

+1 Ferdinand

There is also a missing index on the account code (that would used on every account search).

---------

Just as an example of performance improvements that can be achieved with proper indexes, every time we do an "--update=all" (on one of our development databases) this kind of query is executed about 400 times:

(1) SELECT ir_model_data.id FROM "ir_model_data" WHERE (ir_model_data.module IN (E'')) AND (ir_model_data.model IN (E'',E'',E'')) ORDER BY id;

This other kind of query is performed almost 900 times:

(2) SELECT * FROM ir_model_fields WHERE model=E'' AND state=E'';

It spends about 2 seconds doing the first query and about one second doing the last one.

Adding the next indexes the times go down to 0.2 seconds and 0.3 seconds. That means that on 3 seconds we save 2.5 seconds!:

        CREATE INDEX ir_model_data__module_model_id__index
            ON ir_model_data (module, model, id);
        CREATE INDEX ir_model_fields__model_state__index
           ON ir_model_fields (model, state);