I have two tables:
authcontains authentication informationuserscontains user profile information
auth has a username column. This serves as both a login credential and as part of the user’s profile URL (e.g. example.com/profiles/username).
When retrieving a list of users, their username is required to make the URL to their profile. Currently, I query the users table and join the auth table to get this info. However, that join can be avoided if username is also a column in users, making two identical columns in two different tables.
I don’t like the idea of a duplicate column, but one less join is always good. Is this a sign that the database schema (or something else) needs to be reworked, or is this an example of a case where redundancy is acceptable?
Normalizing your schema (i.e. removing redundancy) is not designed to address efficiency in time, but rather a) efficiency in space (by eliminating duplicate copies of data) and b) consistency (by not storing the same information in multiple places, you do not run the risk of having them not agree). From that perspective, having to use a join is the cost of these other benefits.