I've the following model in a Django project:
from django.db import models
class Book(models.Model):
title = models.CharField(verbose_name='Title', max_length=255, db_index=True)
authors = models.CharField(verbose_name='Authors', max_length=255, db_index=True)
date = models.DateField(verbose_name='Date', db_index=True)
In the views I need to do a full text search query like the following:
books = Book.objects.filter(Q(title__icontains=query) | Q(authors__icontains=query))
Is the db_index=True actually helping the performances of my query or not?