Skip to content

Instantly share code, notes, and snippets.

@Sheikh2Imran
Last active December 15, 2019 14:41
Show Gist options
  • Select an option

  • Save Sheikh2Imran/b407baf7e8d53c45f3abcb8284740a07 to your computer and use it in GitHub Desktop.

Select an option

Save Sheikh2Imran/b407baf7e8d53c45f3abcb8284740a07 to your computer and use it in GitHub Desktop.
How to use BrinIndex in Django model
from django.db import models
from django.contrib.postgres.indexes import BrinIndex
class Account(models.Model):
id = models.AutoField()
username = models.CharField(max_lenght=100)
password = models.CharField(max_lenght=200)
class Meta:
indexes = [
BrinIndex(fields=['id'])
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment