Notes

I’ve never been enthusiastic about the AI revolution.
However, this week, I started using Zed.dev together with their AI assistant integration. I’m surprised by the experience and efficiency gains. I still have reservations, but it can be valuable allies in tackling programming challenges and routine tasks.
For example, a few days ago, I was working on a tool that needed to parse ClickHouse explain output1, an easy task requiring recursively transverse all the properties looking for some specific properties.
With a simple prompt, the model wrote a working version.
Write code to extract all primary key granules from explain_result. An example of explain_result here:
{…}
def extract_primary_key_granules(explain_result):
def traverse(node):
granules = []
if isinstance(node, dict):
if 'Indexes' in node:
for index in node['Indexes']:
if index.get('Type') == 'PrimaryKey':
granules.append({
'Keys': index.get('Keys', []),
'Initial Granules': index.get('Initial Granules', 0),
'Selected Granules': index.get('Selected Granules', 0)
})
for value in node.values():
granules.extend(traverse(value))
elif isinstance(node, list):
for item in node:
granules.extend(traverse(item))
return granules
return traverse(explain_result)
# Example usage:
result = extract_primary_key_granules(explain_result)
for granule in result:
print(f"Keys: {granule['Keys']}")
print(f"Initial Granules: {granule['Initial Granules']}")
print(f"Selected Granules: {granule['Selected Granules']}")
print()
The task was relatively easy and I had to make changes and improve the initial code. Despite that, this saved me at least an hour of back-and-forth writing the function and running some tests to see if it worked as expected!
I started using Zed AI assistant with ChatGPT integration. A day after they released their own integration that I’m now testing together with Anthropic’s Claude model. I’m not even using Google for simple searches anymore.
Footnotes
-
This is how a ClickHouse explain output looks like ↩
-
So You Want To Build A Browser Engine — This article goes deep into all the complicated things involved in making a browser engine. It’s amazing how browsers keep getting better and adding more features while maintaining all the required complexity.
-
Databricks, Snowflake and the future — This piece tells you about the recent meetings of Snowflake and Databricks. It focuses on how they are putting money into Apache Iceberg.
-
The time I spent three months investigating a 7-year old bug and fixed it in 1 line of code — This is an interesting story about someone spending three months trying to fix a really old bug. And how they only needed one line of code to solve it. Nice read about debugging software and hardware.
-
Local, first, forever — An insightful article on the local-first philosophy and the implementation of services without reliance on a centralized server. Includes an introduction to CRDT and a sample implementation.
-
What Goes Around Comes Around… And Around… — A retrospective review of the evolution of relational database management systems over the past two decades. It gives a good overview of how things are and how have evolved.
-
A write-ahead log is not a universal part of durability — Explores the concept of durability in databases, challenging the notion of a write-ahead log as a universal component.
-
Unix’s fsync(), write ahead logs, and durability versus integrity — Expands on Phil Eaton’s post about database durability, incorporating the crucial aspect of integrity into the discussion.
-
The Right Kind of Stubborn — Paul Graham talks about two types of stubbornesss: persistence and obstinacy. He explains that it’s good to keep going when you need to, but it’s bad when you won’t change your mind.
-
Zed Decoded: Rope & SumTree — The Zed team explained how they use B+Tree (or SumTree) to deal with file content in their text editor. I have never considered how text editors use different structures to represent and manipulate huge strings while maintaining good performance. Interesting read.
-
Why does SQLite (in production) have such a bad rep? — A short post about the controversy around SQLite, a database often perceived as unsuitable for production. The most interesting thing is the discussions originated in lobste.rs and Reddit
-
In Codd we Trust (or not) — A brief reflection on Codd’s original idea, which separates logical and physical schema, and the significant role query planners and optimizers play in modern database performance. While I understand the point of letting experienced users write their queries and execute them as they are, I can’t fully agree.
-
Some opinionated thoughts on SQL databases — Another opinionated reflection on relational databases and SQL. I agree with some points. Still, SQL is here to stay. The point that resonated more is how inefficient it is to use SQL as an API in some workloads. I’ve seen query parsing take +50% of the processing time in low latency and high throughput environments. Of course, those numbers are for very specific use cases (e.g., point queries) where the data being read is small, taking just a few milliseconds. Still, the overhead is relevant, and there is little room for improvement when using plain SQL. On the other hand, it is good to use almost all relational databases using a single API language. If you are an experienced PostgreSQL user, you can query a MySQL database without investing hours learning how the new API works.
-
Senior Engineer Fatigue — An article to justify why older people get slower at their jobs. Jokes aside, it’s a good read about why sometimes you need to slow down to get faster. And it applies not only to senior engineers!
-
What Happens When You Put a Database in Your Browser? — The browser is the new OS. A DuckDB article about running their software in browsers using Wasm. The text provides a good example of pre-visualizing parquet file schema on the fly from the browser.