comp.lang.ada
 help / color / mirror / Atom feed
From: "björn lundin" <b.f.lundin@gmail.com>
Subject: Re: Ada and PL/pgSQL ?
Date: Sat, 10 May 2014 04:04:03 -0700 (PDT)
Date: 2014-05-10T04:04:03-07:00	[thread overview]
Message-ID: <e5d77bd3-f53f-48c4-a126-731a218850ee@googlegroups.com> (raw)
In-Reply-To: <304f2721-64bc-4959-a7e8-0cc29cf5204f@googlegroups.com>

Den fredagen den 9:e maj 2014 kl. 18:26:22 UTC+2 skrev sdale...@gmail.com:

>With a majority of the slow down occuring from table locks on db transactions.

Thinking a bit of this.
If you have the same figures with Postgres, as you state,
then I wonder if your code is explicitly locking the tables?

As in issuing a statement like 'LOCK TABLE XYZ' or
'SELECT XYZ for UPDATE'

That is killing performance in any db.

If so, and you migrate that principle, you will always have performance issues.
If so, you'll need to use other mechanisms to ensure your data is untampered with, as in having versions/timestamps on each row, and check that the row-version you first read, is the same at write (essentially using a where-clause having 'where version=originally_read_version' in it. 

And if rows affected is 0, rollback and start-over, given you wanted to update 1 row). Scoop of transactions becomes very important here

Basically, what my posts are trying to say is that
the timings you describe will likely not get better by putting your logic in the database. Putting you logic in Ada, will however likely make your maintenance burden a lot easier

/Björn




      parent reply	other threads:[~2014-05-10 11:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09 16:26 Ada and PL/pgSQL ? sdalemorrey
2014-05-09 18:02 ` björn lundin
2014-05-09 19:59   ` sdalemorrey
2014-05-09 21:14     ` björn lundin
2014-05-10  9:37 ` Dirk Heinrichs
2014-05-10 10:40   ` Mike H
2014-05-10 11:04 ` björn lundin [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox