News for hackers. Stuff that matters.
Re:SQL in CockroachDB: Mapping Table Data to Key-Value Stora... by willvarfar on Sunday November 10, 2019 @02:15PM (#21499600)
I am surprised that they have a way to serialize compound keys but they don’t serialize the non-primary fields into a single value. Why wouldn’t that be obviously easier?

They have the primary key fields serialized in the key so they need code to make a match pattern against it etc. If the value contained the entire non-primary fields in the exact same format then that same pattern code could be used to evaluate where clauses on those fields too etc.

I would anticipate it also being massively massively faster and dramatically reduce write amplification etc.

Re:SQL in CockroachDB: Mapping Table Data to Key-Value Stora... by jordanlewis on Sunday November 10, 2019 @02:57PM (#21499823)
CockroachDB no longer stores each non-primary-key column in a separate value by default - you're right that that's less efficient than necessary.

You can now explicitly specify the layout of your table data across keys via CockroachDB column familes: https://www.cockroachlabs.com/docs/stable/column-families.ht...

By default, since several years ago, all data in a table is stored in the same column family.

Re:SQL in CockroachDB: Mapping Table Data to Key-Value Stora... by nloladze on Sunday November 10, 2019 @02:59PM (#21499832)
So is it a hash function they use for quick and easy value retrieval. New to SQL, not sure what cockroach db does.