Slashdot is powered by your submissions, so send in your scoop


Forgot your password?
Databases Businesses Oracle Software

Ask Slashdot: Is Postgres On Par With Oracle? 372

grahamsaa writes "I work at medium sized company that offers a number of products that rely fairly heavily on backend databases, some of which are hundreds of gigabytes and deal with hundreds or thousands of queries per second. Currently, we're using a mix of Postgres, Oracle, and MySQL, though we're working hard to move everything to Postgres. The products that are still on MySQL and Oracle were acquisitions, so we didn't get to choose the RDBMS at the time these products were designed. So far, we've been very happy with Postgres, but I know next to nothing about Oracle. It's expensive and has a long history of use in large enterprises, but I'm curious about what it offers that Postgres might not — I'm not saying this because I think that sticking with Oracle would be a good idea (because in our case, it probably isn't), but I'm curious as to how some companies justify the cost — especially considering that EnterpriseDB makes transitioning from Oracle to Postgres feasible (though not painless) in most cases. For those that use Oracle — is it worth the money? What's keeping you from switching?"
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Is Postgres On Par With Oracle?

Comments Filter:
  • by KernelMuncher ( 989766 ) on Friday July 12, 2013 @09:06PM (#44266801)
    A big code base in PL-SQL I guess that nobody wants to re-write. We have lots of high dollar clients so it's easier to just stay with the status quo.

    We have been experimenting with MongoDB with a few of our newer projects. We'll see if that becomes a viable alternative.
  • by Anonymous Coward on Friday July 12, 2013 @09:30PM (#44266943)

    Index only scans exist in Postgres 9.2, so I imagine your comparison here is quite out of date

  • Probably Not (Score:5, Informative)

    by Greyfox ( 87712 ) on Friday July 12, 2013 @09:46PM (#44267047) Homepage Journal
    But most shops don't need something as powerful as Oracle. By the time they get done slapping a front end with non-optimized spring and hibernate queries on top of oracle, they may as well just be storing their entire database in one big XML flat file. A while back I ran across a developer who was trying to join two tables manually using hibernate. Around 40000 records his application would run out of memory and crash half an hour later. The SQL join I wrote to test it handled at least 1.5 million records and ran in under 10 seconds (And this was on a Postgres database.)

    So just because your shop is running Oracle, doesn't mean you can hire chimpanzees to write your font end code. Optimize your database design and queries and you can go a long way before you need the power of a commercial database system. Don't, and even the most advanced commercial database on the planet won't make your app suck any less.

  • by kuhneng ( 241514 ) on Friday July 12, 2013 @09:58PM (#44267095) Homepage

    Index only scans were added to postgresql (some caveats) in 9.2. The optimizer is cost/statistics based, though perhaps marginally less mature.

    What I miss are strong partitioning support, implicit query parallelism, incremental backups, clustering (RAC), and materialized views. Most / all of these features matter primarily for reporting / analytic workloads.

    PostgreSQL is a superb database, and dramatically easier to work with and manage than Oracle on a day to day basis. For transactional workloads at anything but the largest scale, it's excellent. On reporting and analytic workloads, it hits the wall much earlier but is still a good option for many needs.

  • by Anonymous Coward on Friday July 12, 2013 @10:12PM (#44267149)

    Ever try to store an array of strings?

    Ever try normalizing your schema? Even learning 1NF [] would help you understand everything that's wrong with that statement.

  • by Anonymous Coward on Friday July 12, 2013 @10:20PM (#44267187)

    For what it's worth, 9.3 is getting materialized views.

  • by aztracker1 ( 702135 ) on Friday July 12, 2013 @10:40PM (#44267259) Homepage
    The issue is that normalization comes at a cost, and it really depends on your use case. If you are dealing with financial transactions, yes, SQL (relational db) is your best bet. If you are dealing with complex, fluid structures for mostly read scenarios.. a serialized version of your data in a no-sql-like one key to lookup works better.

    It's emphatically not a one size fits all.. but the question becomes what is your major use case, and what performance needs do you have. NoSQL can scale horizontally in ways than SQL based databases simple can not. Outside of that horizontal scaling need, which is really quite rare, storing an entire object/document in your database as one record has some advantages in read/write when you aren't having to do so across too many records. There's a reason that many large operations put caching/nosql servers in front of their databases, and that is join operations, especially against large tables are fairly costly. Having to do more than 5-6 joins just becomes cumbersome, and means that another solution may have been better.
  • by Pedahzur ( 125926 ) on Friday July 12, 2013 @10:52PM (#44267321) Homepage

    EntepriseDB has a compatibility layer that lets you drop an Oracle application on top of PostgreSQL and run it (nearly) unmodified.

    See [] for more.

  • by Craig Ringer ( 302899 ) on Friday July 12, 2013 @11:16PM (#44267457) Homepage Journal

    PostgreSQL supports the SQL-standard WITH RECURSIVE clause instead of the Oracle-specific CONNECT BY.

    CONNECT BY is in many ways a nicer syntax, but the functionality is there.

    Pg also has XML types, schemas and extensions to serve some of the same purposes as packages, etc. Default values of function params are also supported.

    That's not to say it has full coverage of Oracle's feature set; it doesn't. There's no native materialized view support until 9.3, so you have to roll your own in currently released versions. There's no synchronous multi-master clustering in Pg (we're working on it). No autonomous transactions, and stored procs can't easily return multiple result sets. Partitioning in Pg is rudimentary and manual, at least in 9.3 and older, it might change in future.

    OTOH, Pg is more extensible, has saner licensing, offers choice of support, etc, per my other post.

  • by greg1104 ( 461138 ) <> on Friday July 12, 2013 @11:21PM (#44267491) Homepage

    There are a some ways to force a query plan onto Postgres that works effectively as hints. See my Hinting At PostgreSQL []. It's also possible to overide how Postgres runs selectivity functions to get different results. That mechanism is powerful enough that you can do almost everything possible with hints and then some. The problem is that it's too difficult for most to develop their own statistics model just to fix a broken query. When the alternative is sucking on everything Oracle makes hard, I can't understand why people aren't willing to do this the right way sometimes.

  • by Craig Ringer ( 302899 ) on Friday July 12, 2013 @11:22PM (#44267499) Homepage Journal

    I work professionally with PostgreSQL and I totally agree - PostgreSQL or any RDBMS isn't the right choice for all jobs.

    If the only way you can make it work is to build an inner-system or use EAV for everything, you shouldn't be using an RDBMS.

    If you have a free-form data model that's not amenible to structural analysis and normalization, you shouldn't be using an RDBMS.

    Unfortunately, most people think they have one or both of those things, but in fact they just haven't done the proper analysis and thought through it, so they jump straight for NoSQLWhateverIsFashionableToday. They realise all the features and code they have to write themselves at the application layer, do it badly, say their chosen database performs badly or is unreliable, and go looking for a different one.

    I'm glad to see that modern RDBMSs are starting to gain better support for non-relational structures (PostgreSQL's hstore, improving json support, etc). Few applications these days work solely with data that's suited to relational modelling. Apps often benefit from globally transactional behaviour though, and it's nice not having to wrestle 2PC and transaction co-ordinators and the other horrors you get when dealing with more than one DB in an product.

    (Pg plays really well with Redis too, by the way; it's a great caching layer and PostgreSQL's LISTEN/NOTIFY lets you do fine-grained invalidation of your Redis cache).

  • by greg1104 ( 461138 ) <> on Friday July 12, 2013 @11:23PM (#44267511) Homepage

    It doesn't have a slick UI, but you can do the same thing as Flashback on Postgres. You take a base backup of the database and regularly save write-ahead log files. When you need old data, you have to spin up a new database instance, ask it to replay to that point, and then get the data into the original instance. It won't win any design awards, but I recover lost data with this technique all the time.

  • by MacDork ( 560499 ) on Friday July 12, 2013 @11:30PM (#44267533) Journal

    Off the top of my head, the sort of thing you don't get with Oracle:
    select * from table limit 10 offset 20;
    source code

    I recently benchmarked postgres 9.2.4 on a Dell PowerEdge at Rackspace with a four disk raid 10, a two disk raid 1 for the WAL logs, and 48GB of RAM. It's good up to around 14000 transactions per second until you exceed what fits into RAM. Then it drops off to around 2000. That was the select benchmark with no writes involved.

    grahamsaa, if you really want to know what postgres can do, I suggest you install it and run some benchmarks to find out for yourself. You can find all the info you need to do this in Postgresql 9.0 High Performance [] It won't cost you anything to do this and if you decide it can't handle your workload, then you can always go purchase Oracle.

  • Imo (Score:4, Informative)

    by Charliemopps ( 1157495 ) on Friday July 12, 2013 @11:32PM (#44267545)

    In my opinion:
    Oracle is easier to hire for. A lot of "reporting people" know Oracle. If they had half a brain in their head they could write SQL for any DB... but if they had half a brain in their head you'd have to pay them more.

    Oracles support is... worse than anything. We just stopped calling. It's better to live with the bugs than waste man hours on that cunt licking whore Oracle calls support. I'd rather traverse the 7 layers of hell in a thong than ever talk to Oracle support about anything ever again.

    Oracle is Satan. They will fuck you in the most evil way imaginable. Whatever alternative you think will get you away from them, half way through the migration project oracle will buy the alternative company out. If torturing puppies were profitable, Oracle would have a puppy torturing product as a SASS. In fact, if torturing puppies just made the product slight less helpful to you, they'd probably do it as well... because their favorite pastime is making their product of less value to you.

  • by Anonymous Coward on Saturday July 13, 2013 @12:26AM (#44267757)

    Done. Been handled natively by PostgreSQL for over a decade. Combine with pivots or windows for some really interesting stuff.

  • by magman ( 1036252 ) on Saturday July 13, 2013 @04:09AM (#44268359)
    Oracle database version 12c does limit, offset and these things: []
  • by maxwell demon ( 590494 ) on Saturday July 13, 2013 @04:13AM (#44268365) Journal

    So he should switch to Oracle because Oracle might have backdoors? Are you hoping for extra protection against data loss by having the NSA maintaining an extra backup?

  • Re:MongoDB--run away (Score:4, Informative)

    by macson_g ( 1551397 ) on Saturday July 13, 2013 @05:42AM (#44268625)
    Mongo is not worth the pixels it's been written on. I've been there, I've seen that, I don't wish my worst enemies to go there again.
    You can store any arbitrary data, index it in any way, and run any language you like server-side with Postgres. And all this with full ACID, reliability, deterministic resource consumption and very decent performance.
    MongoDB is a toy in comparison.
  • by greg1104 ( 461138 ) <> on Saturday July 13, 2013 @11:07AM (#44269645) Homepage

    My employer has been using AIX for stability reasons for a long time (since the very early 90s). At the moment neither MySQL nor Postgres guarantee AIX ODBC driver support. Only DB2 (obviously), Oracle and Sybase (IIRC) do that so there you are, another reason on to keep dealing with these companies

    If you took any reasonable fraction of your database budget and pushed it toward a PostgreSQL support company, one of us would be happy to support an AIX ODBC driver. The options aren't just free and fully commercial. Smart companies help fund the features they need in order to enable a migration from the commercial databases to a free one.

There's no future in time travel.