[英]How to add indexing to auth_user model django
I want to add index to Django built-in table for users which is auth_user. 我想为用户添加指向Django内置表的索引,即auth_user。 I want to add index to first_name of auth_user model. 我想将索引添加到auth_user模型的first_name。
How can i do it? 我该怎么做?
You can create an index directly into the database. 您可以直接在数据库中创建索引。 For example (PostgreSQL): 例如(PostgreSQL):
CREATE INDEX auth_username_idx ON username (auth_user);
It should work. 它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.