Skip to content
Snippets Groups Projects
Commit 13ff10d8 authored by Nicolas Seinlet's avatar Nicolas Seinlet
Browse files

[IMP] mail: better join improve query execution time


- using join on required fields ease PostgreSQL planner guessing
- skip useless join, the fastest code is the not executed one
- skip dynamic `or` insertion and replace with a union all in CTE
- replacing `where exists` with a join is then possible
- a bit of alignment

from some s to some ms execution time.

Submit an "Apply for a job" on website , goes from
`"POST /website_form/hr.applicant HTTP/1.0" 200 - 182 2.649 0.106`
without this patch, to
`"POST /website_form/hr.applicant HTTP/1.0" 200 - 185 0.492 0.107`
when this patch is applied

closes odoo/odoo#71028

X-original-commit: 783280375ff04955978a14f007f96d6c4d7443b1
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 7287ce53
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment