#36290 closed Bug (fixed)
Unnecessary query performed when prefetching nullable foreign key relationships
Description (last modified by ) ¶
As reported by Baptiste on Discord
Because the tuple_lookups.TupleIn.process_rhs
logic doesn't replicate the None
eliding logic on lookups.In.process_rhs
logic the usage of TupleIn
introduced in 626d77e52a3f247358514bcf51c761283968099c to resolve #36116 resulted in the unnecessary execution of queries of the form
SELECT "releases_release"."version" FROM "releases_release" WHERE ("releases_release"."version") IN ((NULL))
which are never going to match because NULL != NULL
in SQL.
This has to relation to #31667 which introduced this optimization for the same prefetch related optimization purposes.
Change History (5)
comment:1 by , 3 days ago
Description: | modified (diff) |
---|---|
Has patch: | set |
comment:2 by , 3 days ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 2 days ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:4 by , 2 days ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
In f7f38f3: