From: Brian A. <br...@ta...> - 2001-04-24 06:35:51
|
Stephen Clouse wrote: > 1. LOCK TABLES. This is called in a number of places, but I don't understand > why. Because MySQL lacks row-level locking? To ensure a consistent > read/write due to the lack of transactions? Some explanation is necessary Poor man's transactions. For instance, in user creation it keeps two users from creating an account with the same name at the same time. > 2. 1=1. This pops up in several where clauses. It looks like a noop to me, > but something mentioned it was some sort of optimization. MySQL specific, > perhaps? Oracle just ignores it, from what SQL traces have told me. Yep, that is what it is. It also tells MySQL to not reset sequences on tables where "DELETE FROM table_name" happens. > The other thing I'm wondering is, where is Slash's "main" loop? AutoCommit is a > pretty major loss on Oracle, so it would be desirable to turn it off and perform Ask yourself this, is it? Why don't you want the commit to just happen? To be honest on most pages all there is, is one INSERT that happens to access_log. > a single commit after each client request, both for performance and to avoid > partial writes. I'm looking into doing this but can't determine where it should > be done at. Many pages provide feedback on if everything went ok with INSERTS/UPDATES. So just doing something like tacking on a commit() would keep the user from knowing if what they tried to do actually worked. Keep in mind, outside of a couple of places where we have LOCK calls, there are no transactions, no need to worry about commit/rollback. The few locks that exist are where transactions need to occur (and the MySQL code within the year will probably go through the came changes). The two that come to mind are user creation and the call to get maxcomment. I have some patches that will change the sqlDO("LOCK") stuff over to methods. You could override those with commit/rollback calls. -Brian -- _______________________________________________________ Brian Aker, br...@ta... Slashdot Senior Developer Seattle, Washington http://tangent.org/~brian/ http://slashdot.org/ _______________________________________________________ You can't grep a dead tree. |