5 ms·
Two 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
by albertopv 3y ago
Two 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 it depends on the specific case).
- baq 3y agoSimilar in postgres, depending on version. SQL Server is a damn fine DB if you can afford it. Highly recommended.
- jaggederest 3y agoSQL Server is one of the descendants of Ingres, and PostgreSQL is, as the name might suggest, the successor project for database research after Ingres. They're both great databases really, it's a fun connection in their mutual history.
- albertopv 3y agoWow, I didn't know!
- thomasjudge 3y agoSybase, actually
- jaggederest 3y agoThe first Sybase grew out of the Ingres project at UCB, so transitively, SQL Server is also a descendant.
- johnthescott 3y agobob epstein was vp at brittion-lee when he left to form sybase. BLI built a relational database machine (IDM), which was influenced by ingres but not much was inherited, code wise. sybase used a VM/pcode architecture, very much not like ingres. https://www.google.com/search?q=britton+lee+inc+wikipedia https://www.google.com/search?q=britton+lee+inc+wikipedia
- jaggederest 3y agoNeat, thanks for elaborating, I knew BLI grew out of the ingres project but not how closely they were related.
- dx034 3y agoI second that. I found it by far the most pleasant database to work with, including its tooling. Postgres is probably second. Too bad SQL Server is so expensive.
- sohnakukkar 3y agoHow much SQL Server costs?
- vikingerik 3y agoYou can google it, but the short answer is Enterprise Edition is on the order of tens of thousands of dollars per CPU.
- dx034 3y agoMaybe they'll change it at some point. I believe if SQL Server was free, it would dominate the business. I last used it 7+ years ago and back then it was (from my subjective experience) better than Postgres is now. And I love Postgres. But SQL Server was a dream to work with. Feature rich with amazing tooling. You can get most features in Postgres with plugins and manual work, but SQL Server does it all for you.
- SigmundA 3y agoCompared to Sql server, PG's lack of true clustered indexes and no query plan re-use was very surprising, also no hints to wrangle a bad query plan!
- olavgg 3y agoAnd SQL server's lack of backup with SSH piping makes it basically pain to administer.
- joelrwilliams1 3y agoI've run across this in Oracle and MySQL as well...and--same solution as you--have split out the or conditions using union all.
- hot_gril 3y agoPostgres can optimize OR pretty well, but not always.