[Django] #30913: Add support for adding non-key columns to indexes

104 views
Skip to first unread message

Django

unread,
Oct 26, 2019, 5:33:14 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes | Owner: nobody
Ljungberg |
Type: New | Status: assigned
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords: db-indexes
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Postgres got support for the `INCLUDE` clause in `CREATE INDEX`. This can
be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 )
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE t1 = 'foo';
}}}

More info:
https://www.postgresql.org/docs/current/sql-createindex.html
https://use-the-index-luke.com/blog/2019-04/include-columns-in-btree-
indexes
https://www.postgresql.org/docs/10/indexes-index-only-scans.html

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2
with the same syntax. Because if this I think it shouldn't be implemented
as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to
ease the adding of support when/if sqlite or mariadb adds support.

I have a proof of concept I'm working on and will create a PR soon if
accepted.

--
Ticket URL: <https://code.djangoproject.com/ticket/30913>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 26, 2019, 5:35:39 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hannes Ljungberg:

Old description:

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in version
11. This can be used to add non-key columns to the index.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:1>

Django

unread,
Oct 26, 2019, 5:36:19 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hannes Ljungberg:

Old description:

> Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in
> version 11. This can be used to add non-key columns to the index.

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in version
11. This can be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 )
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE col1 = 'foo';
}}}

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2
with the same syntax. Because if this I think it shouldn't be implemented
as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to
ease the adding of support when/if sqlite or mariadb adds support.

I have a proof of concept I'm working on and will create a PR soon if
accepted.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:2>

Django

unread,
Oct 26, 2019, 5:36:45 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hannes Ljungberg:

Old description:

> Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in
> version 11. This can be used to add non-key columns to the index.


>
> {{{
> CREATE INDEX idx
> ON t1 ( col1 )
> INCLUDE ( col2 )
> }}}
>
> This allows for Index Only Scans on queries like:
>
> {{{

> SELECT col1, col2 FROM t1 WHERE col1 = 'foo';


> }}}
>
> More info:
> https://www.postgresql.org/docs/current/sql-createindex.html
> https://use-the-index-luke.com/blog/2019-04/include-columns-in-btree-
> indexes
> https://www.postgresql.org/docs/10/indexes-index-only-scans.html
>
> The idea is to add an additional kwarg to `Index` to support this:
>
> {{{
> Index(
> name='some-idx',
> fields=['headline'],
> include=['pub_date']
> }}}
>
> One of the biggest possibilities of this feature is to add included
> columns to unique indexes and use them to perform Index Only Scans. This
> would require adding the same kwarg to `UniqueConstraint`. The
> implementation would be a lot like the `condition` kwargs to both `Index`
> and `UniqueConstraint`.
>
> At the moment the only Django-supported database that can use this
> feature is Postgres but it's also supported by Microsoft SQL Server and
> IBM Db2 with the same syntax. Because if this I think it shouldn't be
> implemented as a postgres only feature but exposed on
> `BaseDatabaseSchemaEditor` to ease the adding of support when/if sqlite
> or mariadb adds support.
>
> I have a proof of concept I'm working on and will create a PR soon if
> accepted.

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in version
11. This can be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 )
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE col1 = 'foo';
}}}

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']

)
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2
with the same syntax. Because if this I think it shouldn't be implemented
as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to
ease the adding of support when/if sqlite or mariadb adds support.

I have a proof of concept I'm working on and will create a PR soon if
accepted.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:3>

Django

unread,
Oct 26, 2019, 5:45:47 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hannes Ljungberg:

Old description:

> Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in
> version 11. This can be used to add non-key columns to the index.


