[Django] #28783: Support for custom operator class for indexes

8 views
Skip to first unread message

Django

unread,
Nov 7, 2017, 4:45:45 PM11/7/17
to django-...@googlegroups.com
#28783: Support for custom operator class for indexes
-------------------------------------+-------------------------------------
Reporter: vinay | Owner: nobody
karanam |
Type: New | Status: new
feature |
Component: Database | Version: 2.0
layer (models, ORM) | Keywords: postgres, operator
Severity: Normal | class
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This is an extension of #28077 to support specifying operator class for
indexes.

Usage:

{{{
Index(fields=['jsonfield'], index_name='jsonb_idx',
operator_class='jsonb_path_ops')
}}}

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

Django

unread,
Nov 14, 2017, 2:14:11 PM11/14/17
to django-...@googlegroups.com
#28783: Support for custom operator class for indexes
-------------------------------------+-------------------------------------
Reporter: vinay karanam | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: postgres, operator | Triage Stage:
class | Unreviewed
Has patch: 0 | Needs documentation: 0

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

Comment (by Tim Graham):

Is this only supported on PostgreSQL? Of course, documentation would also
be needed.

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

Django

unread,
Nov 17, 2017, 6:59:28 PM11/17/17
to django-...@googlegroups.com
#28783: Support for custom operator class for indexes
-------------------------------------+-------------------------------------
Reporter: vinay karanam | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: postgres, operator | Triage Stage:
class | Unreviewed
Has patch: 0 | Needs documentation: 0

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

Comment (by vinay karanam):

AFAICT, this is only supported on psql. I am unable to find similar
feature on other databases.

I've updated the corresponding documentation.

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

Django

unread,
Dec 11, 2017, 10:37:56 AM12/11/17
to django-...@googlegroups.com
#28783: Support for custom operator class for indexes
-------------------------------------+-------------------------------------
Reporter: vinay karanam | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: postgres, operator | Triage Stage:
class | Unreviewed
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


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

Django

unread,
Dec 26, 2017, 1:11:04 PM12/26/17
to django-...@googlegroups.com
#28783: Support for custom operator class for indexes
-------------------------------------+-------------------------------------
Reporter: vinay karanam | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: postgres, operator | Triage Stage:
class | Unreviewed
Has patch: 1 | Needs documentation: 0

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

Comment (by Tim Graham):

Is there a need for a separate ticket from #28077? (Is there some
additional work needed to close that or could we just retitle it?)

I'm unsure if adding database-specific kwargs like `operator_class` to
`Index.__init__()` is a good approach, but I don't have an alternative in
mind.

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

Django

unread,
Dec 28, 2017, 9:10:22 AM12/28/17
to django-...@googlegroups.com
#28783: Support for custom operator class for indexes
-------------------------------------+-------------------------------------
Reporter: vinay karanam | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: postgres, operator | Triage Stage:
class | Unreviewed
Has patch: 1 | Needs documentation: 0

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

Comment (by vinay karanam):

#28077 requires almost same amount of work. It is only asking operator
support for `GinIndex`, whereas this adds support for any postgres index.
We can close it in favour of this or retitle #28077 and close this ticket.

Regarding code changes, even I was skeptical at first about adding
`operator_class` to `Index.__init__()` but then I saw `Index.create_sql`
accepts `using` kwarg which is only valid for postgres index.
If necessary we can have a subclass `PGIndex` and move postgres specific
options into this.

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

Django

unread,
Dec 28, 2017, 11:32:09 AM12/28/17
to django-...@googlegroups.com
#28783: Allow specifying custom operator classes for PostgreSQL indexes

-------------------------------------+-------------------------------------
Reporter: vinay karanam | Owner: nobody
Type: New feature | Status: closed

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution: duplicate

Keywords: postgres, operator | Triage Stage:
class | Unreviewed
Has patch: 1 | Needs documentation: 0

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

* status: new => closed
* resolution: => duplicate


Comment:

Okay, I added the details from this ticket to #28077 and retitled it.

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

Reply all
Reply to author
Forward
0 new messages