summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_model.js
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2020-02-05 14:18:49 +0000
committerOlivier Dony <odo@odoo.com>2020-02-06 17:26:45 +0000
commitd8cde5969f07fb2f12c46fd9844ea0519da0dcff (patch)
treedcfc88a2bf79fea4f0b47c9041a2cbcfcd5497ed /addons/web/static/src/js/views/basic/basic_model.js
parenta4d46ec55c09b0d54260dacfe756bbb78b40b44e (diff)
[FIX] pos_restaurant: improve performance retrieving table orders
Since synchronization of tables was added in POS restaurant, requests are frequently made to the server to display the number of open orders on each table. The implementation of the counting caused O(num_tables) queries, and those queries were slow on large databases because there was no index for the `table_id` column. This patch fixes both problems, and the counting now uses 3 fast queries regardless of the number of tables. On a sample database with 2k tables and 50k POS orders, calls to `get_tables_order_count` went down from 1 s and 100+ SQL queries to 10 ms and 4 queries. About 2 orders of magnitude faster, with server load drastically reduced as well. closes odoo/odoo#44782 X-original-commit: 6c21ea369dc247b3ab31b767315c48ffc8d40a3d Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions