3 ms·
Often I wonder if people are attacking the wrong problem. Personally, my "DB" problems mostly revolve around SQL the language, as opposed to the RDBMS model. S
by arohner 18y ago
Often I wonder if people are attacking the wrong problem.
Personally, my "DB" problems mostly revolve around SQL the language, as opposed to the RDBMS model. SQL is a piss poor language for what most developers want to accomplish.
1) SQL queries are not composable, and it's a bear to make more complex queries by building on top of existing queries. i.e. I have a query to find all customers who live in CA. Now I want to find the list of customers who live in CA and bought product Foo in the last year. There are many tools like ActiveRecord and SQLAlchemy that attempt to sweep some of the complexity under the rug, but nothing comes close to covering it in the general case, and once it breaks you're back to writing SQL by hand. I blame the complexity of the language syntax.
2.) The SQL model is declarative, which is nice when it works, but really sucks when it doesn't. Being able to look at a query and know whether it is fast or not depends highly on your DB vendor and product version, and is basically impossible without the EXPLAIN command. Writing efficient SQL requires you know that your vendors optimizes this command, but not that command, but only in versions 8.2 and later.
3.) Sometimes, I really really want to call map, filter and reduce on my dataset to write my own queries. In some cases, it is much simpler than a page of SQL. Yes, this isn't purely relational, but I don't care. I want fast, simple access to my data, and preferably in the same language I'm using for development . No programming paradigm (imperative, OO, declarative, functional) is perfectly applicable in all situations. So why does SQL declare that declarative style is the One True Way to get access to your data?
- deleted 18y ago[deleted]