in reply to Re: How to Speed up MySQL w/ Perl
in thread How to Speed up MySQL w/ Perl

It would only be a one-statement transaction if %Data contains less than two elements. It's unlikely that that is the common case.

Each element of %Data would be a different transaction anyways. Unless, of course, you plan on having a 2-million+ insert transaction. That will strain any rollback segment. (This is actually one reason why I'm moving from Oracle to MySQL.)

you have committed yourself to never be able to use transaction on modifications of that table.

Nope. ALTER TABLE FOO.BAR TYPE=INNODB now means that the table is ACID-transaction capable.

And, I can think of a specific case where I know I don't need transactions - a database that is loaded once and will never be written to. In that case, I don't want the overhead of a transaction on my SELECT statements.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Replies are listed 'Best First'.
Re: How to Speed up MySQL w/ Perl
by Abigail-II (Bishop) on May 26, 2004 at 14:46 UTC
    Each element of %Data would be a different transaction anyways.
    "Would be"? What do you mean? The way I wrote it, it's in one transaction as it should be.
    Unless, of course, you plan on having a 2-million+ insert transaction. That will strain any rollback segment.
    *blink* I wouldn't think for a nanosecond to not put them in one transaction. 2 million chances for something to go wrong - better protect myself against it. And since no futher information is available, I'm not going to assume that a partially modified table is acceptable. Besides, it's not only failure you want to protect yourself against - other processes should see a consistent table, and not one where half the rows are modified, and the other half aren't.
    And, I can think of a specific case where I know I don't need transactions - a database that is loaded once and will never be written to. In that case, I don't want the overhead of a transaction on my SELECT statements.
    Quite a specific case, and not at all applicable to the OP's problem where the database is being modified.

    Abigail