- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Hey, are you arguing with me because we agree?
Admin
Indices don't avoid locking tables or table sections. Depending on your query, you then need to lock multiple tables or sections, because you have that JOIN. The real performance killer is the lock; the JOIN is just the method to deliver it.
Admin
If you have a JOIN and you need a lock, then you'll need that lock anyway, even if you get rid of the JOIN
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
One lock vs. multiple locks.
I'm not even going to explain that.
Admin
So, lock absolutely everything or have the ability to long only part of the database? (The really expensive things in databases are write-transaction commits. Unless you're using SSDs…)
Admin
Admin
What, have you never heard of MVCC? Locking everything under the sun is so 90s era...
No -- I'm saying you're making a false assumption (that small databases don't exist outside of college).Bonus kicker: You know that
list_of_children
column? It's a CLOB, as some of those key-lists are over twice the length limit of an Oracle VARCHAR2.Admin
Yeah, that's what I thought when I first saw those columns -- it's the only way you can run joins on them though!
You know someone botched the database design when you have a query that takes over an hour to return 500 rows...
(We have basically 0 control over it, too -- our vendor is to blame for this abomination, partly because they believe that flat text files are a cromulent way to store relationally-modeled data, and partly because they edit those flat text files by hand on a regular basis.)
Admin
Maybe you could get a better DB that doesn't LOCK ALL THE THINGS?
Admin
i suspect that the perpetrator of that will manage to do something equally ugly no matter what tech is involved.
Also WAT
Admin
So... then you don't know what 3NF does? Otherwise I cannot explain WTF you're talking about.
Admin
True, the really expensive things are write operations. But that's not the context of this little debate we're having. The debate is why JOIN makes locking worse.
Admin
If you don't know how to sort out table/page/row locking, and make sure that you only lock what needs to be locked, then either a) learn how locking works, or b) find an RDBMS that doesn't suck ass.
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
Oh, and an INB4:
<!-- Emoji'd by MobileEmoji 0.2.0-->SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
. There. No read locks taken for the query/session.Admin
I admire your unwavering faith.
Admin
Oh sure, instead of designing your database schema well for the performance criteria, prefer returning stale data. Yeah, good one, mate. You've disqualified yourself from this conversation.
Admin
Go learn how locking and transaction isolation works, then come back and try your bullshit; maybe you'll actually have a valid point. Until then, stay away from databases; it's clear all you'll do to them is fuck them up.
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
Hint to @unwesen : it's one of the things Oracle gets right.
(PostgreSQL gets it right too, if you are in an Oracle-free zone)
Besides, `READ UNCOMMITTED` exposes you to *dirty reads*, not stale data. (Oracle and PostgreSQL *don't even support it*.)Admin
He said this earlier:
So I think we're working with different expectations about databases than @unwesen is.
Admin
With the crap he's spewing, I'm not even sure he is talking about databases…
<!-- Emoji'd by MobileEmoji 0.2.0-->Admin
Wow wow! Isn't there anything more boring than DB flamewars? Yeah, DB locks and transactions flamewars!
Admin
We could start talking about video games?
Admin
We're talking about ACID and databases, and he's simply on acid? Err, MySQL?
Admin
Everyone by now is aware that ORM are in your future.
Admin
Ordinary Restful Moments? Indeed…
Admin
Ha ha! Ordinary Rectum Movement more like it, for people not eating enough radishes in diet, those are also difficult to obtain.
Admin
So: what colour is that dress?
Admin
Discopink
<!-- Emoji'd by MobileEmoji 0.2.0-->