3 ms·
It looked very useful and intuitive at first, but on further thought, I think the only time that you'd truly benefit from it if you SELECT *. For other SELECT q
by Ayesh 5y ago
It looked very useful and intuitive at first, but on further thought, I think the only time that you'd truly benefit from it if you SELECT *. For other SELECT queries with explicit field name list, you'd need to know the table the key constraint links to anyway.
SQL Views serve perfectly well for queries encouraged by the schema itself, and i think they are more sophisticated and practical way.
- JoelJacobson 5y agoThere is similar comment in the thread, suggesting both tables should always be specified. Not sure what I prefer yet. The idea is the foreign key name is usually the same as the referenced table, so should be an infrequent problem.
- zmmmmm 5y ago> The idea is the foreign key name is usually the same as the referenced table I think this is where you are hitting some of your turbulence here because lots of ORMs / schema management tools actually generate completely cryptic fk names (sometimes based on the hash of the columns or similar). Personally I think weighing in legacy baggage like that too highly is a bad thing as it creates enormous inertia.
- JoelJacobson 5y agoThanks for explaining, I have no experience of ORMs, always written my queries manually. This was insightful. Thanks also for the word “inertia”, good one, will add to my vocabulary.