-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Block Range index instead of b-tree to handle range operations
Signed-off-by: Kipchirchir Sigei <[email protected]>
- Loading branch information
Showing
3 changed files
with
51 additions
and
50 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
onadata/apps/logger/migrations/0005_add_brindex_date_fields.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Generated by Django 3.2.18 on 2023-03-13 15:34 | ||
|
||
import django.contrib.postgres.indexes | ||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("logger", "0004_update_instance_geoms"), | ||
] | ||
|
||
operations = [ | ||
migrations.SeparateDatabaseAndState( | ||
database_operations=[ | ||
migrations.RunSQL( | ||
sql='CREATE INDEX "logger_inst_date_cr_079af3_brin" ON "logger_instance" USING brin ("date_created") WITH (autosummarize = on);', | ||
reverse_sql='DROP INDEX "logger_inst_date_cr_079af3_brin";', | ||
), | ||
migrations.RunSQL( | ||
sql='CREATE INDEX "logger_inst_date_mo_270e0d_brin" ON "logger_instance" USING brin ("date_modified") WITH (autosummarize = on);', | ||
reverse_sql='DROP INDEX "logger_inst_date_mo_270e0d_brin";', | ||
), | ||
], | ||
state_operations=[ | ||
migrations.AddIndex( | ||
model_name="instance", | ||
index=django.contrib.postgres.indexes.BrinIndex( | ||
autosummarize=True, | ||
fields=["date_created"], | ||
name="logger_inst_date_cr_079af3_brin", | ||
), | ||
), | ||
migrations.AddIndex( | ||
model_name="instance", | ||
index=django.contrib.postgres.indexes.BrinIndex( | ||
autosummarize=True, | ||
fields=["date_modified"], | ||
name="logger_inst_date_mo_270e0d_brin", | ||
), | ||
), | ||
], | ||
) | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains 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