>
> {{{
> CREATE INDEX idx
> ON t1 ( col1 )
> INCLUDE ( col2 )
> }}}
>
> This allows for Index Only Scans on queries like:
>
> {{{

> SELECT col1, col2 FROM t1 WHERE col1 = 'foo';


> }}}
>
> More info:
> https://www.postgresql.org/docs/current/sql-createindex.html
> https://use-the-index-luke.com/blog/2019-04/include-columns-in-btree-
> indexes
> https://www.postgresql.org/docs/10/indexes-index-only-scans.html
>
> The idea is to add an additional kwarg to `Index` to support this:
>
> {{{
> Index(
> name='some-idx',
> fields=['headline'],
> include=['pub_date']

> )


> }}}
>
> One of the biggest possibilities of this feature is to add included
> columns to unique indexes and use them to perform Index Only Scans. This
> would require adding the same kwarg to `UniqueConstraint`. The
> implementation would be a lot like the `condition` kwargs to both `Index`
> and `UniqueConstraint`.
>
> At the moment the only Django-supported database that can use this
> feature is Postgres but it's also supported by Microsoft SQL Server and
> IBM Db2 with the same syntax. Because if this I think it shouldn't be
> implemented as a postgres only feature but exposed on
> `BaseDatabaseSchemaEditor` to ease the adding of support when/if sqlite
> or mariadb adds support.
>
> I have a proof of concept I'm working on and will create a PR soon if
> accepted.

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in version
11. This can be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 );
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE col1 = 'foo';
}}}

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']

)
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2
with the same syntax. Because if this I think it shouldn't be implemented
as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to
ease the adding of support when/if sqlite or mariadb adds support.

I have a proof of concept I'm working on and will create a PR soon if
accepted.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:4>

Django

unread,
Oct 26, 2019, 5:46:40 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hannes Ljungberg:

Old description:

> Postgres got support for the `INCLUDE` clause in `CREATE INDEX` in
> version 11. This can be used to add non-key columns to the index.


>
> {{{
> CREATE INDEX idx
> ON t1 ( col1 )
> INCLUDE ( col2 );
> }}}
>
> This allows for Index Only Scans on queries like:
>
> {{{

> SELECT col1, col2 FROM t1 WHERE col1 = 'foo';


> }}}
>
> More info:
> https://www.postgresql.org/docs/current/sql-createindex.html
> https://use-the-index-luke.com/blog/2019-04/include-columns-in-btree-
> indexes
> https://www.postgresql.org/docs/10/indexes-index-only-scans.html
>
> The idea is to add an additional kwarg to `Index` to support this:
>
> {{{
> Index(
> name='some-idx',
> fields=['headline'],
> include=['pub_date']

> )


> }}}
>
> One of the biggest possibilities of this feature is to add included
> columns to unique indexes and use them to perform Index Only Scans. This
> would require adding the same kwarg to `UniqueConstraint`. The
> implementation would be a lot like the `condition` kwargs to both `Index`
> and `UniqueConstraint`.
>
> At the moment the only Django-supported database that can use this
> feature is Postgres but it's also supported by Microsoft SQL Server and
> IBM Db2 with the same syntax. Because if this I think it shouldn't be
> implemented as a postgres only feature but exposed on
> `BaseDatabaseSchemaEditor` to ease the adding of support when/if sqlite
> or mariadb adds support.
>
> I have a proof of concept I'm working on and will create a PR soon if
> accepted.

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX`. This can
be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 )
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE t1 = 'foo';
}}}

https://www.postgresql.org/docs/current/indexes-index-only-scans.html

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2
with the same syntax. Because if this I think it shouldn't be implemented
as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to
ease the adding of support when/if sqlite or mariadb adds support.

I have a proof of concept I'm working on and will create a PR soon if
accepted.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:5>

Django

unread,
Oct 26, 2019, 5:48:09 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: db-indexes | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Hannes Ljungberg:

Old description:

> Postgres got support for the `INCLUDE` clause in `CREATE INDEX`. This can


> be used to add non-key columns to the index.
>
> {{{
> CREATE INDEX idx
> ON t1 ( col1 )
> INCLUDE ( col2 )
> }}}
>
> This allows for Index Only Scans on queries like:
>
> {{{
> SELECT col1, col2 FROM t1 WHERE t1 = 'foo';
> }}}
>
> More info:
> https://www.postgresql.org/docs/current/sql-createindex.html
> https://use-the-index-luke.com/blog/2019-04/include-columns-in-btree-
> indexes

> https://www.postgresql.org/docs/current/indexes-index-only-scans.html


>
> The idea is to add an additional kwarg to `Index` to support this:
>
> {{{
> Index(
> name='some-idx',
> fields=['headline'],
> include=['pub_date']
> }}}
>
> One of the biggest possibilities of this feature is to add included
> columns to unique indexes and use them to perform Index Only Scans. This
> would require adding the same kwarg to `UniqueConstraint`. The
> implementation would be a lot like the `condition` kwargs to both `Index`
> and `UniqueConstraint`.
>
> At the moment the only Django-supported database that can use this
> feature is Postgres but it's also supported by Microsoft SQL Server and
> IBM Db2 with the same syntax. Because if this I think it shouldn't be
> implemented as a postgres only feature but exposed on
> `BaseDatabaseSchemaEditor` to ease the adding of support when/if sqlite
> or mariadb adds support.
>
> I have a proof of concept I'm working on and will create a PR soon if
> accepted.

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX`. This can
be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 )
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE t1 = 'foo';
}}}

