Live data from Hacker News

Why CockroachDB doesn't use EvalPlanQual

cockroachlabs.com

1–10 of 63 posts

Re: Why CockroachDB doesn't use EvalPlanQual

#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 obviously much better for them than newsql) but the scalability of new SQL databases might allow them to prefer easy consistency over single node performance.

Possibly this is also just the passage of time benefiting newer systems.

Re: Why CockroachDB doesn't use EvalPlanQual

#3
Author here. We've spent the past year adding read committed isolation to CockroachDB.

There were many interesting design decisions, such as:

- whether to use multiple snapshots or a single snapshot per statement

- how to handle read uncertainty intervals

- how to incorporate SELECT FOR UPDATE locking into Raft

- how to handle SELECT FOR UPDATE subqueries

- how to prevent lost update anomalies between two UPDATEs

Some of the gory details are in the public RFC: https://github.com/cockroachdb/cockroach/blob/master/docs/RF...

This blog post just discusses the last point, but please AMA.

Re: Why CockroachDB doesn't use EvalPlanQual

#8
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 useful tool to artificially slow things down, but now I don't know I don't know if I should interpret that as one command or two. If `WITH sleep AS (SELECT pg_sleep(5)) UPDATE player SET level = 'AA' FROM sleep WHERE team = 'Gophers';` is atomic then I'd expect it to put a lock on the 3 Gophers (which doesn't include Stonebreaker), wait the 5 seconds and then complete the update. The player swap would be blocked for those 5 seconds because it touches a row that's being updated.

Re: Why CockroachDB doesn't use EvalPlanQual

#9

[flagged]

I scoffed at first, but I guess cockroach sounds to some what "maggot" sounds like to me.

Like the other person said, it's related to the survivability of cockroaches. One can hope for a management tier competent enough to evaluate an internal database on the merits.

Re: Why CockroachDB doesn't use EvalPlanQual

#10

[flagged]

I'm relatively ambivalent on the name issue specifically, but I do think this has been hashed over ad nauseum to the point of making for boring reading. This line from the HN guidelines:

> Please don't pick the most provocative thing in an article or post to complain about in the thread. Find something interesting to respond to instead.

stands out as particularly relevant.

Post reply on HN