Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#23853 closed Cleanup/optimization (fixed)

Replace JoinInfo namedtuple with Join class

Reported by: Anssi Kääriäinen Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The rationale for this change is that by using a class we can implement all kinds of different joins (LATER JOINS over subquery) if needed for special cases. In addition, this way feels cleaner to me as the join generation logic now happens in a dedicated class instead of "hard-coding" it to SQLCompiler.

Implementation in https://github.com/django/django/pull/3561

Change History (5)

comment:1 by Tim Graham, 10 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:2 by Anssi Kääriäinen, 10 years ago

Triage Stage: AcceptedReady for checkin

This should be ready for commit, see PR for review details.

comment:3 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: newclosed

In ab89414f40db1598364a7fe4cfac1766cacd2668:

Fixed #23853 -- Added Join class to replace JoinInfo

Also removed Query.join_map. This structure was used to speed up join
reuse calculation. Initial benchmarking shows that this isn't actually
needed. If there are use cases where the removal has real-world
performance implications, it should be relatively straightforward to
reintroduce it as map {alias: [Join-like objects]}.

comment:4 by GitHub <noreply@…>, 7 years ago

In 7acbe89:

Refs #23853 -- Updated sql.query.Query.join() docstring.

Follow up to ab89414f40db1598364a7fe4cfac1766cacd2668.

comment:5 by Tim Graham <timograham@…>, 7 years ago

In 31d7fc85:

[1.11.x] Refs #23853 -- Updated sql.query.Query.join() docstring.

Follow up to ab89414f40db1598364a7fe4cfac1766cacd2668.

Backport of 7acbe89cc2a72f1b85d415c1cdb622c0dbbbe37c from master

Note: See TracTickets for help on using tickets.
Back to Top