We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76feb37 commit efc7b56Copy full SHA for efc7b56
1-intro-to-sql/README.md
@@ -580,6 +580,13 @@ CREATE INDEX index_on_user_name ON users (user_name);
580
CREATE INDEX index_on_project_name ON projects (project_name);
581
```
582
583
+It goes without saying that we need to index the foreign key columns:
584
+
585
+```sql
586
+CREATE INDEX index_on_user_id ON contributorships (user_id);
587
+CREATE INDEX index_on_project_id ON contributorships (project_id);
588
+```
589
590
We also need to make sure that duplicate contributorships cannot exist.
591
592
We achieve this by creating a unique index on the combination of `user_id` and `project_id`:
0 commit comments