Issue 11486

Title
Use implicit join for where clause on Many2One
Priority
feature
Status
resolved
Nosy list
ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2022-05-13.19:44:02 by ced, last changed 4 months ago by roundup-bot.

Messages

New changeset ae2872b0935f by Cédric Krier in branch 'default':
Use alias expression in where clause of implicit join
https://hg.tryton.org/tryton-env/rev/ae2872b0935f
New changeset 65c68ff9d858 by Cédric Krier in branch 'default':
Use alias expression in where clause of implicit join
https://hg.tryton.org/trytond/rev/65c68ff9d858
New changeset be3e3d89a177 by Cédric Krier in branch 'default':
Add implicit join clause to subquery of where clause on Many2One
https://hg.tryton.org/tryton-env/rev/be3e3d89a177
New changeset b63c91efe03a by Cédric Krier in branch 'default':
Add implicit join clause to subquery of where clause on Many2One
https://hg.tryton.org/trytond/rev/b63c91efe03a
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-05-13.19:44:01

The subquery in the form of column IN (SELECT id FROM ...) can be very slow because they are often SubPlan. This means that they are evaluated for each row. So this has a complexity of O(n^2).
But as we do that only on id which is the primary key we could limit the subquery to fetch only one id per row using a clause like: column IN (SELECT id FROM ... WHERE ... AND id = column). The complexity thanks to the index becomes O(n log(n)).

History
Date User Action Args
2022-07-18 10:02:28roundup-botsetmessages: + msg77413
2022-07-18 10:02:25roundup-botsetmessages: + msg77412
2022-07-18 00:19:12roundup-botsetmessages: + msg77407
2022-07-18 00:19:08roundup-botsetmessages: + msg77406
nosy: + roundup-bot
status: testing -> resolved
2022-06-15 22:27:49reviewbotsetmessages: + msg77107
2022-05-13 19:53:48reviewbotsetmessages: + msg76634
nosy: + reviewbot
2022-05-13 19:46:05cedsetkeyword: + review
reviews: 415121003
status: in-progress -> testing
2022-05-13 19:44:02cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)