why does not django create db_index for object_id for GenericForeignkey?

208 Views Asked by At

i am using django 2.2. i have create a like/dislikie system using generic relation. django only create a indexing for contenttype but not object_id. if i try to count likes/dislike for specific model with specific object id it will be slow because there is no indexing for object_id. if my generic model is connected to 10 models where each models has many objects and each objects has many likes. here counting number of likes/dislike will be slow because it will use indexing for contenttype only.

0

There are 0 best solutions below