Home > Archive > PostgreSQL Discussion > April 2005 > rollback vs. commit for closing read-only transaction









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author rollback vs. commit for closing read-only transaction
David Parker

2005-04-25, 8:24 pm

If an application transaction is known to be read-only, is there any
reason to prefer COMMIT or ROLLBACK for closing that transaction? Would
there be any performance difference between the two commands?

- DAP
------------------------------------------------------------------------
----------
David Parker Tazz Networks (401) 709-5130





Bruce Momjian

2005-04-25, 8:24 pm

David Parker wrote:
> If an application transaction is known to be read-only, is there any
> reason to prefer COMMIT or ROLLBACK for closing that transaction? Would
> there be any performance difference between the two commands?


Doesn't matter.

--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql
.org

Dann Corbit

2005-04-25, 8:24 pm

Probably, turning fsync off would be helpful, since you know it is
read-only.

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Bruce Momjian
> Sent: Monday, April 25, 2005 3:01 PM
> To: David Parker
> Cc: postgres general
> Subject: Re: [GENERAL] rollback vs. commit for closing read-only
> transaction
>
> David Parker wrote:
Would[color=darkred]

>
> Doesn't matter.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman@candle.pha.pa.us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania
> 19073
>
> ---------------------------(end of

broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to

majordomo@postgresql
.org

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Tom Lane

2005-04-25, 8:24 pm

"Dann Corbit" <DCorbit@connx.com> writes:
> Probably, turning fsync off would be helpful, since you know it is
> read-only.


Wouldn't make any difference: a transaction that hasn't modified the
database doesn't bother to write any commit/abort WAL record at all.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Richard_D_Levine@Raytheon.com

2005-04-26, 9:23 am

For portability's sake commit successful transactions and rollback those
that fail.

Rick

pgsql-general-owner@postgresql.org wrote on 04/25/2005 05:53:11 PM:

> "Dann Corbit" <DCorbit@connx.com> writes:
>
> Wouldn't make any difference: a transaction that hasn't modified the
> database doesn't bother to write any commit/abort WAL record at all.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql
.org so that your
> message can get through to the mailing list cleanly



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com