Because we generate all the code(Java) in theory it is possible for us to generate database code(Instead of SQL) that is very optimized for that application. I am not a big expert in designing database internals, but I know a bit on how do they do the indexing, query optimization etc.
The question is: Consider an application like BaseCamp(or some CRM) where structure of the database is fixed, and the quarries performed on the database is all known in advance(including info on how often we perform them), How much optimization can we do by eliminating SQL and directly interacting with the internals of database(that too optimized for our specific schema)?
Consider it as 'we take SQLLite/H2 code, and we optimize it for one specific schema and queries'.
I know this is always specific to the schema and the queries, but I want to get an idea, so that I can decide to go in that direction or not. Can it be 10x to 100x faster in general?