Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL or MS SQL Server?

I'm considering using PostgreSQL with a .Net web app. Basically 3 reasons:

  1. Mature Geo Queries
  2. Small footprint + Linux
  3. Price

I'm wondering a bit about tools though, SQL Server Profiler and query plans and performance monitors have been helpful. How is this world with Postgres? Some other things I should consider?

Edit: Will most likely use NHibernate as ORM

like image 908
mmiika Avatar asked Nov 20 '08 05:11

mmiika


People also ask

Which is better PostgreSQL or Microsoft SQL Server?

From the above comparisons, PostgreSQL trumps SQL Server in several scenarios. Not only is it open-source and free, but it also has several features that are easily available and can be implemented automatically, unlike Microsoft SQL Server. Moreover, PostgreSQL has a more suitable concurrency management system.

Why SQL Server is better than PostgreSQL?

PostgreSQL doesn't support in-memory database creation. SQL Server uses an optimistic strategy to handle memory-optimized tables, which means they can participate in transactions along with ordinary tables. Memory-based transactions are faster than regular ones, and this allows a drastic increase in application speed.

What is the difference between SQL Server and PostgreSQL?

SQL server is a database management system which is mainly used for e-commerce and providing different data warehousing solutions. PostgreSQL is an advanced version of SQL which provides support to different functions of SQL like foreign keys, subqueries, triggers, and different user-defined types and functions.

Does PostgreSQL use SQL Server?

PostgreSQL is an advanced object-relational database management system that uses Structured Query Language (SQL) in addition to its own procedural language, PL/pgSQL. PostgreSQL is easy-to-use with a full stack of RDBMS database features and capabilities for handling data.


2 Answers

Postgres comes with pgAdmin, which does graphical explains to help you optimise queries. Entering your query in an SQL entry pane and pressing F7 gives you a really clear indication of how the query is planned and executed. More on this, here:

Graphical Explain Plans.

If you're doing a web app and are storing or working with IP Addresses, you can use the INET data type, which allows you to store the IP Address as a real type, and do all sorts of operations on it directly - Is an IP address in banned subnet, for example. No need to store 4 lots of quads and recombine them in code, or store it in a string.

Is running on Linux a bonus, if it's a .NET app?

like image 66
majelbstoat Avatar answered Sep 26 '22 13:09

majelbstoat


There are a whole slew of tools for PostgreSQL, some free, some not... PgAdmin + Explain ANALYZE normally will give you everything you need and it is free.

like image 35
Joshua D. Drake Avatar answered Sep 24 '22 13:09

Joshua D. Drake