1

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.

  • Duplicate of https://stackoverflow.com/questions/34769052/in-django-do-i-need-to-add-a-db-index-to-object-id-when-using-a-genericforeignk – Jimmy Engelbrecht Mar 09 '23 at 20:34

0 Answers0