Skip to content
Snippets Groups Projects
  1. Aug 27, 2023
  2. Aug 20, 2023
  3. Aug 13, 2023
  4. Aug 06, 2023
  5. Jul 30, 2023
  6. Jul 23, 2023
  7. Jul 16, 2023
  8. Jul 02, 2023
  9. Jun 18, 2023
  10. Jun 11, 2023
  11. Jun 04, 2023
  12. May 08, 2023
  13. May 07, 2023
  14. Apr 30, 2023
  15. Apr 23, 2023
  16. Apr 09, 2023
  17. Mar 26, 2023
  18. Mar 19, 2023
  19. Feb 26, 2023
  20. Feb 13, 2023
  21. Jan 08, 2023
  22. Jan 01, 2023
  23. Dec 25, 2022
  24. Dec 14, 2022
  25. Dec 04, 2022
  26. Sep 25, 2022
  27. Sep 11, 2022
  28. Apr 24, 2022
  29. Apr 17, 2022
  30. Apr 03, 2022
  31. Dec 26, 2021
  32. Dec 19, 2021
  33. Dec 06, 2021
    • Alvaro Fuentes's avatar
      [FIX] hr_work_entry: improve query and add indices · 7b2889fe
      Alvaro Fuentes authored
      The query below
      https://github.com/odoo/odoo/blob/81497125d8100c6bdd2dc30434232a88a419a3e3/addons/hr_work_entry/models/hr_work_entry.py#L92-L115
      
      
      has bad performance without the bespoken indices on `date_start` and
      `date_stop`. We can speed it up more with an index on `employee_id`.
      
      This is not enough for DBs with many work entries (500K+), specially
      during upgrades.
      
      Here we optimize the query to take into account only the work entries
      being modified.
      
      This issue was observed during an upgrade saas~12.3->13.0 where the
      payslip recomputation never ends due to the increased amount of hr work
      entries created. Note how the first 1K payslips are processed in 1 hour
      (~16 payslips per minute), while the latest 3 (before the upgrade
      was killed) took 1 min.
      ```
      2021-11-02 21:05:44,403 2229 INFO db_42897 odoo.modules.migration: module hr_payroll: Running migration [$saas~12.4.1.0] end-compute-amount
      2021-11-02 21:06:44,577 2229 INFO db_42897 odoo.upgrade: [1.61%] 1120/69635 payslip processed in 0:01:00.036716 (total estimated time: 1:02:12.729213)
      2021-11-02 21:07:44,602 2229 INFO db_42897 odoo.upgrade: [2.66%] 1853/69635 payslip processed in 0:02:00.062972 (total estimated time: 1:15:11.918540)
      ...
      2021-11-05 09:59:46,565 2229 INFO db_42897 odoo.upgrade: [47.95%] 33390/69635 payslip processed in 2 days, 12:54:02.025479 (total estimated time: 5 days, 7:00:30.261882)
      2021-11-05 10:01:04,990 2229 INFO db_42897 odoo.upgrade: [47.95%] 33393/69635 payslip processed in 2 days, 12:55:20.450549 (total estimated time: 5 days, 7:02:32.725840)
      ```
      
      opw-2672031
      
      closes odoo/odoo#80857
      
      X-original-commit: 95d3145a
      Signed-off-by: default avatarNicolas Seinlet (nse) <nse@odoo.com>
      7b2889fe
  34. Dec 05, 2021
  35. Nov 14, 2021
  36. Oct 03, 2021
  37. Sep 26, 2021
  38. Sep 05, 2021
  39. Aug 29, 2021
  40. Aug 08, 2021
Loading