https://www.postgresql.org/docs/current/indexes-index-only-scans.html

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2

with the same syntax. Because of this I think it shouldn't be implemented


as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to

ease the adding of support when/if sqlite or mariadb/mysql get it.

I have a proof of concept I'm working on and will create a PR soon if
accepted.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:6>

Django

unread,
Oct 26, 2019, 7:35:31 PM10/26/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: nobody
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* keywords: db-indexes => postgresql covering index include
* component: Database layer (models, ORM) => Migrations
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:7>

Django

unread,
Oct 27, 2019, 4:53:05 AM10/27/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg

Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hannes Ljungberg):

* owner: nobody => Hannes Ljungberg


--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:8>

Django

unread,
Oct 30, 2019, 5:59:28 AM10/30/19
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hannes Ljungberg):

* has_patch: 0 => 1


Old description:

> Postgres got support for the `INCLUDE` clause in `CREATE INDEX`. This can
> be used to add non-key columns to the index.
>
> {{{
> CREATE INDEX idx
> ON t1 ( col1 )
> INCLUDE ( col2 )
> }}}
>
> This allows for Index Only Scans on queries like:
>
> {{{
> SELECT col1, col2 FROM t1 WHERE t1 = 'foo';
> }}}
>
> More info:
> https://www.postgresql.org/docs/current/sql-createindex.html
> https://use-the-index-luke.com/blog/2019-04/include-columns-in-btree-
> indexes

> https://www.postgresql.org/docs/current/indexes-index-only-scans.html


