I understand the benefits of using table relationships in order to create constraints, such as preventing a row from being deleted from one table when it is related to a row in another.
But will doing so improve performance when running joined queries.
Eg. suppose I have InnoDB tables USER and USERINFO as shown below:
USER
|Field |Type |Null |Key |Default |Extra
--|id |int(11) |NO |PRI | |auto_increment
| |email |varchar(700)|NO | | |
| |password|varchar(255)|NO | | |
| |active |varchar(1) |NO | |n |
| |created |timestamp |NO | |CURRENT_TIMESTAMP|
|
| USERINFO
| |Field |Type |Null |Key |Default |Extra
--|user |int(11) |NO |PRI | |
|name |varchar(100)|NO | | |
|position|varchar(100)|NO | | |
...
Is it beneficial in terms of performance when running the following query?
SELECT * FROM USER U JOIN USERINFO UI ON U.id = UI.user