diff options
| author | xmo-odoo <xmo@odoo.com> | 2018-04-05 10:34:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-05 10:34:48 +0200 |
| commit | b5c660d8c059e7b93c64b9dd9bc96eeb6ee5cadf (patch) | |
| tree | 8184e8e05b6a70d65fb9002834f96a5bf1f5f4d2 /odoo/http.py | |
| parent | 0cdfae0e258f0a00687372c211e4ed541709bdec (diff) | |
[IMP] base: batch XID generation during export
* add UUIDs to XID sections (4 bytes / 8 hex digits) so it's not
necessary to handle collisions & add a fallback generator
* use COPY for performances over executemany: executemany just
performs an implicit loop on all statements (in psycopg2)
* ~pure SQL was possible:
INSERT INTO ir_model_data (module, model, name, res_id)
SELECT
'__export__',
'{model}',
'{table}_' || A.id || '_' || uuid_generate_v4(),
A.id
FROM {table} A
LEFT JOIN ir_model_data B
ON A.id = B.res_id AND B.model = %s
WHERE B.res_id IS NULL;
but would have required installing pg extensions (problematic
especially in stable) and performances are about the same as
the COPY version
task 36343
Fixes #22493
Diffstat (limited to 'odoo/http.py')
0 files changed, 0 insertions, 0 deletions
