| Age | Commit message (Collapse) | Author |
|
|
|
FilteredRelation.
|
|
By building the list of placeholders for each inserted fields once it
doesn't have to be looked up for each inserted rows twice.
The query_values_10000.benchmark.QueryValues10000.time_query_values_10000 ASV
benchmark showed a 5% speed up for 10k items on SQLite for a single field
insertion. Larger performance gains are expected when more fields are involved.
|
|
Thanks Lily Foote and Simon Charette for reviews and mentoring
this Google Summer of Code 2024 project.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Lily Foote <code@lilyf.org>
|
|
Just like normal queries, combined queries' outer references might fully
resolve before their reference is assigned its final alias.
Refs #29338.
Thanks Antony_K for the report and example, and thanks Mariusz Felisiak
for the review.
|
|
Aggregation optimization didn't account for not referenced set-returning annotations on Postgres.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
against JSON fields.
Thanks Eyal (eyalgabay) for the report.
|
|
containing "__".
Regression in b0ad41198b3e333f57351e3fce5a1fb47f23f376.
Refs #34013. The initial logic did not consider that annotation aliases
can include lookup or transform separators.
Thanks Gert Van Gool for the report and Mariusz Felisiak for the review.
|
|
|
|
|
|
a query.
|
|
While refs #34125 focused on the SQL correctness of slicing of union of
potentially empty queries it missed an optimization opportunity to avoid
performing a query at all when all queries are empty.
Thanks Lucidiot for the report.
|
|
It was added in 01d440fa1e6b5c62acfa8b3fde43dfa1505f93c6 to
prevent "RuntimeError: OrderedDict mutated during iteration".
That particular issue was fixed in d660cee5bc68b597503c2a16f3d9928d52f93fb4
but the issue could remain in Join.as_sql() subclasses.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
Follow up from f7f5edd50d03e8482f8a6da5fb5202b895d68cd6.
|
|
|
|
This should ensure it never drifts from Query.selected while maintaining
backward compatibility.
|
|
Previously, only the selected column aliases would be propagated and
annotations were ignored.
|
|
Previously the order was always extra_fields + model_fields + annotations with
respective local ordering inferred from the insertion order of *selected.
This commits introduces a new `Query.selected` propery that keeps tracks of the
global select order as specified by on values assignment. This is crucial
feature to allow the combination of queries mixing annotations and table
references.
It also allows the removal of the re-ordering shenanigans perform by
ValuesListIterable in order to re-map the tuples returned from the database
backend to the order specified by values_list() as they'll be in the right
order at query compilation time.
Refs #28553 as the initially reported issue that was only partially fixed
for annotations by d6b6e5d0fd4e6b6d0183b4cf6e4bd4f9afc7bf67.
Thanks Mariusz Felisiak and Sarah Boyce for review.
|
|
This avoids manual .annotations and .append_annotation_mask manipulations.
|
|
By always including related objects in the select mask via adjusting the
defer logic (_get_defer_select_mask()), it becomes possible for
select_related_descend() to treat forward and reverse relationships
indistinctively.
This work also simplifies and adds comments to
select_related_descend() to make it easier to understand.
|
|
While refs #34612 surfaced issues with reverse one-to-one fields
deferrals, it missed that switching to storing remote fields would break
self-referential relationships.
This change switches to storing related objects in the select mask
instead of remote fields to prevent collisions when dealing with
self-referential relationships that might have a different directional
mask.
Despite fixing #21204 introduced a crash under some self-referential
deferral conditions, it was simply not working even before that as it
aggregated the sets of deferred fields by model.
Thanks Joshua van Besouw for the report and Mariusz Felisiak for the
review.
|
|
co-authored-by: Gordon <gordon.wrigley@gmail.com>
co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
co-authored-by: Keryn Knight <keryn@kerynknight.com>
co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
co-authored-by: David Smith <smithdc@gmail.com>
co-authored-by: Paolo Melchiorre <paolo@melchiorre.org>
|
|
operators.
Thanks Alan for the report.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
Regression in 59f475470494ce5b8cbff816b1e5dafcbd10a3a3.
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
early return.
This avoids costly hashing.
Thanks Anthony Shaw for the report.
Co-Authored-By: Simon Charette <charette.s@gmail.com>
|
|
Thanks Mark Zorn for the report.
Regression in 59f475470494ce5b8cbff816b1e5dafcbd10a3a3.
|
|
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.
Thanks Marcin for the report.
|
|
Thanks Eugene Morozov and Ben Nace for the reports.
|
|
GeneratedField.output_field with backend converters.
Regression in d9de74141e8a920940f1b91ed0a3ccb835b55729.
This is a long standing issue, however it caused a crash of
GeneratedFields for all output fields that have backend-specific
converters when the RETURNING clause is not supported
(MySQL and SQLite < 3.35).
That's why severity was exacerbated.
|
|
|
|
While this isn't a regression it's clear that similar logic should be
applied when dealing with lists of expressions passed as a lookup value.
|
|
Adjustments made to solve_lookup_type to defer the resolving of
references for summarized aggregates failed to account for similar
requirements for lookup values which can also reference annotations
through Aggregate.filter.
Regression in b181cae2e3697b2e53b5b67ac67e59f3b05a6f0d.
Refs #25307.
Thanks Sergey Nesterenko for the report.
|
|
3.39.
On SQLite < 3.39, this forces a GROUP BY clause with a HAVING clause
when no grouping is specified.
Co-authored-by: Simon Charette <charette.s@gmail.com>
|
|
expressions containing subqueries.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7,
complements e5c844d6f2a4ac6ae674d741b5f1fa2a688cedf4.
Refs #28477, #34551.
Thanks Haldun Komsuoglu for the report.
|
|
Thanks Adam Johnson and Paolo Melchiorre for reviews.
Co-Authored-By: Lily Foote <code@lilyf.org>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
Thanks zhu for the report and Simon Charette for reviews.
|
|
Thanks Nwawel A Iroume for the report.
|
|
Special characters lose their special meaning inside sets of characters.
"-" lose its special meaning if it's placed as the first or last
character.
Follow up to 7c6b66383da5f9a67142334cd2ed2d769739e8f1.
|
|
annotations.
Thanks Toan Vuong for the report.
Thanks Simon Charette for the review.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.
|
|
|
|
functions.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.
Refs #28477.
Thanks younes-chaoui for the report.
|
|
The outer query reference is not necessary when alias can be reused and
can even be harmful by confusing query planers.
Refs #34597.
|
|
|
|
An n-ary logical XOR Q(…) ^ Q(…) ^ … ^ Q(…) should evaluate to true
when an odd number of its operands evaluate to true, not when exactly
one operand evaluates to true.
|
|
Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.
Thanks Ian Cubitt for the report.
This also corrected test_inheritance_deferred2() test which was
previously properly defined and marked as an expected failure but was
then wrongly adjusted to mask the lack of support for per-alias
deferral that was fixed by #21204.
|
|
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7.
Refs #28477.
Thanks Denis Roldán and Mariusz for the test.
|
|
reference.
Regression in 1297c0d0d76a708017fe196b61a0ab324df76954.
Refs #31679.
|
|
SQLCompiler.
Performance regression in 278881e37619278789942513916acafaa88d26f3.
Co-authored-by: David Smith <smithdc@gmail.com>
|