>
> The idea is to add an additional kwarg to `Index` to support this:
>
> {{{
> Index(
> name='some-idx',
> fields=['headline'],
> include=['pub_date']
> }}}
>
> One of the biggest possibilities of this feature is to add included
> columns to unique indexes and use them to perform Index Only Scans. This
> would require adding the same kwarg to `UniqueConstraint`. The
> implementation would be a lot like the `condition` kwargs to both `Index`
> and `UniqueConstraint`.
>
> At the moment the only Django-supported database that can use this
> feature is Postgres but it's also supported by Microsoft SQL Server and

> IBM Db2 with the same syntax. Because of this I think it shouldn't be


> implemented as a postgres only feature but exposed on
> `BaseDatabaseSchemaEditor` to ease the adding of support when/if sqlite

> or mariadb/mysql get it.


>
> I have a proof of concept I'm working on and will create a PR soon if
> accepted.

New description:

Postgres got support for the `INCLUDE` clause in `CREATE INDEX`. This can
be used to add non-key columns to the index.

{{{
CREATE INDEX idx
ON t1 ( col1 )
INCLUDE ( col2 );
}}}

This allows for Index Only Scans on queries like:

{{{
SELECT col1, col2 FROM t1 WHERE t1 = 'foo';
}}}

https://www.postgresql.org/docs/current/indexes-index-only-scans.html

The idea is to add an additional kwarg to `Index` to support this:

{{{
Index(
name='some-idx',
fields=['headline'],
include=['pub_date']

)
}}}

One of the biggest possibilities of this feature is to add included
columns to unique indexes and use them to perform Index Only Scans. This
would require adding the same kwarg to `UniqueConstraint`. The
implementation would be a lot like the `condition` kwargs to both `Index`
and `UniqueConstraint`.

At the moment the only Django-supported database that can use this feature
is Postgres but it's also supported by Microsoft SQL Server and IBM Db2

with the same syntax. Because of this I think it shouldn't be implemented


as a postgres only feature but exposed on `BaseDatabaseSchemaEditor` to

ease the adding of support when/if sqlite or mariadb/mysql get it.

--

Comment:

PR: https://github.com/django/django/pull/11991

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:9>

Django

unread,
Apr 24, 2020, 1:14:54 AM4/24/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


Comment:

See
[https://github.com/django/django/pull/11991/commits/053fc84d750227fb54a9837536a976f09a39157a#r414298432
comment].

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:10>

Django

unread,
Apr 24, 2020, 1:57:45 AM4/24/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"104493311ef9361f03b957844b5a591f7f76d1b0" 10449331]:
{{{
#!CommitTicketReference repository=""
revision="104493311ef9361f03b957844b5a591f7f76d1b0"
Refs #30913 -- Added BaseDatabaseSchemaEditor._index_condition_sql().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:11>

Django

unread,
May 17, 2020, 4:56:58 PM5/17/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hannes Ljungberg):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:12>

Django

unread,
May 28, 2020, 3:23:02 AM5/28/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:13>

Django

unread,
Jun 1, 2020, 3:50:44 PM6/1/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Accepted
index include |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hannes Ljungberg):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:14>

Django

unread,
Jun 3, 2020, 12:49:51 AM6/3/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: postgresql covering | Triage Stage: Ready for
index include | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:15>

Django

unread,
Jun 4, 2020, 6:48:13 AM6/4/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed

Keywords: postgresql covering | Triage Stage: Ready for
index include | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"8c7992f658e1125f8dc20b19206e8bbbe4187372" 8c7992f]:
{{{
#!CommitTicketReference repository=""
revision="8c7992f658e1125f8dc20b19206e8bbbe4187372"
Fixed #30913 -- Added support for covering indexes on PostgreSQL 11+.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:16>

Django

unread,
Jun 4, 2020, 6:48:13 AM6/4/20
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed
Keywords: postgresql covering | Triage Stage: Ready for
index include | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"f83b44075dafa429d59e8755aa47e15577cc49f9" f83b4407]:
{{{
#!CommitTicketReference repository=""
revision="f83b44075dafa429d59e8755aa47e15577cc49f9"
Refs #30913 -- Added system checks for covering indexes and unique
constraints support.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:17>

Django

unread,
Feb 21, 2024, 2:26:05 AM2/21/24
to django-...@googlegroups.com
#30913: Add support for adding non-key columns to indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: Migrations | Version: dev
Severity: Normal | Resolution: fixed
Keywords: postgresql covering | Triage Stage: Ready for
index include | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"abe6c1f93eb112066691b590052704948789c60f" abe6c1f9]:
{{{#!CommitTicketReference repository=""
revision="abe6c1f93eb112066691b590052704948789c60f"
Refs #30913 -- Corrected IndexesTests.test_index_include_pointing_to_fk().

This adjusts a test assigning an Index to Meta.constraints.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30913#comment:18>
Reply all
Reply to author
Forward
0 new messages