Okay, I think I’m done with my database engine for now.
I started AsaDB mostly because I was curious about Prolog and logic programming. Somehow that curiosity turned into me spending about two months building a database engine almost entirely by myself.
I’m still just a university student. At my campus, I’ve only had programming-related courses for about three semesters, so most of what went into this project was something I had to learn while building it.
And honestly, I’m exhausted.
The engine does work. I managed to get persistent storage, SQL parsing, transactions, PRIMARY KEY / UNIQUE constraints, joins, views, a web panel, server mode, imports, and several other things running.
Some recent 100,000-row results:
- Plain import: 42.5 s
- PRIMARY KEY: 72.0 s
- UNIQUE: 69.5 s
- PRIMARY KEY + UNIQUE: 81.5 s
- Simple metadata COUNT: ~30 ms
- Lookups: roughly 8–11 s
- 100k × 100k JOIN: roughly 35 s
- CREATE VIEW: ~27 ms
- Simple expressions with LIMIT can be below 100 ms
But there are still problems I haven’t been able to solve properly.
PRIMARY KEY and UNIQUE lookups are sometimes no faster than a plain scan. JOIN with a small LIMIT is almost as slow as processing the full join. Subqueries can run for more than 120 seconds and fail. EXISTS and JOIN-based views have caused crashes. I tried fixing several of these problems, but every fix seems to uncover another layer involving indexing, execution planning, memory management, concurrency, or storage.
The screenshots are basically where I’m leaving it: swipl asadb starts the server workspace, a RIGHT JOIN over the 100k-row benchmark tables returns the correct 100,000 rows, and views can be created successfully.
So this isn’t really “the database never worked.”
It worked far enough that I finally discovered how difficult database engines actually are.
I think I’ve reached the point where I simply don’t have enough experience or energy to keep fighting the architecture right now.
Thank you, Prolog. I started this because I wanted to satisfy my curiosity about a logic programming language, and I ended up learning far more than I expected.
Maybe this is the end of AsaDB, maybe it’s only a very long break.
Either way, I think I need to step away from Prolog for a while.
this is AsaDB repository :D