Postgres doesn't automatically create indexes for foreign keys. This may come as a surprise if you're more familiar with other databases, so pay attention to the implications as it can hurt you in a few ways. I don't know of any database system that does this. In the case for SQL Server, the foreign keys usually get added by the ORM layer (Entity Framework migrations if you're using dotnet).
MySQL InnoDB does I believe...
Ways to shoot yourself in the foot with Postgres
41–50 of 329 posts
Re: Ways to shoot yourself in the foot with Postgres
#42"2. Push all your application logic into Postgres functions and procedures" Why are functions and procedures (an abstraction layer at db layer) considered harmful to performance when the same abstraction layer will be required at the application layer (introducing out of process overhead and possibly network traffic)? I don't agree with this advice. (Or I don't understand it.)
It is always more easier to scale horizontally at application layer (just adding more servers) than at database layer (which involves syncing data between multiple database instances).
Re: Ways to shoot yourself in the foot with Postgres
#43I’d add ’not reading the table of contents of the manual’ to the list. I’ve probably worked with hundreds of people now who use a database daily either in code or just to explore data and can count on two hands (optimistically…) the number of folks who actually read the fine manual in any other way than googling something specific. Pro tip: read it so you know what to google for!
Re: Ways to shoot yourself in the foot with Postgres
#44Two years ago I moved to a new company using Postgres as THE relational db, coming from years of Sql Server I found poor query plan issues troubleshooting tools. Anyway, I don't know if it's the same in Postgres, but in Sql Server an OR condition like that could kill your performance quite easily in a relatively complex query, often I had to refactor my query to a UNION (usually with ALL to avoid a distinct step, but…
SQL Server is a damn fine DB if you can afford it. Highly recommended.
Re: Ways to shoot yourself in the foot with Postgres
#45I’d add ’not reading the table of contents of the manual’ to the list. I’ve probably worked with hundreds of people now who use a database daily either in code or just to explore data and can count on two hands (optimistically…) the number of folks who actually read the fine manual in any other way than googling something specific. Pro tip: read it so you know what to google for!
Re: Ways to shoot yourself in the foot with Postgres
#46Earlier quoted context omitted.
It is always more easier to scale horizontally at application layer (just adding more servers) than at database layer (which involves syncing data between multiple database instances).
You can horizontally scale the database directly.
Re: Ways to shoot yourself in the foot with Postgres
#47Re: Ways to shoot yourself in the foot with Postgres
#48[flagged]
Re: Ways to shoot yourself in the foot with Postgres
#49Pertinent: https://wiki.postgresql.org/wiki/Don%27t_Do_This
There's something ironic about having so many features that you have a dedicated page telling users which ones not to use.
Re: Ways to shoot yourself in the foot with Postgres
#50Pertinent: https://wiki.postgresql.org/wiki/Don%27t_Do_This
There's something ironic about having so many features that you have a dedicated page telling users which ones not to use.
On a related note, one could say that the C++ Core Guidelines[1] at least partially represent such a list. 55 matches for “don't use” and 247 for “avoid”, although not all of them are about language features, obviously.
[1]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines