Last active
January 29, 2022 06:01
-
-
Save vubon/d154c4f8a250b0ec1d485d007f62eaf1 to your computer and use it in GitHub Desktop.
Django BRIN index in PostgreSQL Database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.postgres.indexes import BrinIndex | |
from django.db import models | |
class SampleData(models.Model): | |
created_at = models.DateTimeField() | |
class Meta: | |
""" | |
You must need to use PostgreSQL DB unless you can't use BrinIndex | |
""" | |
indexes = ( | |
BrinIndex(fields=['created_at']), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment