Account party does not play well with big volume of data
In my case the model account.account.party
is using a table query using the usual Min(line.id) as id
to set the id of the new data.
But the join is over millions of lines (and few accounts) which results in more than a million lines. On this table query we're then browsing some ids. Unfortunately postgres can not optimize correctly the table query because of the use of the aggregate function. Thus it will result in this big query being run for every read of a batch of ids.
The proposed review fixes it by using a specific domain_id
on the table query model and adding support for it in ModelSQL
.