Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).



Similar in postgres, depending on version.

SQL Server is a damn fine DB if you can afford it. Highly recommended.


SQL 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.


Wow, I didn't know!


Sybase, actually


The first Sybase grew out of the Ingres project at UCB, so transitively, SQL Server is also a descendant.


bob 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


Neat, thanks for elaborating, I knew BLI grew out of the ingres project but not how closely they were related.


I 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.


How much SQL Server costs?


You can google it, but the short answer is Enterprise Edition is on the order of tens of thousands of dollars per CPU.


Maybe 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.


Compared 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!


And SQL server's lack of backup with SSH piping makes it basically pain to administer.


I've run across this in Oracle and MySQL as well...and--same solution as you--have split out the or conditions using union all.


Postgres can optimize OR pretty well, but not always.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: