-
- Downloads
[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#44660
Signed-off-by:
Olivier Dony (odo) <odo@openerp.com>
Please register or sign in to comment