It is ideal to index ''object_id'' to make fetch query faster.
I can work on this task.
--
Ticket URL: <https://code.djangoproject.com/ticket/30122>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Carlton Gibson):
Hi Shashank.
Without really looking, this ''seems'' reasonable.
What's the query being generated? Is that using a table scan? If so,
you're just talking about adding an index right?
--
Ticket URL: <https://code.djangoproject.com/ticket/30122#comment:1>
Comment (by Simon Charette):
If we decide to add an index we should consider a composite
`(content_type_id, object_id)` one and maybe make the `content_type`
foreign key `db_index=False` given there's no use case for querying
`LogEntry` by `object_id` without `content_type_id` and that most (if not
all) supported database engines are able to use the first parts of a
composite index rendering the `content_type_id` index useless.
--
Ticket URL: <https://code.djangoproject.com/ticket/30122#comment:2>
* easy: 1 => 0
Comment:
Seems related to #23435: "GenericForeignKey should be indexed".
--
Ticket URL: <https://code.djangoproject.com/ticket/30122#comment:3>
Comment (by Claude Paroz):
I think this is a duplicate of #17659 (blocked because `object_id` is a
`TextField` currently unindexable on MySQL). See also #28661.
--
Ticket URL: <https://code.djangoproject.com/ticket/30122#comment:4>
* status: new => closed
* resolution: => duplicate
--
Ticket URL: <https://code.djangoproject.com/ticket/30122#comment:5>