Re: PostrgeSQL vs oracle doing 1 million sqrts am I doing it wrong?

Marti Raudsepp <marti@juffo.org>

From: Marti Raudsepp <marti@juffo.org>
To: testman1316 <danilo.ramirez@hmhco.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2014-08-05T10:16:32Z
Lists: pgsql-hackers
On Mon, Aug 4, 2014 at 11:48 PM, testman1316 <danilo.ramirez@hmhco.com> wrote:
> In both we ran code that did 1 million square roots (from 1 to 1 mill). Then
> did the same but within an If..Then statement.

> Note: once we started running queries on the exact same data in Oracle and
> PostgreSQL we saw a similar pattern. On basic queries little difference, but
> as they started to get more and more complex Oracle was around 3-5 faster.

Looks like from the test cases you posted, you're not actually
benchmarking any *queries*, you're comparing the speeds of the
procedural languages. And yes, PL/pgSQL is known to be a farily slow
language.

If you want fair benchmark results, you should instead concentrate on
what databases are supposed to do: store and retrieve data; finding
the most optimal way to execute complicated SQL queries. In most
setups, that's where the majority of database processor time is spent,
not procedure code.

Regards,
Marti