3 ms·
The perfect target candidate for zero cost abstractions is a data base api. With databases as the bottleneck of web development it is not optimal to use such h
by crimsonalucard 7y ago
The perfect target candidate for zero cost abstractions is a data base api.
With databases as the bottleneck of web development it is not optimal to use such high level apis like SQL to optimize everything. We resort to ANALYZE and strange sql hacks to trick the query engine into performing the right algorithms when the api should explicitly let us choose to use or tweak both zero cost abstractions and/or a query planners.
- brianberns 7y agoI love SQL, but I strongly agree with this. It would be great to have a platform-specific low-level API for performance-critical queries. (Much like “unsafe” code in a managed programming language.)
- jpgvm 7y agoI think the best analogy would be SQL is to OpenGL what this API would be to Vulkan. Ability to define the query procedurally or atleast semi-so vs the declarative approach of SQL would allow direct optimisation of very performance critical queries.
- GrayShade 7y agoI disagree. The amount of optimization that a query planner does is vastly more than a web application developer would care for. We have people who can't be bothered to close database transactions (see that Uber report). I wouldn't trust then to choose the optimal join strategy in a complex query.
- mamcx 7y agoyes. This is part of what I have say about "make a GENERAL relational language and code the (full) app on it". Is unnecessary complexity to have the "schema" split in several places (the DB catalog, the table, the view(s), the SQL fragment, the struct/classes, the mappings). In my mind this is all you will need: rel City of id:Pk name:Str CHECK NotEmpty just ONCE. If also, we can express the relational operators "raw": plan1 = Scan(City, WHERE id= 1) plan2 = FindKey(City, WHERE id= 1) plan3 = City ?where id= 1 |> toPlan (turn into one of the above) then is possible to also get zero cost abstractions. BTW: Slowly I'm building this: http://tablam.org http://tablam.org Stuck on trait objects this weeks, probably will stick with enums!