Transaction question

Поиск
Список
Период
Сортировка
Искать

Transaction question

От:
Dragan Zubac <zubac@vlayko.tv>
Дата:
Hello all

Didn't know where to submit question regarding design&performance. 
Here's the situation.
Basically process will take one message at a time,send it and the will 
send another one,each process knows which message to take from the table 
based on provider value.

First situation:

table layout:

id bigint
user int
provider int

Begin transaction,take one message from the table,send it,if all went 
well,then commit.The drawback of this situation is that transaction can 
last much longer depending how much time it will take to send message 
and confirm it was sent based on protocol used.

Second situation:

table layout:


id bigint
user int
provider int
taken boolean
sent boolean
false boolean

In this scenario the process will take one message from the table,and 
mark it as 'taken',meaning it is taken for processing.The process will 
try to send message,if it succeed,it will update column 'sent',otherwise 
it will update column 'false'. In this scenario ,we'd have two instead 
of one transaction but each of this transaction will last much less then 
in first scenario,hence we might be able to achieve greater TPS then in 
first case.

Hope You got my point,maybe somebody already had the same/similar 
situation ?

Sincerely

Dragan Zubac

Re: Transaction question

От:
"Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Дата:
>>> On Fri, Nov 23, 2007 at  5:31 AM, in message <4746BA2F.6030104@vlayko.tv>,
Dragan Zubac  wrote: 
> 
> Didn't know where to submit question regarding design&performance. 
 
This page is the place to figure that out:
 
http://www.postgresql.org/community/lists/
 
For the questions you have, you probably should post in pgsql-general.
Possibly pgsql-performance.
 
> Begin transaction,take one message from the table,send it,if all went 
> well,then commit.
 
I'm not clear on what you mean by "take one message from the table".
(Do you mean that you will select it and delete it?)  I'd suggest a re-post
in a more appropriate list with a little more detail of this type, to give
people more to go on.
 
I'm sorry I wasn't able to help more; not quite enough information
there....
 
-Kevin
 


FAQ