Skip to content

Commit 73b2c63

Browse files
authored
Refs #34840 -- Improved release note describing index regression.
1 parent 9fd3a0f commit 73b2c63

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

docs/releases/4.2.6.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@ Bugfixes
3535
* Fixed a regression in Django 4.2 that caused unnecessary casting of string
3636
based fields (``CharField``, ``EmailField``, ``TextField``, ``CICharField``,
3737
``CIEmailField``, and ``CITextField``) used with the ``__isnull`` lookup on
38-
PostgreSQL. As a consequence, the pre-Django 4.2 indexes didn't match and
39-
were not used by the query planner (:ticket:`34840`).
38+
PostgreSQL. As a consequence, indexes using an ``__isnull`` expression or
39+
condition created before Django 4.2 wouldn't be used by the query planner,
40+
leading to a performance regression (:ticket:`34840`).
4041

41-
You may need to recreate indexes propagated to the database with Django
42-
4.2 - 4.2.5 as they contain unnecessary ``::text`` casting that is avoided as
43-
of this release.
42+
You may need to recreate such indexes created in your database with Django
43+
4.2 to 4.2.5, as they contain unnecessary ``::text`` casting. Find candidate
44+
indexes with this query:
45+
46+
.. code-block:: sql
47+
48+
SELECT indexname, indexdef
49+
FROM pg_indexes
50+
WHERE indexdef LIKE '%::text IS %NULL';

0 commit comments

Comments
 (0)