mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	confirmation: Add database indexes on confirmation fields.
Apparently, we didn't have any database indexes on Confirmation, which meant that on servers with large numbers of users like zulipchat.com, new account registration could spend a ton of time effectively doing a table scan on this table.
This commit is contained in:
		
							
								
								
									
										37
									
								
								confirmation/migrations/0007_add_indexes.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								confirmation/migrations/0007_add_indexes.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
# Generated by Django 2.2.10 on 2020-03-27 09:02
 | 
			
		||||
 | 
			
		||||
from django.db import migrations, models
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Migration(migrations.Migration):
 | 
			
		||||
 | 
			
		||||
    dependencies = [
 | 
			
		||||
        ('confirmation', '0006_realmcreationkey_presume_email_valid'),
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    operations = [
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='confirmation',
 | 
			
		||||
            name='confirmation_key',
 | 
			
		||||
            field=models.CharField(db_index=True, max_length=40),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='confirmation',
 | 
			
		||||
            name='date_sent',
 | 
			
		||||
            field=models.DateTimeField(db_index=True),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='confirmation',
 | 
			
		||||
            name='object_id',
 | 
			
		||||
            field=models.PositiveIntegerField(db_index=True),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AlterField(
 | 
			
		||||
            model_name='realmcreationkey',
 | 
			
		||||
            name='creation_key',
 | 
			
		||||
            field=models.CharField(db_index=True, max_length=40, verbose_name='activation key'),
 | 
			
		||||
        ),
 | 
			
		||||
        migrations.AlterUniqueTogether(
 | 
			
		||||
            name='confirmation',
 | 
			
		||||
            unique_together={('type', 'confirmation_key')},
 | 
			
		||||
        ),
 | 
			
		||||
    ]
 | 
			
		||||
		Reference in New Issue
	
	Block a user