1👍
✅
No, that won’t speed up performance. Internally, a foreign key is little more than an indexed IntegerField
with a db constraint. The constraint won’t affect single-table read performance, though it might (positively) affect read performance when using joins, i.e. select_related
.
👤knbk
0👍
Do you have indexes on your tables? In your case b-tree or hash would help.
http://www.postgresql.org/docs/9.1/static/indexes-types.html . Also please dont denormalize db, thats why you use sql database …for normalization.
- [Answer]-Select_related django. Why i can't using select_related in my project?
- [Answer]-How to perform a specific task in django automatically after a fixed interval of time?
- [Answer]-Django NOT NULL constraint failed: pages_newlist.user_id
Source:stackexchange.com