On Wed, 17 Aug 2005 08:35:08 -0500
Puneet Kishor <[EMAIL PROTECTED]> wrote:

#> Why are you wrapping a SELECT statement inside a transaction? What 
#> purpose does that serve? Transactions are meant for statements that 
#> modify the table,

Not true. Of course, wrapping a single SQL statement in a transaction
is a bit pointless, but wrapping multiple selects is *not*. It
prevents you from seeing inconsistent state of the database.

For example, if you read data from table1, somebody else modifies
table1 *and* table2, then you read data from table2, you can be in
trouble. Transaction prevents this.

#> > If I use simple beginTransation, the for cycle ends in 8 seconds
#> > which is a good time.

#> Even 8 seconds is way too much for a simple SELECT. In fact, 8
#> seconds is way too much even for an INSERT. There is something else
#> going on here.

I believe he meant 8 seconds for a 1000 selects... which sounds
reasonable to me.

-- 
 Best wishes,
   Slawomir Nowaczyk
     ( [EMAIL PROTECTED] )

Do not meddle in the affairs of Unix, for it is subtle and quick to core dump.

Reply via email to