Merge pull request #34 from tpokorra/TP-202108-fixindexes
add indexes to improve the speed of calc.py
This commit was merged in pull request #34.
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.2.5 on 2021-08-25 15:58
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('rates', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddIndex(
|
||||||
|
model_name='exchangerate',
|
||||||
|
index=models.Index(fields=['crypto_currency', 'fiat_currency', 'datetime_valid'], name='exchangerat_crypto__8e5f68_idx'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -8,3 +8,7 @@ class ExchangeRate(models.Model):
|
|||||||
datetime_valid = models.DateTimeField('datetime valid')
|
datetime_valid = models.DateTimeField('datetime valid')
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = "exchangerate"
|
db_table = "exchangerate"
|
||||||
|
|
||||||
|
indexes = [
|
||||||
|
models.Index(fields=['crypto_currency', 'fiat_currency', 'datetime_valid',]),
|
||||||
|
]
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Generated by Django 3.2.5 on 2021-08-25 15:58
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('transactions', '0006_auto_20210511_2230'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddIndex(
|
||||||
|
model_name='transaction',
|
||||||
|
index=models.Index(fields=['crypto_currency', 'owner', 'transaction_type'], name='transaction_crypto__de924d_idx'),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -44,3 +44,7 @@ class Transaction(models.Model):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = "transaction"
|
db_table = "transaction"
|
||||||
|
|
||||||
|
indexes = [
|
||||||
|
models.Index(fields=['crypto_currency', 'owner', 'transaction_type',]),
|
||||||
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user