Database Engine Project: Storage Engine Architecture Ⅵ
This article will walk through the design and rationale behind the StorageEngine, setting the stage for future work on TableManager and beyond.
This article will walk through the design and rationale behind the StorageEngine, setting the stage for future work on TableManager and beyond.
After we build the AST Tree, we now need to validate SQL statement to make sure it can actual runs.
The parser is the bridge between the flat token sequence from our tokenizer and the hierarchical AST representation that enables semantic analysis and execution.
Before we can build a parser, we need to understand what we're parsing toward - the Abstract Syntax Tree (AST).
In the previous article, I’ve covered the overall structure of my database engine project. This article will focus on the SQL layer. Specially about how to prepare for lexical analysis.
In this post, I’ll walk through the framework and architecture of my project, explain the module separation, and share why I structured the system in this way.
We solve the subarray product problem either with a sliding window in O(n), or by transforming products into prefix sums via logarithms and applying binary search in O(n log n).
If two prefix sums have the same remainder modulo k, their difference is divisible by k.
The O(n^2) Solution is easy to understand, so I will just explain why the Hash Table works.
Sometimes when I’m playing games on my phone, ads pop up and I get too lazy to reach for it just to click close. I thought it’d be easier if I could control my phone directly with my mouse while sitting at the computer—and that’s how I ended up using scrcpy.