8
8
891099838382015-12-19 01:21:02
SQL
89109983838, 2015-12-19 01:21:02

In what situation is it desirable and why to mark the field index = True in Flask-SQLAlchemy model schemas?

In what situation is it desirable and why to mark a field for indexing (index = True) in Flask-SQLAlchemy model schemas, and in which it does not make sense?
For example:

class User(db.Model):
    id = db.Column(db.Integer, primary_key = True, index = True)
    nickname = db.Column(db.String(64), index = True, unique = True)
    email = db.Column(db.String(120), index = True, unique = True)
    role = db.Column(db.SmallInteger, default = 0)
    text = db.Column(db.Text, index = True)
    user_group_id = db.Column(db.Integer, db.ForeignKey('user_group.id'), index = True)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-12-19
@89109983838

in those when the index is built on the field
briefly - so
chewed - in the course of the mailer on MySQL (well, or on the DBMS, I don’t remember, but Muskul considers it there)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question