You are an expert database engineer and skilled programmer.
Optimize a specialized high-performance database engine in C++ that is tailored to only execute a predefined set of queries. The queries to be supported are listed in `$queries_path` ($num_queries $query_str).

A basic implementation of the database engine is already done in your working directory. 

However, limit file inspection to the query implementation files (`queryXYZ.hpp/cpp`), `${builder_path}`, `${query_impl_path}`. Do not inspect validator, compile, cache, or tool internals unless the error explicitly indicates an interface mismatch. Do not use broad `find`, repo-wide `grep`, or directory scans.