There are about 10 add-tables and 5 par-tables in the query. Its execution time is 8 seconds.
I just printed out this query and executed it in phpPgAdmin. Its execution time is 0.4 seconds.
Why does this query take 20 times longer to complete in Tryton-environment?
I excluded par-tables from the query and left only add-tables. Execution time is 0.6 seconds.
I excluded add-tables from the query and left only par-tables. Execution time is 0.2 seconds.
What can I do to speed up my full query? The full query contains 160 params.
You should apply the patch of the Merge Request (you can get it by clicking on the “Code” button in the top right of the screen and selecting “patch”) to your python-sql module, or wait for a new release and update using your preferred method.