Live data from Hacker News

Why CockroachDB doesn't use EvalPlanQual

cockroachlabs.com

11–20 of 63 posts

Re: Why CockroachDB doesn't use EvalPlanQual

#12

[flagged]

Look, every single time this database is mentioned here, this exact comment comes up. Every. Time. For years, and years, and years. And yet, true to its name, the database and the team building it are still around.

At some point we've got to realize the CRDB team is comfortable with the name, it's not going to change, and all comments lambasting it are just farts in the wind.

Re: Why CockroachDB doesn't use EvalPlanQual

#13
post #2

It's often talked about how new sql databases offer better scalability than standard SQL databases, but I think it's maybe sometimes underappreciated how (some, not all) of them are also much simpler in terms of their consistency models. I'd speculate this is because postgres and friends try to eek out every bit of single node performance (which helps with single row throughout and overall throughout, which is obviou…

Even more generally, distributed systems can find simpler solutions to things like "raise the throughput ceiling", and "handle disk failure", and "handle power failure" than single-box systems. This is for the simple reason that they have more options: beyond the constraints of a box, resource allocation is more flexible, failures less correlated, etc. That allows modern distributed databases to simply avoid some of the super hard problems that prior databases had to solve. Efficiency is still important, but the thing to optimize is mean system efficiency, not the peak performance of a handful of super hot boxes.

There's also the fact that decades of DB research have brought techniques and approaches that beat old ones, and retrofitting existing systems with them can be hard (e.g. see the efforts to remove some of the sharp edges of PG's MVCC behavior and how hard they've turned out to be).

Re: Why CockroachDB doesn't use EvalPlanQual

#14

I'm having trouble with the example given. If `UPDATE player SET level = 'AA' WHERE team = 'Gophers';` is executed before the player swap, then why should "Stonebreaker" be upgraded to "AA"? I'd be pretty mad at my database if I sent those 2 queries in sequence and my DB decided to re-order them. The sleep actually really complicates things here. I understand some queries run slower than others and the sleep is a use…

The timing of this example is tricky because the two update statements execute concurrently (which is only possible under read committed isolation; under serializable isolation it's much more like what you're describing).

Here's a full timeline in PG (U1 for first update, U2 for second update):

0. U1 begins executing, establishes read snapshot, starts pg_sleep(5).

1. U2 runs to completion.

2. U1 wakes up after 5 sec, scans `player` using snapshot from step 0.

3. U1 filters `team = Gophers`, gets 4, 5, 6.

4. U1 locks 4, 5, 6.

5. U1 performs EvalQualPlan: re-scans latest version of those locked rows, which sees U2's write to 4 but not to 3.

6. U1 performs EvalQualPlan: re-filters those locked rows using latest version, gets 5, 6.

7. U1 writes new versions.

CRDB is easier to reason about: after U1 wakes up from the sleep, it sees that it conflicts with U2 and simply retries the entire statement.

Re: Why CockroachDB doesn't use EvalPlanQual

#16

[flagged]

Really? is your management stupid?

Ha! Do you think this is uncommon? The path to becoming a manager in many organizations is biased towards those who are good at politics, loyal, a friend, and charismatic—all sorts of things that don't ensure effective approaches to technology selection.

Re: Why CockroachDB doesn't use EvalPlanQual

#19

[flagged]

Look, every single time this database is mentioned here, this exact comment comes up. Every. Time. For years, and years, and years. And yet, true to its name, the database and the team building it are still around. At some point we've got to realize the CRDB team is comfortable with the name, it's not going to change, and all comments lambasting it are just farts in the wind.

[deleted]
Post reply on HN